Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/92282
Change subject: Refactoring Discarding live preview of interface font
......................................................................
Refactoring Discarding live preview of interface font
Includes fix for content font as well
Change-Id: Ie97c5d45c6613889975ca6af59c6bd0856d331dc
---
M tests/browser/features/font_selection.feature
M tests/browser/features/step_definitions/font_selection_steps.rb
M tests/browser/features/step_definitions/panel_steps.rb
M tests/browser/features/support/pages/panel_page.rb
4 files changed, 14 insertions(+), 15 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
refs/changes/82/92282/1
diff --git a/tests/browser/features/font_selection.feature
b/tests/browser/features/font_selection.feature
index 55adf0b..84ef1c7 100644
--- a/tests/browser/features/font_selection.feature
+++ b/tests/browser/features/font_selection.feature
@@ -25,14 +25,14 @@
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 214ca8e..469900a 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 @@
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 92a061a..5c37b2c 100644
--- a/tests/browser/features/step_definitions/panel_steps.rb
+++ b/tests/browser/features/step_definitions/panel_steps.rb
@@ -44,18 +44,6 @@
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 87de00f..99768da 100644
--- a/tests/browser/features/support/pages/panel_page.rb
+++ b/tests/browser/features/support/pages/panel_page.rb
@@ -32,6 +32,7 @@
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')
--
To view, visit https://gerrit.wikimedia.org/r/92282
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie97c5d45c6613889975ca6af59c6bd0856d331dc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits