Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92289


Change subject: Refactoring ime tests
......................................................................

Refactoring ime tests

Scenarios:
* Input method menu
* Input method indicator is shown
* Unsupported input language (pending)

Added IMEPage

Change-Id: I1f68d177bd05baca6ae8da97364b81a4d851b8b6
---
M tests/browser/features/ime.feature
M tests/browser/features/step_definitions/ime_steps.rb
M tests/browser/features/support/pages/random_page.rb
3 files changed, 12 insertions(+), 20 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/89/92289/1

diff --git a/tests/browser/features/ime.feature 
b/tests/browser/features/ime.feature
index 9d6e2f2..d854156 100644
--- a/tests/browser/features/ime.feature
+++ b/tests/browser/features/ime.feature
@@ -5,6 +5,7 @@
 method in different input fields and temporarily activate and deactivate the
 input method.
 
+  @commons.wikimedia.beta.wmflabs.org
   Scenario: Input method indicator is shown
 
   The input method indicator is shown when input field gets a focus.
@@ -13,6 +14,7 @@
     When I click on an input box
     Then I should see the input method indicator
 
+  @commons.wikimedia.beta.wmflabs.org
   Scenario: Input method menu
 
   Input method menu is shown when user clicks the input method indicator.
@@ -24,6 +26,7 @@
       And I should see a list of available input methods
       And I should see a list of suggested languages
 
+  @commons.wikimedia.beta.wmflabs.org
   Scenario: Unsupported input language
 
   User visits a wiki with content language that does not have have an input
diff --git a/tests/browser/features/step_definitions/ime_steps.rb 
b/tests/browser/features/step_definitions/ime_steps.rb
index 384487f..10cc792 100644
--- a/tests/browser/features/step_definitions/ime_steps.rb
+++ b/tests/browser/features/step_definitions/ime_steps.rb
@@ -7,40 +7,34 @@
 end
 
 When(/^I click on an input box$/) do
-  on(RandomPage) do |page|
-    page.search_input_element.click
-    # For some reason click alone doesn't seem to trigger the ime indicator
-    # when running tests
-    page.search_input_element.send_keys ' '
-  end
+  on(IMEPage).search_input_element.click
 end
 
 When(/^I click on the input method indicator$/) do
-  on(RandomPage).input_method_element.when_present.click
+  on(IMEPage).input_method_element.when_present.click
 end
 
 When(/^I open the input method menu$/) do
-  on(RandomPage) do |page|
-    page.search_input_element.fire_event "onfocus"
-    page.search_input_element.click
-    page.input_method_element.when_present.click
+  step 'I click on an input box'
+  pending('Bug in ULS with unsupported languages like avk') do
+    on(IMEPage).input_method_element.when_present.click
   end
 end
 
 Then(/^I should see the input method indicator$/) do
-  on(RandomPage).input_method_element.when_present.should be_visible
+  on(IMEPage).input_method_element.when_present.should be_visible
 end
 
 Then(/^I should see input methods for (.+)/) do |language|
-  on(RandomPage).input_method_ime_list_title.should == language
+  on(IMEPage).input_method_ime_list_title.should == language
 end
 
 Then(/^I should see a list of available input methods$/) do
-  on(RandomPage).input_method_selector_menu_element.should be_visible
+  on(IMEPage).input_method_selector_menu_element.should be_visible
 end
 
 Then(/^I should see a list of suggested languages$/) do
-  on(RandomPage).input_method_language_list_element.should be_visible
+  on(IMEPage).input_method_language_list_element.should be_visible
 end
 
 When(/^I choose (.+?) as the input language$/) do |language|
diff --git a/tests/browser/features/support/pages/random_page.rb 
b/tests/browser/features/support/pages/random_page.rb
index 38de138..edc8181 100644
--- a/tests/browser/features/support/pages/random_page.rb
+++ b/tests/browser/features/support/pages/random_page.rb
@@ -8,11 +8,7 @@
   a(:create_a_book, text: 'Create a book')
   a(:download_as_pdf, text: 'Download as PDF')
   a(:download_the_file, text: 'Download the file')
-  div(:input_method, class: 'imeselector imeselector-toggle')
   a(:input_method_enabled, class: 'ime-name imeselector-toggle')
-  h3(:input_method_ime_list_title, class: 'ime-list-title')
-  ul(:input_method_language_list, class: 'ime-language-list')
-  div(:input_method_selector_menu, class: 'imeselector-menu')
   text_field(:language_filter, id: 'languagefilter')
   li(:main_page, id: 'n-mainpage-description')
   a(:malayalam_link, title: 'Malayalam')
@@ -21,6 +17,5 @@
   a(:printable_version, text: 'Printable version')
   li(:uls_malayalam_inscript2_item, data_ime_inputmethod: 'ml-inscript2')
   button(:search_button, id: 'searchButton')
-  text_field(:search_input, id: 'searchInput')
   a(:uls_trigger, class: 'uls-trigger')
 end

-- 
To view, visit https://gerrit.wikimedia.org/r/92289
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f68d177bd05baca6ae8da97364b81a4d851b8b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to