Fix and enable feature Persistent settings

* Reuse existing steps where possible
* Rename steps file to match convention
* Moved unrelated steps to a new file
* Added wait for saving

https://mingle.corp.wikimedia.org/projects/internationalization/cards/3822

Bug: 56885
Change-Id: I480058430696579947187265b940ea46156f1519
This commit is contained in:
Niklas Laxström
2013-11-21 11:06:18 +02:00
parent 6a7fe531d2
commit ded20c61f2
4 changed files with 20 additions and 27 deletions

View File

@@ -1,23 +1,22 @@
@login @reset-preferences-after
@commons.wikimedia.beta.wmflabs.org @login @reset-preferences-after
Feature: Persistent settings
This assumes wiki content language is English.
Background:
Given I am logged in
And I set interface language that is different from content language and has a font
And I set "German" as the interface language
And I open the Universal Language Selector
And I open Display panel of language settings
And I open Fonts panel of language settings
And I select OpenDyslexic font for the interface language for the live preview
Scenario: Interface font sticks to another page
When I open "Fonts" panel of language settings
And I select a font for the interface language
And I apply the changes
When I apply the changes
And I visit a random page
And I open "Fonts" panel of language settings
Then the selected interface font must be what I previously selected
Then the selected interface font must be OpenDyslexic
Scenario: Discarding a live preview of a font keeps the previous font
When I open "Fonts" panel of language settings
And I select a font for the interface language
And I close the panel to discard the changes
When I close the panel to discard the changes
And I visit a random page
Then the selected interface font must be "system"
Then the selected interface font must be Systemschriftart

View File

@@ -31,7 +31,10 @@ When(/^I close the panel to discard the changes$/) do
end
When(/^I apply the changes$/) do
on(PanelPage).panel_button_apply_element.click
on(PanelPage) do |page|
page.panel_button_apply_element.click
page.language_settings_dialog_element.wait_while_present
end
end
Then(/^I can disable input methods$/) do

View File

@@ -0,0 +1,6 @@
Then(/^the selected interface font must be (.*?)$/) do |font|
step 'I open the Universal Language Selector'
step 'I open Display panel of language settings'
step 'I open Fonts panel of language settings'
on(PanelPage).font_for_interface.should == font
end

View File

@@ -1,18 +1,3 @@
Given(/^I set interface language that is different from content language and has a font$/) do
visit(PreferencesPage) do |page|
page.set_interface_language_element.select_value 'de'
page.save_element.click
end
end
When(/^I select a font for the interface language$/) do
on(PanelPage).select_font_for_interface = 'OpenDyslexic'
end
Then(/^the selected interface font must be what I previously selected$/) do
on(PanelPage).select_font_for_interface.should == 'OpenDyslexic'
end
When(/^I set English font to System$/) do
on(PanelPage).select_font_for_content = 'System font'
end