fix(tests): normalize scrollbars in headful tests (#2622)

Scrollbars look different on different platforms, so must be made invisible in tests. As a drive-by, xdescribe was broken with the new test runner.

References #2524
This commit is contained in:
Joel Einbinder 2018-05-29 15:30:08 -07:00 committed by Andrey Lushnikov
parent 41ccd0bded
commit 8e12d197a2
4 changed files with 15 additions and 1 deletions

View File

@ -7,6 +7,9 @@ body iframe {
flex-grow: 1;
flex-shrink: 1;
}
::-webkit-scrollbar{
display: none;
}
</style>
<script>
async function attachFrame(frameId, url) {

View File

@ -45,4 +45,8 @@ body {
box-sizing: border-box;
border: 1px solid darkgray;
}
::-webkit-scrollbar {
display: none;
}
</style>

View File

@ -222,6 +222,9 @@ module.exports.addTests = function({testRunner, expect}) {
height: 600px;
margin-left: 50px;
}
::-webkit-scrollbar{
display: none;
}
</style>
<div class="to-screenshot"></div>
`);

View File

@ -295,7 +295,11 @@ class TestRunner extends EventEmitter {
}
_addTest(mode, name, callback) {
const test = new Test(this._currentSuite, name, callback, mode, this._timeout);
let suite = this._currentSuite;
let isSkipped = suite.declaredMode === TestMode.Skip;
while ((suite = suite.parentSuite))
isSkipped |= suite.declaredMode === TestMode.Skip;
const test = new Test(this._currentSuite, name, callback, isSkipped ? TestMode.Skip : mode, this._timeout);
this._currentSuite.children.push(test);
this._tests.push(test);
this._hasFocusedTestsOrSuites = this._hasFocusedTestsOrSuites || mode === TestMode.Focus;