KartikMistry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/92279


Change subject: WIP: autonym font integration tests
......................................................................

WIP: autonym font integration tests

Change-Id: I2fbedbf3b93c4410cc9fc765c3f4795d7986bf04
---
A tests/browser/features/autonym.feature
M tests/browser/features/step_definitions/panel_steps.rb
M tests/browser/features/support/pages/interlanguage_page.rb
M tests/browser/features/support/pages/panel_page.rb
4 files changed, 45 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/79/92279/1

diff --git a/tests/browser/features/autonym.feature 
b/tests/browser/features/autonym.feature
new file mode 100644
index 0000000..6e45ea1
--- /dev/null
+++ b/tests/browser/features/autonym.feature
@@ -0,0 +1,31 @@
+@login @reset-preferences-after
+Feature: Autonym font
+
+  * Font should have the glyphs and tables only required for autonyms.
+  * Web font should always be applied to the language selector's language
+    selection screen.
+  * Web font should always be applied to the interlanguage section of MediaWiki
+    when MediaWiki extension ULS is installed.
+
+  Background:
+    Given I am logged in
+
+  Scenario: Autonym font is used in the ULS language search dialog for display 
language selection by logged-in users
+    When  I open "Language" panel of language settings
+      And I click the button with the ellipsis
+      Then the font-family should use the Autonym font on the language search 
screen
+
+  Scenario: Autonym font is used in the ULS language search dialog for input 
language selection by logged-in users
+    When  I open "Input" panel of language settings
+      And I click the button with the ellipsis
+      Then the font-family should use the Autonym font on the language search 
screen
+
+  Scenario: Autonym font should be used in the Interlanguage area of a page 
with Interlanguage links
+    When I am on a page with interlanguage links
+      Then the link attribute in the page should use Autonym as the font-family
+
+  Scenario: Autonym font is used in the ULS language search dialog for input 
language selection by anonymous users
+    Given I am not logged in
+    When  I open "Input" panel of language settings
+      And I click the button with the ellipsis
+      Then the font-family should use the Autonym font on the language search 
screen
diff --git a/tests/browser/features/step_definitions/panel_steps.rb 
b/tests/browser/features/step_definitions/panel_steps.rb
index 92a061a..7dc9f5c 100644
--- a/tests/browser/features/step_definitions/panel_steps.rb
+++ b/tests/browser/features/step_definitions/panel_steps.rb
@@ -97,3 +97,11 @@
 When(/^I switch to "Input" panel of language settings/) do
        on(PanelPage).panel_input_element.when_visible.click
 end
+
+Then(/^the font-family should use the Autonym font on the language search 
screen$/) do
+       on(PanelPage).language_block_element.style("font-family").should 
match('Autonym')
+end
+
+Then(/^the link attribute in the page should use Autonym as the font-family$/) 
do
+       
on(InterlanguagePage).interlang_link_element.style("font-family").should match 
('Autonym')
+end
diff --git a/tests/browser/features/support/pages/interlanguage_page.rb 
b/tests/browser/features/support/pages/interlanguage_page.rb
index 9da2645..64f5ff6 100644
--- a/tests/browser/features/support/pages/interlanguage_page.rb
+++ b/tests/browser/features/support/pages/interlanguage_page.rb
@@ -8,4 +8,6 @@
   page_url url
 
   include InterlanguagePageModule
+
+  a(:interlang_link, class: 'p-lang')
 end
diff --git a/tests/browser/features/support/pages/panel_page.rb 
b/tests/browser/features/support/pages/panel_page.rb
index 87de00f..1784a87 100644
--- a/tests/browser/features/support/pages/panel_page.rb
+++ b/tests/browser/features/support/pages/panel_page.rb
@@ -10,6 +10,7 @@
        div(:language_settings_dialog, id: 'language-settings-dialog')
        div(:panel_display, id: 'display-settings-block')
        div(:panel_input, id: 'input-settings-block')
+       div(:language_block, id: 'uls-language-block')
        button(:panel_fonts, id: 'uls-display-settings-fonts-tab')
        button(:panel_language, id: 'uls-display-settings-language-tab')
 
@@ -44,12 +45,15 @@
        def get_content_font
                get_font('#mw-content-text')
        end
+
        def get_font(selector)
                @browser.execute_script( "return $( '#{selector}' ).css( 
'font-family' );" )
        end
+
        def get_interface_font
                get_font('body')
        end
+
        def language_to_code(language)
                case language
                        when 'German'

-- 
To view, visit https://gerrit.wikimedia.org/r/92279
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fbedbf3b93c4410cc9fc765c3f4795d7986bf04
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: KartikMistry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to