Refactored Autonym font feature

Removed old and ugly steps that are no longer used. Introduced one
small and beautiful step.

Fixes three failed Jenkins jobs:

https://wmf.ci.cloudbees.com/view/r-uls/job/UniversalLanguageSelector-co
mmons.wikimedia.beta.wmflabs.org-linux-firefox/128/testReport/(root)/Aut
onym%20font/

Change-Id: I68da4364592514d161996517875a06fd2942ff0f
This commit is contained in:
Zeljko Filipin
2013-11-14 11:13:15 +01:00
parent cd6766da28
commit 06341f787f
3 changed files with 13 additions and 32 deletions

View File

@@ -7,30 +7,30 @@ Feature: Autonym font
@login @commons.wikimedia.beta.wmflabs.org
Scenario: Autonym font is used in the ULS language search dialog for display language selection by logged-in users
Given I am logged in
When I open "Language" panel of language settings
And I click the button with the ellipsis
And I open the Universal Language Selector
And I open Display panel of language settings
When I click the button with the ellipsis
Then the language list of ULS should use Autonym font
@login @commons.wikimedia.beta.wmflabs.org
Scenario: Autonym font is used in the ULS language search dialog for input language selection by logged-in users
Given I am logged in
When I open "Input" panel of language settings
And I click the button with the ellipsis
And I open the Universal Language Selector
And I open Input panel of language settings
When I click the button with the ellipsis
Then the language list of ULS should use Autonym font
@login @en.wikipedia.beta.wmflabs.org
Scenario: Autonym font should be used in the Interlanguage area of a page with Interlanguage links
Given I am logged in
When I am on a page with interlanguage links
Then the Interlanguage area should use Autonym font
@anon-language-selection @commons.wikimedia.beta.wmflabs.org
Scenario: Autonym font is used in the ULS language search dialog for input language selection by anonymous users
When I open "Input" panel of language settings
And I click the button with the ellipsis
Given I am at random page
And I open the Universal Language Selector
And I open Input panel of language settings
When I click the button with the ellipsis
Then the language list of ULS should use Autonym font

View File

@@ -0,0 +1,3 @@
Then(/^I open Input panel of language settings$/) do
on(PanelPage).panel_input_element.when_visible.click
end

View File

@@ -18,27 +18,6 @@ When(/^I open Fonts panel of language settings$/) do
on(PanelPage).panel_fonts_element.click
end
When(/^I open "(.*?)" panel of language settings$/) do |panel|
visit(PanelPage) do |page|
# Open the ULS panel if it's not open already
if !page.language_settings_dialog_element.visible?
# These can be of two different type of elements, which PageObjects do not like.
if uls_position() == 'interlanguage'
page.trigger_cog_element.when_visible.click
elsif uls_position() == 'personal'
page.trigger_personal_element.when_visible.click
end
end
case panel
when "Input"
page.panel_input_element.when_visible.click
else
pending
end
end
end
When(/^I select (.*?) font for the interface language for the live preview$/) do |font|
on(PanelPage).font_for_interface = font
end
@@ -47,7 +26,6 @@ When(/^I select (.*?) font for the content language for the live preview$/) do |
on(PanelPage).font_for_content = font
end
When(/^I close the panel to discard the changes$/) do
on(PanelPage).panel_button_close_element.click
end