From a5c7b432821394c4677c4b2d574d88a3a2a6730c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 23 Oct 2013 12:33:33 +0300 Subject: [PATCH] Refactoring of ULS font selection tests Change-Id: Ie4d5843f76bff277750a2d61a13b3297650e52f7 --- tests/browser/features/font_selection.feature | 11 +++++------ .../features/step_definitions/font_selection_steps.rb | 11 +++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 tests/browser/features/step_definitions/font_selection_steps.rb diff --git a/tests/browser/features/font_selection.feature b/tests/browser/features/font_selection.feature index a735b72b..c70b2ed2 100644 --- a/tests/browser/features/font_selection.feature +++ b/tests/browser/features/font_selection.feature @@ -1,4 +1,4 @@ -@login @reset-preferences-after @commons.wikimedia.beta.wmflabs.org +@commons.wikimedia.beta.wmflabs.org @login @reset-preferences-after Feature: Font selection In order to have better using experience, @@ -12,14 +12,15 @@ Feature: Font selection Background: Given I am logged in And I set "German" as the interface language + And I open ULS + And I open display settings + When I open fonts panel of language settings Scenario: Font selector appears - When I open "Fonts" panel of language settings Then a font selector for interface language appears - Then a font selector for content language appears + And a font selector for content language appears Scenario: Discarding live preview of content font - When I open "Fonts" panel of language settings And 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 @@ -27,7 +28,6 @@ Feature: Font selection And the selected content font must be "system" Scenario: Discarding live preview of interface font - When I open "Fonts" panel of language settings And 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 @@ -35,7 +35,6 @@ Feature: Font selection And the selected interface font must be "system" Scenario: Applying the live preview of interface font - When I open "Fonts" panel of language settings And I select "OpenDyslexic" font for the interface language for the live preview And I apply the changes Then the interface font must be changed to the "OpenDyslexic" font diff --git a/tests/browser/features/step_definitions/font_selection_steps.rb b/tests/browser/features/step_definitions/font_selection_steps.rb new file mode 100644 index 00000000..125dbc7a --- /dev/null +++ b/tests/browser/features/step_definitions/font_selection_steps.rb @@ -0,0 +1,11 @@ +Given(/^I open ULS$/) do + on(PanelPage).trigger_personal_element.when_visible.click +end + +Given(/^I open display settings$/) do + on(PanelPage).panel_display_element.when_visible.click +end + +When(/^I open fonts panel of language settings$/) do + on(PanelPage).panel_fonts_element.click +end