Merge "More refactoring ULS font selection tests"
This commit is contained in:
@@ -21,7 +21,7 @@ Feature: Font selection
|
||||
And a font selector for content language appears
|
||||
|
||||
Scenario: Discarding live preview of content font
|
||||
And I select "OpenDyslexic" font for the content language for the live preview
|
||||
When I select "OpenDyslexic" font for the content language for the live preview
|
||||
And I close the panel to discard the changes
|
||||
Then the active content font must be the same as font prior to the preview
|
||||
# System is the default value for English and German
|
||||
|
||||
@@ -9,3 +9,13 @@ end
|
||||
When(/^I open fonts panel of language settings$/) do
|
||||
on(PanelPage).panel_fonts_element.click
|
||||
end
|
||||
|
||||
Then(/^the active content font must be the same as font prior to the preview$/) do
|
||||
on(PanelPage).get_content_font.should == @original_content_font
|
||||
end
|
||||
|
||||
Then(/^the selected content font must be "(.*?)"$/) do |font|
|
||||
step 'I open display settings'
|
||||
step 'I open fonts panel of language settings'
|
||||
on(PanelPage).selected_content_font.should == font
|
||||
end
|
||||
|
||||
@@ -41,30 +41,15 @@ end
|
||||
|
||||
|
||||
When(/^I close the panel to discard the changes$/) do
|
||||
on(PanelPage) do |page|
|
||||
page.panel_button_close_element.click
|
||||
# Also close the ULS language selection if open
|
||||
if uls_position() == 'personal'
|
||||
page.uls_button_close_element.when_visible.click
|
||||
end
|
||||
end
|
||||
on(PanelPage).panel_button_close_element.click
|
||||
end
|
||||
|
||||
Then(/^the active (.*?) font must be the same as font prior to the preview$/) do |type|
|
||||
case type
|
||||
when "content"
|
||||
on(PanelPage).get_content_font.should === @original_content_font
|
||||
when "interface"
|
||||
on(PanelPage).get_interface_font.should === @original_interface_font
|
||||
else
|
||||
pending
|
||||
end
|
||||
Then(/^the active interface font must be the same as font prior to the preview$/) do
|
||||
on(PanelPage).get_interface_font.should == @original_interface_font
|
||||
end
|
||||
|
||||
Then(/^the selected (.*?) font must be "(.*?)"$/) do |type, font|
|
||||
if type == 'interface'
|
||||
Then(/^the selected interface font must be "(.*?)"$/) do |font|
|
||||
type = 'ui'
|
||||
end
|
||||
step 'I open "Fonts" panel of language settings'
|
||||
Selenium::WebDriver::Support::Select.new(
|
||||
@browser.driver.find_element(:id, "#{type}-font-selector")
|
||||
@@ -78,15 +63,8 @@ When(/^I apply the changes$/) do
|
||||
sleep 4
|
||||
end
|
||||
|
||||
Then(/^the (.*) font must be changed to the "(.*?)" font$/) do |type, font|
|
||||
case type
|
||||
when "content"
|
||||
on(PanelPage).get_content_font.should match("^#{font}")
|
||||
when "interface"
|
||||
Then(/^the interface font must be changed to the "(.*?)" font$/) do |font|
|
||||
on(PanelPage).get_interface_font.should match("^#{font}")
|
||||
else
|
||||
pending
|
||||
end
|
||||
end
|
||||
|
||||
Then(/^I can disable input methods$/) do
|
||||
|
||||
@@ -31,6 +31,8 @@ class PanelPage
|
||||
span(:trigger_cog, class: 'uls-settings-trigger')
|
||||
a(:trigger_personal, class: 'uls-trigger')
|
||||
|
||||
select(:selected_content_font, id: 'content-font-selector')
|
||||
|
||||
select(:select_font_for_interface, id: 'ui-font-selector')
|
||||
select(:select_font_for_content, id: 'content-font-selector')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user