Zfilipin has submitted this change and it was merged.

Change subject: A test for bug 50790
......................................................................


A test for bug 50790

This test checks that the selected input method
is remembered after disabling IME and going to
another page.

Bug: 50790
Change-Id: I94bd779577251d51a20471a6a39ab1ee6cd6927e
---
M features/step_definitions/uls_ime_steps.rb
M features/support/pages/random_page.rb
M features/uls_ime.feature
3 files changed, 55 insertions(+), 0 deletions(-)

Approvals:
  Zfilipin: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/features/step_definitions/uls_ime_steps.rb 
b/features/step_definitions/uls_ime_steps.rb
index 3068ae5..f93a588 100644
--- a/features/step_definitions/uls_ime_steps.rb
+++ b/features/step_definitions/uls_ime_steps.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
 When(/^I click on an input box$/) do
   on(RandomPage).search_input_element.click
 end
@@ -17,3 +19,35 @@
 Then(/^I should see names of languages in it$/) do
   on(RandomPage).input_method_language_list_element.should be_visible
 end
+
+When(/^I click on the ellipsis at the bottom of the list$/) do
+  on(RandomPage).more_languages
+end
+
+When(/^in the language filter I type (.+)$/) do |language_abbreviation|
+  on(RandomPage).language_filter=language_abbreviation
+end
+
+When(/^I click on the link to select Malayalam$/) do
+  on(RandomPage).malayalam_link
+end
+
+When(/^I click on the Malayalam InScript 2 menu item$/) do
+  on(RandomPage).uls_malayalam_inscript2_item
+end
+
+When(/^I press Control\-M$/) do
+  on(RandomPage).search_input_element.send_keys [:control, 'm']
+end
+
+When(/^I go to another random page$/) do
+  visit(RandomPage)
+end
+
+Then(/^in it there must be an element with Malayalam text$/) do
+  on(RandomPage).input_method_enabled == 'ഇൻസ്ക്രിപ്റ്റ് 2'
+end
+
+Then(/^I should see the enabled input method keyboard icon at the bottom 
right$/) do
+  on(RandomPage).input_method_enabled_element.should be_visible
+end
diff --git a/features/support/pages/random_page.rb 
b/features/support/pages/random_page.rb
index 7e8b030..ca5e447 100644
--- a/features/support/pages/random_page.rb
+++ b/features/support/pages/random_page.rb
@@ -9,12 +9,17 @@
   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')
   ul(:input_method_language_list, class: 'ime-language-list')
   div(:input_method_selector_menu, class: 'imeselector-menu')
+  text_field(:language_filter, id: 'languagefilter')
   div(:language_settings_dialog, id: 'language-settings-dialog')
   li(:main_page, id: 'n-mainpage-description')
+  a(:malayalam_link, title: 'Malayalam')
+  a(:more_languages, class: 'ime-selector-more-languages')
   a(:print_export, text: 'Print/export')
   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')
diff --git a/features/uls_ime.feature b/features/uls_ime.feature
index 8098321..64c9e49 100644
--- a/features/uls_ime.feature
+++ b/features/uls_ime.feature
@@ -12,3 +12,19 @@
       And I click on the IME keyboard icon
     Then I should see the dropdown menu with a list of keymaps
       And I should see names of languages in it
+
+  Scenario: Input method is preserved after going to a different page
+    Given I am at random page
+    When I click on an input box
+      And I click on the IME keyboard icon
+      And I click on the ellipsis at the bottom of the list
+      And in the language filter I type ml
+      And I click on the link to select Malayalam
+      And I click on the IME keyboard icon
+      And I click on the Malayalam InScript 2 menu item
+      And I press Control-M
+      And I go to another random page
+      And I click on an input box
+      And I press Control-M
+    Then I should see the enabled input method keyboard icon at the bottom 
right
+      And in it there must be an element with Malayalam text

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I94bd779577251d51a20471a6a39ab1ee6cd6927e
Gerrit-PatchSet: 15
Gerrit-Project: qa/browsertests
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Cmcmahon <cmcma...@wikimedia.org>
Gerrit-Reviewer: Rachel99 <rachelq...@gmail.com>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to