Merge "Integration tests for off-screen IME selector."

This commit is contained in:
jenkins-bot
2013-09-14 06:23:53 +00:00
committed by Gerrit Code Review
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

View File

@@ -0,0 +1,9 @@
class AsciiMono
include PageObject
include URL
def self.url
URL.url('ASCII?useskin=monobook')
end
page_url url
end

View File

@@ -0,0 +1,9 @@
class AsciiVector
include PageObject
include URL
def self.url
URL.url('ASCII?useskin=vector')
end
page_url url
end

View File

@@ -49,3 +49,32 @@ input method.
And I press Control-M
Then I should see the input method indicator
And in it there must be an element with Malayalam text
@login @reset-preferences-after
Scenario: Input method menu is not offscreen
Input method indicator is not offscreen for English and RTL languages.
Given I am logged in
Given I set "English" as the interface language
When I visit page in Vector skin
And I open the input method menu
Then I should see the input method menu is not offscreen
Given I am logged in
Given I set "Hebrew" as the interface language
When I visit page in Monobook skin
And I open the input method menu
Then I should see the input method menu is not offscreen
Given I am logged in
Given I set "English" as the interface language
When I visit page in Monobook skin
And I open the input method menu
Then I should see the input method menu is not offscreen
Given I am logged in
Given I set "Hebrew" as the interface language
When I visit page in Vector skin
And I open the input method menu
Then I should see the input method menu is not offscreen