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:
@@ -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' );" )
|
||||
|
||||
Reference in New Issue
Block a user