Refactoring Discarding live preview of interface font

Includes fix for content font as well

Change-Id: Ie97c5d45c6613889975ca6af59c6bd0856d331dc
This commit is contained in:
Niklas Laxström
2013-10-28 11:58:55 +02:00
committed by Amire80
parent 76392359b7
commit b47a8ac5d3
4 changed files with 14 additions and 15 deletions

View File

@@ -25,14 +25,14 @@ Feature: Font selection
And I close the panel to discard the changes And I close the panel to discard the changes
Then the active content font must be the same as font prior to the preview Then the active content font must be the same as font prior to the preview
# System is the default value for English and German # System is the default value for English and German
And the selected content font must be "system" And the selected content font must be "Systemschriftart"
Scenario: Discarding live preview of interface font Scenario: Discarding live preview of interface font
And I select "OpenDyslexic" font for the interface language for the live preview When I select "OpenDyslexic" font for the interface language for the live preview
And I close the panel to discard the changes And I close the panel to discard the changes
Then the active interface font must be the same as font prior to the preview Then the active interface font must be the same as font prior to the preview
# System is the default value for English and German # System is the default value for English and German
And the selected interface font must be "system" And the selected interface font must be "Systemschriftart"
Scenario: Applying the live preview of interface font Scenario: Applying the live preview of interface font
And I select "OpenDyslexic" font for the interface language for the live preview And I select "OpenDyslexic" font for the interface language for the live preview

View File

@@ -16,8 +16,18 @@ Then(/^the active content font must be the same as font prior to the preview$/)
end end
end 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 content font must be "(.*?)"$/) do |font| Then(/^the selected content font must be "(.*?)"$/) do |font|
step 'I open display settings' step 'I open display settings'
step 'I open fonts panel of language settings' step 'I open fonts panel of language settings'
on(PanelPage).selected_content_font.should == font on(PanelPage).selected_content_font.should == font
end end
Then(/^the selected interface font must be "(.*?)"$/) do |font|
step 'I open display settings'
step 'I open fonts panel of language settings'
on(PanelPage).selected_interface_font.should == font
end

View File

@@ -44,18 +44,6 @@ When(/^I close the panel to discard the changes$/) do
on(PanelPage).panel_button_close_element.click on(PanelPage).panel_button_close_element.click
end 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 interface font must be "(.*?)"$/) do |font|
type = 'ui'
step 'I open "Fonts" panel of language settings'
Selenium::WebDriver::Support::Select.new(
@browser.driver.find_element(:id, "#{type}-font-selector")
).first_selected_option().attribute('value').should == font
end
When(/^I apply the changes$/) do When(/^I apply the changes$/) do
on(PanelPage).panel_button_apply_element.click on(PanelPage).panel_button_apply_element.click
# Leave a little time for the settings to be saved. The settings window closes # Leave a little time for the settings to be saved. The settings window closes

View File

@@ -32,6 +32,7 @@ class PanelPage
a(:trigger_personal, class: 'uls-trigger') a(:trigger_personal, class: 'uls-trigger')
select(:selected_content_font, id: 'content-font-selector') select(:selected_content_font, id: 'content-font-selector')
select(:selected_interface_font, id: 'ui-font-selector')
select(:select_font_for_interface, id: 'ui-font-selector') select(:select_font_for_interface, id: 'ui-font-selector')
select(:select_font_for_content, id: 'content-font-selector') select(:select_font_for_content, id: 'content-font-selector')