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