Simplify tests
Change-Id: Ide435d4d11e9ab03c953ed91e949d55e46c5137e
This commit is contained in:
@@ -15,9 +15,6 @@ end
|
|||||||
Given(/^I set "(.*?)" as the interface language$/) do |language|
|
Given(/^I set "(.*?)" as the interface language$/) do |language|
|
||||||
code = language_to_code(language)
|
code = language_to_code(language)
|
||||||
visit(ULSPage, :using_params => {:extra => "setlang=#{code}"})
|
visit(ULSPage, :using_params => {:extra => "setlang=#{code}"})
|
||||||
# And check it took effect
|
|
||||||
actual = @browser.execute_script( "return jQuery( 'html' ).attr( 'lang' )" )
|
|
||||||
actual.should == code
|
|
||||||
end
|
end
|
||||||
|
|
||||||
Given(/^I temporarily use "(.*?)" as the interface language$/) do |language|
|
Given(/^I temporarily use "(.*?)" as the interface language$/) do |language|
|
||||||
@@ -25,13 +22,9 @@ Given(/^I temporarily use "(.*?)" as the interface language$/) do |language|
|
|||||||
visit(ULSPage, :using_params => {:extra => "uselang=#{code}"})
|
visit(ULSPage, :using_params => {:extra => "uselang=#{code}"})
|
||||||
end
|
end
|
||||||
|
|
||||||
Given(/^the interface language is "(.*?)"$/) do |language|
|
Then(/^my interface language is "(.*?)"$/) do |language|
|
||||||
# phantomjs needs little bit time because it executes the script before
|
|
||||||
# the page is fully loaded
|
|
||||||
sleep 0.5;
|
|
||||||
code = language_to_code(language)
|
code = language_to_code(language)
|
||||||
actual = @browser.execute_script( "return mw.config.get( 'wgUserLanguage' )" )
|
interface_element.attribute('lang').should == code
|
||||||
actual.should == code
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def language_to_code(language)
|
def language_to_code(language)
|
||||||
|
|||||||
@@ -32,4 +32,7 @@ class ULSPage
|
|||||||
|
|
||||||
select(:select_font_for_interface, id: 'ui-font-selector')
|
select(:select_font_for_interface, id: 'ui-font-selector')
|
||||||
select(:select_font_for_content, id: 'content-font-selector')
|
select(:select_font_for_content, id: 'content-font-selector')
|
||||||
|
|
||||||
|
# Is there way to access the html element?
|
||||||
|
div(:interface, id: 'footer')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -72,4 +72,4 @@ Feature: ULS settings panel
|
|||||||
And I click the button with the ellipsis
|
And I click the button with the ellipsis
|
||||||
And I use the panel to change my interface language to "German"
|
And I use the panel to change my interface language to "German"
|
||||||
And I apply the changes
|
And I apply the changes
|
||||||
Then the interface language is "German"
|
Then my interface language is "German"
|
||||||
|
|||||||
Reference in New Issue
Block a user