Integration tests for off-screen IME selector.

Change-Id: I0b3253ba9cb19afae41612435ef0a9604814f3ed
This commit is contained in:
Kartik Mistry
2013-09-12 17:42:42 +05:30
committed by Amir E. Aharoni
parent e0fa027b9f
commit e53f9176ce
5 changed files with 69 additions and 0 deletions

View File

@@ -48,6 +48,8 @@ def language_to_code(language)
'en'
when 'Finnish'
'fi'
when 'Hebrew'
'he'
else
pending
end

View File

@@ -70,3 +70,23 @@ Then(/^in it there must be an element with Malayalam text$/) do
# 'input_method_enabled' alone only returns []
on(RandomPage).input_method_enabled_element.text.should == 'ഇൻസ്ക്രിപ്റ്റ് 2'
end
When(/^I visit page in Vector skin$/) do
sleep 1.0;
visit(AsciiVector)
end
When(/^I visit page in Monobook skin$/) do
sleep 1.0;
visit(AsciiMono)
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
end