Refactor Sticky input methods

Change-Id: I20ee4e7b90ec9aaa3155fe2e357cf04388d0994c
This commit is contained in:
Niklas Laxström
2013-10-30 11:50:13 +02:00
parent 95ebe24cab
commit 3398a949e3
4 changed files with 11 additions and 13 deletions

View File

@@ -26,7 +26,6 @@ input method.
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
@@ -36,6 +35,7 @@ input method.
When I open the input method menu
Then I should see input methods for Kotava
@commons.wikimedia.beta.wmflabs.org
Scenario: Sticky input methods
Chosen input method selection persists across page loads.

View File

@@ -16,10 +16,8 @@ end
When(/^I open the input method menu$/) do
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(IMEPage).input_method_element.when_present.should be_visible
@@ -38,7 +36,7 @@ Then(/^I should see a list of suggested languages$/) do
end
When(/^I choose (.+?) as the input language$/) do |language|
on(RandomPage) do |page|
on(IMEPage) do |page|
page.more_languages
page.language_filter = language
# firefox only works with :return
@@ -49,11 +47,11 @@ When(/^I choose (.+?) as the input language$/) do |language|
end
When(/^I click on the Malayalam InScript 2 menu item$/) do
on(RandomPage).uls_malayalam_inscript2_item_element.click
on(IMEPage).malayalam_inscript2_element.click
end
When(/^I press Control\-M$/) do
on(RandomPage).search_input_element.send_keys [:control, 'm']
When(/^I press Control-M$/) do
on(IMEPage).search_input_element.send_keys [:control, 'm']
end
When(/^I go to another random page$/) do
@@ -62,7 +60,7 @@ end
Then(/^in it there must be an element with Malayalam text$/) do
# 'input_method_enabled' alone only returns []
on(RandomPage).input_method_enabled_element.text.should == 'ഇൻസ്ക്രിപ്റ്റ് 2'
on(IMEPage).input_method_enabled_element.text.should == 'ഇൻസ്ക്രിപ്റ്റ് 2'
end
When(/^I visit page in Vector skin$/) do

View File

@@ -2,8 +2,12 @@ class IMEPage
include PageObject
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(:malayalam_inscript2, data_ime_inputmethod: 'ml-inscript2')
a(:more_languages, class: 'ime-selector-more-languages')
text_field(:search_input, id: 'searchInput')
end

View File

@@ -8,14 +8,10 @@ class RandomPage
a(:create_a_book, text: 'Create a book')
a(:download_as_pdf, text: 'Download as PDF')
a(:download_the_file, text: 'Download the file')
a(:input_method_enabled, class: 'ime-name imeselector-toggle')
text_field(:language_filter, id: 'languagefilter')
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')
a(:uls_trigger, class: 'uls-trigger')
end