Check that elements that do not need it do not use Autonym font
Change-Id: I2a865d61403b5556a8f6d69aa1fe3e10727e87ae
This commit is contained in:
committed by
Niklas Laxström
parent
7a9e890e06
commit
0f331b5b03
@@ -21,11 +21,11 @@ Feature: Autonym font
|
|||||||
When I click the button with the ellipsis
|
When I click the button with the ellipsis
|
||||||
Then the language list of ULS should use Autonym font
|
Then the language list of ULS should use Autonym font
|
||||||
|
|
||||||
@login @en.wikipedia.beta.wmflabs.org
|
@en.wikipedia.beta.wmflabs.org
|
||||||
Scenario: Autonym font should be used in the Interlanguage area of a page with Interlanguage links
|
Scenario: Autonym font should be used in the Interlanguage area of a page only with Interlanguage links
|
||||||
Given I am logged in
|
When I am on the main page
|
||||||
When I am on a page with interlanguage links
|
Then the Interlanguage links should use Autonym font
|
||||||
Then the Interlanguage area should use Autonym font
|
And elements that are not Interlanguage links should not use Autonym font
|
||||||
|
|
||||||
@anon-language-selection @commons.wikimedia.beta.wmflabs.org
|
@anon-language-selection @commons.wikimedia.beta.wmflabs.org
|
||||||
Scenario: Autonym font is used in the ULS language search dialog for input language selection by anonymous users
|
Scenario: Autonym font is used in the ULS language search dialog for input language selection by anonymous users
|
||||||
|
|||||||
@@ -1,7 +1,19 @@
|
|||||||
|
When(/^I am on the main page$/) do
|
||||||
|
visit MainPage
|
||||||
|
end
|
||||||
|
|
||||||
Then(/^I open Input panel of language settings$/) do
|
Then(/^I open Input panel of language settings$/) do
|
||||||
on(PanelPage).panel_input_element.when_visible.click
|
on(PanelPage).panel_input_element.when_visible.click
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^I open Input side panel of language settings$/) do
|
Then(/^I open Input side panel of language settings$/) do
|
||||||
on(PanelPage).panel_side_input_element.when_visible.click
|
on(PanelPage).panel_side_input_element.when_visible.click
|
||||||
|
end
|
||||||
|
|
||||||
|
Then(/^the Interlanguage links should use Autonym font$/) do
|
||||||
|
on(InterlanguagePage).interlang_link_element.style("font-family").should == "'Autonym',sans-serif"
|
||||||
|
end
|
||||||
|
|
||||||
|
Then(/^elements that are not Interlanguage links should not use Autonym font$/) do
|
||||||
|
on(MainPage).non_interlanguage_links_use_autonym_font?.should == false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -76,10 +76,6 @@ Then(/^the language list of ULS should use Autonym font$/) do
|
|||||||
on(PanelPage).autonym_element.style("font-family").should == "'Autonym',sans-serif"
|
on(PanelPage).autonym_element.style("font-family").should == "'Autonym',sans-serif"
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^the Interlanguage area should use Autonym font$/) do
|
|
||||||
on(InterlanguagePage).interlang_link_element.style("font-family").should == "'Autonym',sans-serif"
|
|
||||||
end
|
|
||||||
|
|
||||||
Then(/^I should see (.*) as the selected input language$/) do |language|
|
Then(/^I should see (.*) as the selected input language$/) do |language|
|
||||||
on(PanelPage).default_language_button_element.text.should == language
|
on(PanelPage).default_language_button_element.text.should == language
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
class InterlanguagePage
|
class InterlanguagePage
|
||||||
include PageObject
|
include PageObject
|
||||||
|
include InterlanguagePageModule
|
||||||
|
|
||||||
include URL
|
include URL
|
||||||
def self.url
|
def self.url
|
||||||
@@ -7,5 +8,5 @@ class InterlanguagePage
|
|||||||
end
|
end
|
||||||
page_url url
|
page_url url
|
||||||
|
|
||||||
include InterlanguagePageModule
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
12
tests/browser/features/support/pages/main_page.rb
Normal file
12
tests/browser/features/support/pages/main_page.rb
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
class MainPage
|
||||||
|
include PageObject
|
||||||
|
|
||||||
|
include URL
|
||||||
|
page_url URL.url('Main_Page')
|
||||||
|
|
||||||
|
def non_interlanguage_links_use_autonym_font?
|
||||||
|
@browser.elements(css: '#p-lang li:not(.interlanguage-link)').collect do |element|
|
||||||
|
element.style("font-family")
|
||||||
|
end.to_s.match(/Autonym/) != nil
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user