Renamed ULSPage to PanelPage

To make class name consistent with file name

Change-Id: If4d0f0a24d2534c9b73cc6cbb0ee14ab8c124ed9
This commit is contained in:
Zeljko Filipin
2013-09-26 12:32:41 +02:00
parent 2d8522d1ba
commit 7706d97c8a
7 changed files with 26 additions and 26 deletions

View File

@@ -28,7 +28,7 @@ Given(/^I navigate to the Language Settings panel$/) do
end end
When(/^I click Cancel$/) do When(/^I click Cancel$/) do
on(ULSPage).panel_button_cancel_element.click on(PanelPage).panel_button_cancel_element.click
end end
When(/^I click on the link to select Malayalam$/) do When(/^I click on the link to select Malayalam$/) do
@@ -42,7 +42,7 @@ end
When(/^I click the cog icon by Languages in the sidebar$/) do When(/^I click the cog icon by Languages in the sidebar$/) do
on(NoInterlanguagePage).cog_element.when_present.click on(NoInterlanguagePage).cog_element.when_present.click
# Wait for the panel to open # Wait for the panel to open
on(ULSPage).panel_display_element.when_visible on(PanelPage).panel_display_element.when_visible
end end
When(/^I click X$/) do When(/^I click X$/) do
@@ -72,7 +72,7 @@ When(/^I choose a different language for writing$/) do
end end
Then(/^I do not see the Language Settings panel$/) do Then(/^I do not see the Language Settings panel$/) do
on(ULSPage) do |page| on(PanelPage) do |page|
page.panel_language_element.should_not be_visible page.panel_language_element.should_not be_visible
page.panel_fonts_element.should_not be_visible page.panel_fonts_element.should_not be_visible
page.default_language_button_element.should_not be_visible page.default_language_button_element.should_not be_visible
@@ -89,14 +89,14 @@ Then(/^I see Language Search$/) do
end end
Then(/^I see the logged out language settings panel$/) do Then(/^I see the logged out language settings panel$/) do
on(ULSPage) do |page| on(PanelPage) do |page|
page.panel_language_element.should be_visible page.panel_language_element.should be_visible
page.panel_fonts_element.should be_visible page.panel_fonts_element.should be_visible
end end
end end
Then(/^I see the logged in language settings panel$/) do Then(/^I see the logged in language settings panel$/) do
on(ULSPage) do |page| on(PanelPage) do |page|
page.panel_language_element.should be_visible page.panel_language_element.should be_visible
page.panel_fonts_element.should be_visible page.panel_fonts_element.should be_visible
page.default_language_button_element.should be_visible page.default_language_button_element.should be_visible

View File

@@ -14,17 +14,17 @@ 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(PanelPage, :using_params => {:extra => "setlang=#{code}"})
end end
Given(/^I temporarily use "(.*?)" as the interface language$/) do |language| Given(/^I temporarily use "(.*?)" as the interface language$/) do |language|
code = language_to_code(language) code = language_to_code(language)
visit(ULSPage, :using_params => {:extra => "uselang=#{code}"}) visit(PanelPage, :using_params => {:extra => "uselang=#{code}"})
end end
Then(/^my interface language is "(.*?)"$/) do |language| Then(/^my interface language is "(.*?)"$/) do |language|
code = language_to_code(language) code = language_to_code(language)
on(ULSPage).interface_element.attribute('lang').should == code on(PanelPage).interface_element.attribute('lang').should == code
end end
def language_to_code(language) def language_to_code(language)
@@ -61,7 +61,7 @@ end
def uls_position() def uls_position()
if !defined?($uls_position) if !defined?($uls_position)
visit(ULSPage) visit(PanelPage)
$uls_position = @browser.execute_script( "return mw.config.get( 'wgULSPosition' )" ); $uls_position = @browser.execute_script( "return mw.config.get( 'wgULSPosition' )" );
else else
$uls_position $uls_position

View File

@@ -72,11 +72,11 @@ Then(/^in it there must be an element with Malayalam text$/) do
end end
When(/^I visit page in Vector skin$/) do When(/^I visit page in Vector skin$/) do
visit(ULSPage, :using_params => {:extra => "useskin=vector"}) visit(PanelPage, :using_params => {:extra => "useskin=vector"})
end end
When(/^I visit page in Monobook skin$/) do When(/^I visit page in Monobook skin$/) do
visit(ULSPage, :using_params => {:extra => "useskin=monobook"}) visit(PanelPage, :using_params => {:extra => "useskin=monobook"})
end end
Then(/^I should see the input method menu is not offscreen$/) do Then(/^I should see the input method menu is not offscreen$/) do

View File

@@ -8,7 +8,7 @@ Given(/^I inspect current fonts$/) do
end end
When(/^I open "(.*?)" panel of language settings$/) do |panel| When(/^I open "(.*?)" panel of language settings$/) do |panel|
on(ULSPage) do |page| on(PanelPage) do |page|
# These can be of two different type of elements, which PageObjects do not like. # These can be of two different type of elements, which PageObjects do not like.
if uls_position() == 'interlanguage' if uls_position() == 'interlanguage'
page.trigger_cog_element.when_visible.click page.trigger_cog_element.when_visible.click
@@ -34,16 +34,16 @@ When(/^I open "(.*?)" panel of language settings$/) do |panel|
end end
When(/^I select "(.*?)" font for the interface language for the live preview$/) do |font| When(/^I select "(.*?)" font for the interface language for the live preview$/) do |font|
on(ULSPage).select_font_for_interface = font on(PanelPage).select_font_for_interface = font
end end
When(/^I select "(.*?)" font for the content language for the live preview$/) do |font| When(/^I select "(.*?)" font for the content language for the live preview$/) do |font|
on(ULSPage).select_font_for_content = font on(PanelPage).select_font_for_content = font
end end
When(/^I close the panel to discard the changes$/) do When(/^I close the panel to discard the changes$/) do
on(ULSPage) do |page| on(PanelPage) do |page|
page.panel_button_close_element.click page.panel_button_close_element.click
# Also close the ULS language selection if open # Also close the ULS language selection if open
if uls_position() == 'personal' if uls_position() == 'personal'
@@ -74,7 +74,7 @@ Then(/^the selected (.*?) font must be "(.*?)"$/) do |type, font|
end end
When(/^I apply the changes$/) do When(/^I apply the changes$/) do
on(ULSPage).panel_button_apply_element.click on(PanelPage).panel_button_apply_element.click
# Leave a little time for the settings to be saved. The settings window closes # Leave a little time for the settings to be saved. The settings window closes
# immediately, so it is not enough to wait for it to disappear. # immediately, so it is not enough to wait for it to disappear.
sleep 4 sleep 4
@@ -92,19 +92,19 @@ Then(/^the (.*) font must be changed to the "(.*?)" font$/) do |type, font|
end end
Then(/^I can disable input methods$/) do Then(/^I can disable input methods$/) do
on(ULSPage).panel_disable_input_methods_element.click on(PanelPage).panel_disable_input_methods_element.click
end end
Then(/^I can enable input methods$/) do Then(/^I can enable input methods$/) do
on(ULSPage).panel_enable_input_methods_element.click on(PanelPage).panel_enable_input_methods_element.click
end end
Then(/^a font selector for interface language appears$/) do Then(/^a font selector for interface language appears$/) do
on(ULSPage).panel_interface_font_selector_element.should be_visible on(PanelPage).panel_interface_font_selector_element.should be_visible
end end
Then(/^a font selector for content language appears$/) do Then(/^a font selector for content language appears$/) do
on(ULSPage).panel_content_font_selector_element.should be_visible on(PanelPage).panel_content_font_selector_element.should be_visible
end end
When(/^I use the panel to change my interface language to "(.*?)"$/) do |language| When(/^I use the panel to change my interface language to "(.*?)"$/) do |language|
@@ -115,9 +115,9 @@ When(/^I use the panel to change my interface language to "(.*?)"$/) do |languag
end end
Then(/^the panel is in English/) do Then(/^the panel is in English/) do
on(ULSPage).panel_language_element.text.should == 'Language' on(PanelPage).panel_language_element.text.should == 'Language'
end end
When(/^I switch to "Input" panel of language settings/) do When(/^I switch to "Input" panel of language settings/) do
on(ULSPage).panel_input_element.when_visible.click on(PanelPage).panel_input_element.when_visible.click
end end

View File

@@ -6,9 +6,9 @@ Given(/^I set interface language that is different from content language and has
end end
When(/^I select a font for the interface language$/) do When(/^I select a font for the interface language$/) do
on(ULSPage).select_font_for_interface = 'OpenDyslexic' on(PanelPage).select_font_for_interface = 'OpenDyslexic'
end end
Then(/^the selected interface font must be what I previously selected$/) do Then(/^the selected interface font must be what I previously selected$/) do
on(ULSPage).select_font_for_interface.should == 'OpenDyslexic' on(PanelPage).select_font_for_interface.should == 'OpenDyslexic'
end end

View File

@@ -3,5 +3,5 @@ When(/^I click language selector trigger element$/) do
end end
Then(/^I should see the language selector$/) do Then(/^I should see the language selector$/) do
on(ULSPage).uls_element.should be_visible on(PanelPage).uls_element.should be_visible
end end

View File

@@ -1,4 +1,4 @@
class ULSPage class PanelPage
include PageObject include PageObject
include URL include URL