Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/98495
Change subject: WIP: Refactoring live preview ...................................................................... WIP: Refactoring live preview Change-Id: I351094b8d746d991b1f1d92f3dd097f092e3f0f5 --- M tests/browser/features/live_preview_of_display_language.feature M tests/browser/features/step_definitions/cog_sidebar_user_steps.rb M tests/browser/features/step_definitions/common_steps.rb M tests/browser/features/step_definitions/live_preview_of_display_language_steps.rb M tests/browser/features/support/modules/interlanguage_module.rb M tests/browser/features/support/modules/language_module.rb M tests/browser/features/support/pages/random_page.rb 7 files changed, 27 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/95/98495/1 diff --git a/tests/browser/features/live_preview_of_display_language.feature b/tests/browser/features/live_preview_of_display_language.feature index 7bf2655..cc97100 100644 --- a/tests/browser/features/live_preview_of_display_language.feature +++ b/tests/browser/features/live_preview_of_display_language.feature @@ -3,16 +3,16 @@ Background: Given I am logged in - And I have reset my preferences - And I set "English" as the interface language - And I am on a page with interlanguage links + And I am at random page + @commons.wikimedia.beta.wmflabs.org Scenario: Display language change is previewed immediately - Given I open "Language" panel of language settings + Given I open the Universal Language Selector + And I open Display panel of language settings And I click the button with the ellipsis - And in the language filter I type hi - And I click on the link to select Hindi - Then I should see the text in the language panel in Hindi + And in the language filter I type malayalam + And I click on the link to select Malayalam + Then I should see the text in the language panel in Malayalam Scenario: Live preview of display language changes can be reverted on cancel Given I open "Language" panel of language settings diff --git a/tests/browser/features/step_definitions/cog_sidebar_user_steps.rb b/tests/browser/features/step_definitions/cog_sidebar_user_steps.rb index db01cb4..0e7ae9f 100644 --- a/tests/browser/features/step_definitions/cog_sidebar_user_steps.rb +++ b/tests/browser/features/step_definitions/cog_sidebar_user_steps.rb @@ -31,14 +31,6 @@ on(PanelPage).panel_button_cancel_element.click end -When(/^I click on the link to select Malayalam$/) do - on(RandomPage).malayalam_link -end - -When(/^I click the button with the ellipsis$/) do - on(InterlanguagePage).ellipsis_button_element.click -end - When(/^I click the cog icon by Languages in the sidebar$/) do on(NoInterlanguagePage).cog_element.when_present.click # Wait for the panel to open @@ -47,10 +39,6 @@ When(/^I click X$/) do on(InterlanguagePage).x_element.click -end - -When(/^in the language filter I type (.+)$/) do |language_abbreviation| - on(IMEPage).language_filter=language_abbreviation end Then(/^I can navigate back to Input Settings$/) do diff --git a/tests/browser/features/step_definitions/common_steps.rb b/tests/browser/features/step_definitions/common_steps.rb index 70c10cf..2daa5bd 100644 --- a/tests/browser/features/step_definitions/common_steps.rb +++ b/tests/browser/features/step_definitions/common_steps.rb @@ -25,3 +25,11 @@ code = on(PanelPage).language_to_code(language) on(PanelPage).interface_element.attribute("lang").should == code end + +When(/^I click the button with the ellipsis$/) do + on(InterlanguagePage).ellipsis_button_element.click +end + +When(/^in the language filter I type (.+)$/) do |language_abbreviation| + on(IMEPage).language_filter = language_abbreviation +end diff --git a/tests/browser/features/step_definitions/live_preview_of_display_language_steps.rb b/tests/browser/features/step_definitions/live_preview_of_display_language_steps.rb index b6e0ac9..36c1f77 100644 --- a/tests/browser/features/step_definitions/live_preview_of_display_language_steps.rb +++ b/tests/browser/features/step_definitions/live_preview_of_display_language_steps.rb @@ -2,7 +2,7 @@ on(PanelPage).select_font_for_content = "System font" end -And(/^I set English font to OpenDyslexic$/) do +When(/^I set English font to OpenDyslexic$/) do on(PanelPage).select_font_for_content = "OpenDyslexic" end @@ -10,12 +10,12 @@ on(PanelPage).select_font_for_content.should == "OpenDyslexic" end -And(/^I select a language different than English for display language$/) do +Given(/^I select a language different than English for display language$/) do on(PanelPage).other_language_button_element.click end -And(/^I click on the link to select Hindi$/) do - on(InterlanguagePage).hindi_link_element.click +When(/^I click on the link to select Malayalam$/) do + on(RandomPage).malayalam_element.click end Then(/^I should see the text in the language panel in (.+?)$/) do |language| diff --git a/tests/browser/features/support/modules/interlanguage_module.rb b/tests/browser/features/support/modules/interlanguage_module.rb index 5d46e5b..7eaded5 100644 --- a/tests/browser/features/support/modules/interlanguage_module.rb +++ b/tests/browser/features/support/modules/interlanguage_module.rb @@ -10,7 +10,7 @@ span(:cog, class: "uls-settings-trigger") button(:ellipsis_button, class: "uls-more-languages button") a(:english_link, text: "English") - a(:hindi_link, text: "हिन्दी") + a(:hindi_link, title: "Hindi") div(:input_settings, id: "input-settings-block") div(:language_list, class: "row uls-language-list lcd") text_field(:language_search, id: "languagefilter") diff --git a/tests/browser/features/support/modules/language_module.rb b/tests/browser/features/support/modules/language_module.rb index 5da34fb..0a7eae7 100644 --- a/tests/browser/features/support/modules/language_module.rb +++ b/tests/browser/features/support/modules/language_module.rb @@ -13,8 +13,10 @@ "he" when "Hindi" "hi" + when "Malayalam" + "ml" else - pending + p "Unknown language #{language}" end end end diff --git a/tests/browser/features/support/pages/random_page.rb b/tests/browser/features/support/pages/random_page.rb index a6aac90..8b022f3 100644 --- a/tests/browser/features/support/pages/random_page.rb +++ b/tests/browser/features/support/pages/random_page.rb @@ -11,7 +11,10 @@ a(:download_as_pdf, text: "Download as PDF") a(:download_the_file, text: "Download the file") li(:main_page, id: "n-mainpage-description") - a(:malayalam_link, title: "Malayalam") + div(:asia, id: 'AS') + a(:malayalam).do |page| + page.asia_element.a(title: "Malayalam") + end a(:print_export, text: "Print/export") a(:printable_version, text: "Printable version") button(:search_button, id: "searchButton") -- To view, visit https://gerrit.wikimedia.org/r/98495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I351094b8d746d991b1f1d92f3dd097f092e3f0f5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits