diff --git a/tests/browser/features/font_selection.feature b/tests/browser/features/font_selection.feature index 55adf0ba..84ef1c7e 100644 --- a/tests/browser/features/font_selection.feature +++ b/tests/browser/features/font_selection.feature @@ -25,14 +25,14 @@ Feature: Font selection 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 - And the selected content font must be "system" + And the selected content font must be "Systemschriftart" 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 Then the active interface font must be the same as font prior to the preview # 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 And I select "OpenDyslexic" font for the interface language for the live preview diff --git a/tests/browser/features/step_definitions/font_selection_steps.rb b/tests/browser/features/step_definitions/font_selection_steps.rb index 214ca8e3..469900af 100644 --- a/tests/browser/features/step_definitions/font_selection_steps.rb +++ b/tests/browser/features/step_definitions/font_selection_steps.rb @@ -16,8 +16,18 @@ Then(/^the active content font must be the same as font prior to the preview$/) 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| step 'I open display settings' step 'I open fonts panel of language settings' on(PanelPage).selected_content_font.should == font 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 diff --git a/tests/browser/features/step_definitions/panel_steps.rb b/tests/browser/features/step_definitions/panel_steps.rb index 92a061a7..5c37b2cc 100644 --- a/tests/browser/features/step_definitions/panel_steps.rb +++ b/tests/browser/features/step_definitions/panel_steps.rb @@ -44,18 +44,6 @@ When(/^I close the panel to discard the changes$/) do on(PanelPage).panel_button_close_element.click 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 on(PanelPage).panel_button_apply_element.click # Leave a little time for the settings to be saved. The settings window closes diff --git a/tests/browser/features/support/pages/panel_page.rb b/tests/browser/features/support/pages/panel_page.rb index 87de00f9..99768da0 100644 --- a/tests/browser/features/support/pages/panel_page.rb +++ b/tests/browser/features/support/pages/panel_page.rb @@ -32,6 +32,7 @@ class PanelPage a(:trigger_personal, class: 'uls-trigger') 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_content, id: 'content-font-selector')