Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

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

Pavel Feldman2f3593bd9a37
diff --git a/package.json b/package.json
index b1cf09ebf8..d39eb86d8c 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"playwright": {
"chromium_revision": "724623",
"firefox_revision": "1009",
- "webkit_revision": "1060"
+ "webkit_revision": "1061"
},
"scripts": {
"unit": "node test/test.js",
diff --git a/test/accessibility.spec.js b/test/accessibility.spec.js
index 6e07115dfc..3c255299ac 100644
--- a/test/accessibility.spec.js
+++ b/test/accessibility.spec.js
@@ -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'));
diff --git a/test/assets/beforeunload.html b/test/assets/beforeunload.html
index 3cef6763f3..b246905190 100644
--- a/test/assets/beforeunload.html
+++ b/test/assets/beforeunload.html
@@ -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();
diff --git a/test/page.spec.js b/test/page.spec.js
index 00cac23168..b2cd83f196 100644
--- a/test/page.spec.js
+++ b/test/page.spec.js
@@ -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();
});