Refactor two live preview scenarios

Change-Id: I8e0dc62e24f9f86232af6b68dc4809e858aa2367
This commit is contained in:
Niklas Laxström
2013-12-04 11:59:43 +02:00
parent d7d43e1dbb
commit cdb21c9c49
4 changed files with 16 additions and 13 deletions

View File

@@ -14,18 +14,22 @@ Feature: Live preview of display language changes
And I click on the link to select Malayalam And I click on the link to select Malayalam
Then I should see the text in the language panel in Malayalam Then I should see the text in the language panel in Malayalam
@commons.wikimedia.beta.wmflabs.org
Scenario: Live preview of display language changes can be reverted on cancel Scenario: Live preview of display language changes can be reverted on cancel
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 select a language different than English for display language And I select a language different than English for display language
When I click Cancel When I click Cancel
And I open "Language" panel of language settings And I open Display panel of language settings
Then I should see the text in the language panel in English Then I should see the text in the language panel in English
@commons.wikimedia.beta.wmflabs.org
Scenario: Live preview of display language changes can be reverted on closing the dialog with the X button Scenario: Live preview of display language changes can be reverted on closing the dialog with the X button
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 select a language different than English for display language And I select a language different than English for display language
When I click X When I click X
And I open "Language" panel of language settings And I open Display panel of language settings
Then I should see the text in the language panel in English Then I should see the text in the language panel in English
Scenario: Live preview of display language changes can be reverted on closing the dialog on cancel from a different section Scenario: Live preview of display language changes can be reverted on closing the dialog on cancel from a different section

View File

@@ -27,20 +27,12 @@ Given(/^I navigate to the Language Settings panel$/) do
step "I see the logged in language settings panel" step "I see the logged in language settings panel"
end end
When(/^I click Cancel$/) do
on(PanelPage).panel_button_cancel_element.click
end
When(/^I click the cog icon by Languages in the sidebar$/) do When(/^I click the cog icon by Languages in the sidebar$/) do
on(NoInterlanguagePage).cog_element.when_present.click on(NoInterlanguagePage).cog_element.when_present.click
# Wait for the panel to open # Wait for the panel to open
on(PanelPage).panel_display_element.when_visible on(PanelPage).panel_display_element.when_visible
end end
When(/^I click X$/) do
on(InterlanguagePage).x_element.click
end
Then(/^I can navigate back to Input Settings$/) do Then(/^I can navigate back to Input Settings$/) do
on(InterlanguagePage) do |page| on(InterlanguagePage) do |page|
page.back_to_input page.back_to_input

View File

@@ -33,3 +33,11 @@ end
When(/^in the language filter I type (.+)$/) do |language_abbreviation| When(/^in the language filter I type (.+)$/) do |language_abbreviation|
on(IMEPage).language_filter = language_abbreviation on(IMEPage).language_filter = language_abbreviation
end end
When(/^I click Cancel$/) do
on(PanelPage).panel_button_cancel_element.click
end
When(/^I click X$/) do
on(InterlanguagePage).x_element.click
end

View File

@@ -29,7 +29,6 @@ class PanelPage
select_list(:panel_content_font_selector, id: "content-font-selector") select_list(:panel_content_font_selector, id: "content-font-selector")
select_list(:panel_interface_font_selector, id: "ui-font-selector") select_list(:panel_interface_font_selector, id: "ui-font-selector")
# TODO: Rename to match convention
button(:other_language_button, class: "button uls-language-button", index: 1) button(:other_language_button, class: "button uls-language-button", index: 1)
button(:default_language_button, css: ".uls-language-button.down") button(:default_language_button, css: ".uls-language-button.down")