test: uncomment / fix webkit tests that time out (#379)

This commit is contained in:
Pavel Feldman 2020-01-04 22:27:09 -08:00 committed by GitHub
parent ccfb2cb26c
commit 2f3593bd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "724623",
"firefox_revision": "1009",
"webkit_revision": "1060"
"webkit_revision": "1061"
},
"scripts": {
"unit": "node test/test.js",

View File

@ -21,7 +21,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;
describe('Accessibility', function() {
it('should work', async function({page}) {
it.skip(WEBKIT)('should work', async function({page}) {
await page.setContent(`
<head>
<title>Accessibility Test</title>
@ -99,7 +99,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROME, WEBKIT}) {
};
expect(await page.accessibility.snapshot()).toEqual(golden);
});
it('should report uninteresting nodes', async function({page}) {
it.skip(WEBKIT)('should report uninteresting nodes', async function({page}) {
await page.setContent(`<textarea autofocus>hi</textarea>`);
// autofocus happens after a delay in chrome these days
await page.waitForFunction(() => document.activeElement.hasAttribute('autofocus'));

View File

@ -1,7 +1,7 @@
<div>beforeunload demo.</div>
<script>
window.addEventListener('beforeunload', event => {
// Chrome way.
// Chrome & WebKit way.
event.returnValue = 'Leave?';
// Firefox way.
event.preventDefault();

View File

@ -269,11 +269,13 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
await page.evaluate(async() => {
// 1. Create a popup that Playwright is not connected to.
const win = window.open(window.location.href, 'Title', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=200,top=0,left=0');
await new Promise(x => win.onload = x);
while (window.document.readyState !== 'complete')
await new Promise(f => setTimeout(f, 100));
// 2. In this popup, create an iframe that console.logs a message.
win.document.body.innerHTML = `<iframe src='/consolelog.html'></iframe>`;
const frame = win.document.querySelector('iframe');
await new Promise(x => frame.onload = x);
while (frame.contentDocument.readyState !== 'complete')
await new Promise(f => setTimeout(f, 100));
// 3. After that, remove the iframe.
frame.remove();
});