Merge "Integration tests for off-screen IME selector."
This commit is contained in:
@@ -48,6 +48,8 @@ def language_to_code(language)
|
||||
'en'
|
||||
when 'Finnish'
|
||||
'fi'
|
||||
when 'Hebrew'
|
||||
'he'
|
||||
else
|
||||
pending
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
9
tests/browser/features/support/pages/ascii_mono.rb
Normal file
9
tests/browser/features/support/pages/ascii_mono.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AsciiMono
|
||||
include PageObject
|
||||
|
||||
include URL
|
||||
def self.url
|
||||
URL.url('ASCII?useskin=monobook')
|
||||
end
|
||||
page_url url
|
||||
end
|
||||
9
tests/browser/features/support/pages/ascii_vector.rb
Normal file
9
tests/browser/features/support/pages/ascii_vector.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AsciiVector
|
||||
include PageObject
|
||||
|
||||
include URL
|
||||
def self.url
|
||||
URL.url('ASCII?useskin=vector')
|
||||
end
|
||||
page_url url
|
||||
end
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user