Restore enableWebfonts pref and remove uls-enable
This patch restores the enableWebfonts preference, stored inside the uls-preferences blob. It existed as 'enable-webfonts' in the past and was removed in If735a733717596fae03042c5e277bd538bd8501f Each wiki can be configured to load the fonts by default using the new global variable $wgULSWebfontsEnabled. Its default value is true (to load fonts). This also removes the preference 'uls-enable', recently added in I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f The initialization of ext.uls.webfonts.js is changed as well, so that minimal webfonts JS library code is loaded, and the rest is loaded only if a user requests it. Bug: 60304 Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
This commit is contained in:
@@ -22,7 +22,7 @@ Feature: Autonym font
|
||||
Scenario: Autonym font is used in the ULS language search dialog for input language selection by logged-in users
|
||||
Given I am logged in
|
||||
And I open the Universal Language Selector
|
||||
And I open Input panel of language settings
|
||||
And I switch to Input panel of language settings
|
||||
When I click the button with the ellipsis
|
||||
Then the language list of ULS should use Autonym font
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
@commons.wikimedia.beta.wmflabs.org @login @needs-custom-setup
|
||||
Feature: Font selection
|
||||
|
||||
In order to have better using experience,
|
||||
As a reader and writer,
|
||||
I want to change or disable the fonts for interface and content.
|
||||
|
||||
In addition the user is provided live preview feature: changes are applied
|
||||
immediately when selection is made. Changes can either be applied or discarded
|
||||
for easy testing.
|
||||
|
||||
Background:
|
||||
Given I am logged in
|
||||
And I have reset my preferences
|
||||
And I set "German" as the interface language
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
When I open Fonts panel of language settings
|
||||
|
||||
Scenario: Font selector appears
|
||||
Then a font selector for interface language appears
|
||||
And a font selector for content language appears
|
||||
|
||||
Scenario: Discarding live preview of content font
|
||||
When I select OpenDyslexic font for the content language for the live preview
|
||||
And I close the panel to discard the changes
|
||||
# System is the default value for English and German
|
||||
Then the selected content font must be "Systemschriftart"
|
||||
And the active content font must be the same as font prior to the preview
|
||||
|
||||
Scenario: Discarding live preview of interface font
|
||||
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 Systemschriftart
|
||||
|
||||
Scenario: Applying the live preview of interface font
|
||||
When 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
|
||||
@@ -0,0 +1,93 @@
|
||||
@commons.wikimedia.beta.wmflabs.org @login @needs-custom-setup
|
||||
Feature: Font selection
|
||||
|
||||
In order to have better using experience,
|
||||
As a reader and writer,
|
||||
I want to change or disable the fonts for interface and content.
|
||||
|
||||
In addition the user is provided live preview feature: changes are applied
|
||||
immediately when selection is made. Changes can either be applied or discarded
|
||||
for easy testing.
|
||||
|
||||
This feature is similar to font_selection_default_enabled,
|
||||
but it is targeted at wikis where automatic font downloading
|
||||
is disabled by default ($wgULSWebfontsEnabled = false).
|
||||
|
||||
Background:
|
||||
Given I am logged in
|
||||
And I have reset my preferences
|
||||
And I set "German" as the interface language
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
When I open Fonts panel of language settings
|
||||
|
||||
Scenario: Font selector pane appears
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
And the checkbox to enable fonts downloading appears
|
||||
And the checkbox to enable fonts downloading is not checked
|
||||
And webfonts are not applied to body
|
||||
|
||||
Scenario: Enabling fonts downloading with live preview
|
||||
When I click the checkbox to enable fonts downloading
|
||||
Then a font selector for interface language appears
|
||||
And a font selector for content language appears
|
||||
And the checkbox to enable fonts downloading appears
|
||||
And the checkbox to enable fonts downloading is checked
|
||||
And the selected content font must be system
|
||||
And webfonts are applied to body
|
||||
|
||||
Scenario: Enabling fonts downloading without saving the preferences
|
||||
When I click the checkbox to enable fonts downloading
|
||||
And I select OpenDyslexic font for the content language for the live preview
|
||||
And I close the panel to discard the changes
|
||||
And I open Display panel of language settings
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
And the active interface font must be the same as font prior to the preview
|
||||
And the active content font must be the same as font prior to the preview
|
||||
|
||||
Scenario: Enabling fonts downloading and saving the preferences
|
||||
When I click the checkbox to enable fonts downloading
|
||||
And I select OpenDyslexic font for the interface language for the live preview
|
||||
And I apply the changes
|
||||
Then webfonts are applied to body
|
||||
And the interface font is OpenDyslexic
|
||||
|
||||
Scenario: Enabling fonts downloading and going to another page
|
||||
When I click the checkbox to enable fonts downloading
|
||||
And I select OpenDyslexic font for the content language for the live preview
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
Then webfonts are applied to body
|
||||
And the content font is OpenDyslexic
|
||||
|
||||
Scenario: Enabling fonts downloading and then disabling them
|
||||
When I click the checkbox to enable fonts downloading
|
||||
And I select OpenDyslexic font for the interface language for the live preview
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
And I open Fonts panel of language settings
|
||||
And I click the checkbox to disable fonts downloading
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
|
||||
Scenario: Enabling fonts downloading and then disabling them and saving the preferences
|
||||
When I click the checkbox to enable fonts downloading
|
||||
And I select OpenDyslexic font for the interface language for the live preview
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
And I open Fonts panel of language settings
|
||||
And I click the checkbox to disable fonts downloading
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
And the checkbox to enable fonts downloading is not checked
|
||||
And webfonts are not applied to body
|
||||
@@ -0,0 +1,78 @@
|
||||
@commons.wikimedia.beta.wmflabs.org @login @needs-custom-setup
|
||||
Feature: Font selection
|
||||
|
||||
In order to have better using experience,
|
||||
As a reader and writer,
|
||||
I want to change or disable the fonts for interface and content.
|
||||
|
||||
In addition the user is provided live preview feature: changes are applied
|
||||
immediately when selection is made. Changes can either be applied or discarded
|
||||
for easy testing.
|
||||
|
||||
This feature is similar to font_selection_default_disabled,
|
||||
but it is targeted at wikis where automatic font downloading
|
||||
is disabled by default ($wgULSWebfontsEnabled = true).
|
||||
|
||||
Background:
|
||||
Given I am logged in
|
||||
And I have reset my preferences
|
||||
And I set "German" as the interface language
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
When I open Fonts panel of language settings
|
||||
|
||||
Scenario: Font selector pane appears
|
||||
Then a font selector for interface language appears
|
||||
And a font selector for content language appears
|
||||
And the checkbox to enable fonts downloading appears
|
||||
And the checkbox to enable fonts downloading is checked
|
||||
And webfonts are applied to body
|
||||
|
||||
Scenario: Discarding live preview of content font
|
||||
When I select OpenDyslexic font for the content language for the live preview
|
||||
And I close the panel to discard the changes
|
||||
And I open Display panel of language settings
|
||||
Then the selected content font must be system
|
||||
And the active content font must be the same as font prior to the preview
|
||||
|
||||
Scenario: Discarding live preview of interface font
|
||||
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
|
||||
And the selected interface font must be Systemschriftart
|
||||
|
||||
Scenario: Applying the live preview of interface font
|
||||
When I select OpenDyslexic font for the interface language for the live preview
|
||||
And I apply the changes
|
||||
Then the interface font is OpenDyslexic
|
||||
|
||||
Scenario: Disabling fonts if they are enabled by default
|
||||
When I click the checkbox to enable fonts downloading
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
And the checkbox to enable fonts downloading is not checked
|
||||
|
||||
Scenario: Disabling fonts when they are enabled by default and going to another page
|
||||
When I click the checkbox to disable fonts downloading
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
Then a font selector for interface language doesn't appear
|
||||
And a font selector for content language doesn't appear
|
||||
And the checkbox to enable fonts downloading is not checked
|
||||
And webfonts are not applied to body
|
||||
|
||||
Scenario: Disabling fonts, going to another page, and re-enabling fonts
|
||||
When I click the checkbox to disable fonts downloading
|
||||
And I apply the changes
|
||||
And I am on the main page
|
||||
And I open ULS
|
||||
And I open Display panel of language settings
|
||||
And I open Fonts panel of language settings
|
||||
And I click the checkbox to enable fonts downloading
|
||||
Then a font selector for interface language appears
|
||||
And a font selector for content language appears
|
||||
And the checkbox to enable fonts downloading appears
|
||||
And the checkbox to enable fonts downloading is checked
|
||||
And webfonts are applied to body
|
||||
@@ -4,7 +4,8 @@ Feature: Settings panel
|
||||
Scenario Outline: Input settings display
|
||||
Given I am <user status>
|
||||
And I am on a page without interlanguage links
|
||||
When I open "Input" panel of language settings
|
||||
When I open ULS
|
||||
And I switch to Input panel of language settings
|
||||
Then I can disable input methods
|
||||
And I can enable input methods
|
||||
|
||||
@@ -15,7 +16,8 @@ Feature: Settings panel
|
||||
|
||||
Scenario: How to use link appears in the Input settings panel
|
||||
Given I am at random page
|
||||
When I open "Input" panel of language settings
|
||||
When I open ULS
|
||||
And I switch to Input panel of language settings
|
||||
And I click the button with the ellipsis
|
||||
And in the language filter I type ml
|
||||
And I click on the link to select Malayalam
|
||||
@@ -23,7 +25,8 @@ Feature: Settings panel
|
||||
|
||||
Scenario: More languages (input language selection)
|
||||
Given I am at random page
|
||||
When I open "Input" panel of language settings
|
||||
When I open ULS
|
||||
And I switch to Input panel of language settings
|
||||
And I click the button with the ellipsis
|
||||
Then I see Worldwide
|
||||
And I see Language Search
|
||||
@@ -80,9 +83,9 @@ Feature: Settings panel
|
||||
Given I am logged in
|
||||
And I have reset my preferences
|
||||
When I open the Universal Language Selector
|
||||
And I open Input panel of language settings
|
||||
And I switch to Input panel of language settings
|
||||
And I click the button with the ellipsis
|
||||
And I use the panel to change my input language to "Finnish"
|
||||
And I close the panel to discard the changes
|
||||
And I open Input panel of language settings
|
||||
And I switch to Input panel of language settings
|
||||
Then I should see English as the selected input language
|
||||
|
||||
@@ -2,10 +2,6 @@ When(/^I am on the main page$/) do
|
||||
visit MainPage
|
||||
end
|
||||
|
||||
Then(/^I open Input panel of language settings$/) do
|
||||
on(PanelPage).panel_input_element.when_visible.click
|
||||
end
|
||||
|
||||
Then(/^I open Input side panel of language settings$/) do
|
||||
on(PanelPage).panel_side_input_element.when_visible.click
|
||||
end
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
When(/^I click the checkbox to (?:enable|disable) fonts downloading$/) do
|
||||
on(PanelPage).webfonts_enable_checkbox_element.click
|
||||
end
|
||||
|
||||
Then(/^the checkbox to enable fonts downloading appears$/) do
|
||||
on(PanelPage).webfonts_enable_checkbox_element.should be_visible
|
||||
end
|
||||
|
||||
Then(/^the checkbox to enable fonts downloading is checked$/) do
|
||||
on(PanelPage).webfonts_enable_checkbox_element.should be_checked
|
||||
end
|
||||
|
||||
Then(/^the checkbox to enable fonts downloading is not checked$/) do
|
||||
on(PanelPage).webfonts_enable_checkbox_element.should_not be_checked
|
||||
end
|
||||
|
||||
Given(/^I open ULS$/) do
|
||||
on(PanelPage).trigger_personal_element.when_visible.click
|
||||
end
|
||||
@@ -12,12 +28,22 @@ Then(/^the active interface font must be the same as font prior to the preview$/
|
||||
on(PanelPage).interface_font.should == @original_interface_font
|
||||
end
|
||||
|
||||
Then(/^the selected content font must be "(.*?)"$/) do |font|
|
||||
step "I open Display panel of language settings"
|
||||
step "I open Fonts panel of language settings"
|
||||
on(PanelPage).selected_content_font.should == font
|
||||
Then(/^the selected content font must be (.*?)$/) do |font|
|
||||
on(PanelPage).selected_content_font_element.when_visible.value.should == font
|
||||
end
|
||||
|
||||
Then(/^the interface font must be changed to the "(.*?)" font$/) do |font|
|
||||
Then(/^the interface font is (.*?)$/) do |font|
|
||||
on(PanelPage).interface_font.should match("^#{font}")
|
||||
end
|
||||
|
||||
Then(/^the content font is (.*?)$/) do |font|
|
||||
on(PanelPage).content_font.should match("^#{font}")
|
||||
end
|
||||
|
||||
Then(/^webfonts are applied to body$/) do
|
||||
on(PanelPage).webfonts_library_loaded.should be_true
|
||||
end
|
||||
|
||||
Then(/^webfonts are not applied to body$/) do
|
||||
on(PanelPage).webfonts_library_loaded.should be_false
|
||||
end
|
||||
|
||||
@@ -48,11 +48,19 @@ Then(/^I can enable input methods$/) do
|
||||
end
|
||||
|
||||
Then(/^a font selector for interface language appears$/) do
|
||||
on(PanelPage).panel_interface_font_selector_element.should be_visible
|
||||
on(PanelPage).panel_interface_font_selector_element.should be_visible
|
||||
end
|
||||
|
||||
Then(/^a font selector for interface language doesn't appear$/) do
|
||||
on(PanelPage).panel_interface_font_selector_element.should_not be_visible
|
||||
end
|
||||
|
||||
Then(/^a font selector for content language appears$/) do
|
||||
on(PanelPage).panel_content_font_selector_element.should be_visible
|
||||
on(PanelPage).panel_content_font_selector_element.should be_visible
|
||||
end
|
||||
|
||||
Then(/^a font selector for content language doesn't appear$/) do
|
||||
on(PanelPage).panel_content_font_selector_element.should_not be_visible
|
||||
end
|
||||
|
||||
When(/^I use the panel to change my (?:interface|input) language to "(.*?)"$/) do |language|
|
||||
@@ -68,7 +76,7 @@ Then(/^the panel is in English/) do
|
||||
on(PanelPage).panel_language_element.text.should == "Language"
|
||||
end
|
||||
|
||||
When(/^I switch to Input panel of language settings/) do
|
||||
When(/^I switch to Input panel of language settings$/) do
|
||||
on(PanelPage).panel_side_input_element.click
|
||||
end
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ class PanelPage
|
||||
|
||||
div(:language_settings_dialog, id: "language-settings-dialog")
|
||||
div(:panel_display, id: "display-settings-block")
|
||||
div(:panel_input, id: "input-settings-block")
|
||||
button(:panel_fonts, id: "uls-display-settings-fonts-tab")
|
||||
button(:panel_language, id: "uls-display-settings-language-tab")
|
||||
|
||||
@@ -24,6 +23,8 @@ class PanelPage
|
||||
button(:panel_disable_input_methods, class: "uls-input-toggle-button")
|
||||
button(:panel_enable_input_methods, class: "uls-input-toggle-button")
|
||||
|
||||
checkbox(:webfonts_enable_checkbox, id: "webfonts-enable-checkbox")
|
||||
|
||||
select_list(:panel_content_font_selector, id: "content-font-selector")
|
||||
select_list(:panel_interface_font_selector, id: "ui-font-selector")
|
||||
|
||||
@@ -69,6 +70,9 @@ class PanelPage
|
||||
return ( top < viewportBottom && top >= viewportTop )" )
|
||||
end
|
||||
|
||||
def webfonts_library_loaded
|
||||
@browser.execute_script("return( $( 'body' ).data( 'webfonts' ) !== undefined )")
|
||||
end
|
||||
|
||||
private
|
||||
def font(selector)
|
||||
|
||||
Reference in New Issue
Block a user