MDL-51881 behat: Set navbar to be absolutely positioned
All behat drivers are now replicating human behavior so when the browser scrolls something into view it doesn't account for fixed positioned elements that end up obscuring the item thus leading to errors that could be avoided by scrolling an additional amount.
This commit is contained in:
@@ -180,15 +180,6 @@ function behat_clean_init_config() {
|
||||
unset($CFG->{$key});
|
||||
}
|
||||
}
|
||||
|
||||
// Here we are forcing the navbar to be absolutely positioned in Chrome, Safari and IE in order to
|
||||
// avoid a driver bug whereby when the browser scrolls something into view it doesn't account
|
||||
// for fixed positioned elements that end up obscuring the item thus leading to errors that
|
||||
// could be avoided by scrolling an additional amount.
|
||||
// This should be removed as soon as the affected drivers have been fixed.
|
||||
$CFG->forced_plugin_settings['theme_clean'] = array(
|
||||
'customcss' => 'body.safari .navbar-fixed-top, body.ie .navbar-fixed-top {position: absolute;}'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1747,6 +1747,11 @@ class moodle_page {
|
||||
if ($this->_devicetypeinuse != 'default') {
|
||||
$this->add_body_class($this->_devicetypeinuse . 'theme');
|
||||
}
|
||||
|
||||
// Add class for behat site to apply behat related fixes.
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$this->add_body_class('behat-site');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
// Here we are forcing the navbar to be absolutely positioned for behat, because
|
||||
// when driver scrolls something into view in browser it doesn't account
|
||||
// for fixed positioned elements that end up obscuring the item thus
|
||||
// leading to errors that could be avoided by scrolling an additional amount.
|
||||
body.behat-site {
|
||||
.navbar-fixed-top {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
.phpinfo table,
|
||||
.phpinfo th,
|
||||
.phpinfo h2 {
|
||||
@@ -89,4 +98,4 @@
|
||||
#page-footer .purgecaches,
|
||||
#page-footer .performanceinfo {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user