diff --git a/tests/browser/features/persistent_settings.feature b/tests/browser/features/persistent_settings.feature index 54dd2c7e..1d1cdfb5 100644 --- a/tests/browser/features/persistent_settings.feature +++ b/tests/browser/features/persistent_settings.feature @@ -20,3 +20,14 @@ Feature: Persistent settings When I close the panel to discard the changes And I visit a random page Then the selected interface font must be Systemschriftart + + Scenario: Changing both a font and an input method is saved + When I open Input side panel of language settings + And I click the button with the ellipsis + And in the language filter I type ml + And I click on the link to select Malayalam + And I select the ml-inscript2 input method in the panel + And I apply the changes + And I visit a random page + Then the selected interface font must be OpenDyslexic + And the selected input method for Malayalam is ml-inscript2 diff --git a/tests/browser/features/step_definitions/persistent_settings_steps.rb b/tests/browser/features/step_definitions/persistent_settings_steps.rb index bc3e3e20..104cd833 100644 --- a/tests/browser/features/step_definitions/persistent_settings_steps.rb +++ b/tests/browser/features/step_definitions/persistent_settings_steps.rb @@ -4,3 +4,13 @@ Then(/^the selected interface font must be (.*?)$/) do |font| step 'I open Fonts panel of language settings' on(PanelPage).font_for_interface.should == font end + +Then(/^the selected input method for Malayalam is ml-inscript2$/) do + @browser.execute_script( + "return $.parseJSON( mw.user.options.values['uls-preferences'] ).ime.imes.ml" + ).should == 'ml-inscript2' +end + +When(/^I select the ml-inscript2 input method in the panel$/) do + on(PanelPage).ml_inscript2_radio_element.click +end diff --git a/tests/browser/features/support/pages/panel_page.rb b/tests/browser/features/support/pages/panel_page.rb index ecd28a14..a3d5fdb6 100644 --- a/tests/browser/features/support/pages/panel_page.rb +++ b/tests/browser/features/support/pages/panel_page.rb @@ -45,6 +45,8 @@ class PanelPage div(:uls_display_settings, class: 'uls-display-settings') + radio_button(:ml_inscript2_radio, id: 'ml-inscript2') + # Is there way to access the html element? div(:interface, id: 'footer') diff --git a/tests/browser/features/support/pages/random_page.rb b/tests/browser/features/support/pages/random_page.rb index d0d7ab3e..30dcc2ce 100644 --- a/tests/browser/features/support/pages/random_page.rb +++ b/tests/browser/features/support/pages/random_page.rb @@ -1,3 +1,5 @@ +# encoding: utf-8 + class RandomPage include PageObject @@ -9,7 +11,7 @@ class RandomPage 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') + a(:malayalam_link, text: 'മലയാളം') a(:print_export, text: 'Print/export') a(:printable_version, text: 'Printable version') button(:search_button, id: 'searchButton')