Refactor "Open language selector when logged in"

Removed tags @uls-in-sidebar-only and @uls-in-personal-only.
We will figure out a better solution.

Alterted the test so that it catches if the language selector is
not visible in the viewport to catch regressions like bug 56937.

Bug: 56937
Change-Id: Ie8a37bf4f38e9c82e0c14736f2bc29e8ec1331ff
This commit is contained in:
Niklas Laxström
2013-11-13 11:51:04 +02:00
parent 0994ae1d95
commit cffbe79195
7 changed files with 22 additions and 34 deletions

View File

@@ -53,6 +53,18 @@ class PanelPage
font('body')
end
def uls_onscreen?
@browser.execute_script( "
var $menu = $( '.uls-menu' ),
$window = $( window ),
top = $menu.offset().top,
viewportTop = $window.scrollTop(),
viewportBottom = $window.scrollTop() + $window.height();
return ( top < viewportBottom && top >= viewportTop )" )
end
private
def font(selector)
@browser.execute_script( "return $( '#{selector}' ).css( 'font-family' );" )