Refactoring Input method menu is not offscreen

Change-Id: Iff83160eb6c99d6109098e431341240a21274665
This commit is contained in:
Niklas Laxström
2013-10-30 12:13:51 +02:00
committed by Amir E. Aharoni
parent 135d1bc2b7
commit 967683c98e
5 changed files with 47 additions and 56 deletions

View File

@@ -63,20 +63,10 @@ Then(/^in it there must be an element with Malayalam text$/) do
on(IMEPage).input_method_enabled_element.text.should == 'ഇൻസ്ക്രിപ്റ്റ് 2'
end
When(/^I visit page in Vector skin$/) do
visit(PanelPage, :using_params => {:extra => "useskin=vector"})
end
When(/^I visit page in Monobook skin$/) do
visit(PanelPage, :using_params => {:extra => "useskin=monobook"})
Given(/^I visit a random page with (.+) skin and (.+) as the interface language$/) do |skin, language|
visit(IMEPage, :using_params => {:extra => "useskin=#{skin.downcase}&uselang=#{on(IMEPage).language_to_code(language)}"})
end
Then(/^I should see the input method menu is not offscreen$/) do
@browser.execute_script( "
var $selectorMenu = $( '.imeselector-menu' ),
menuLeft = $selectorMenu.offset().left,
menuRight = menuLeft + $selectorMenu.width();
return ( menuLeft >= 0 && menuRight <= $( window ).width() );
" ).should == true
on(IMEPage).ime_input_method_menu_onscreen?.should == true
end