mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
tests: mark popup tests as passing on Firefox (#1466)
This commit is contained in:
parent
1b08797c6f
commit
3f90c09e6d
@ -9,7 +9,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"chromium_revision": "751710",
|
"chromium_revision": "751710",
|
||||||
"firefox_revision": "1045",
|
"firefox_revision": "1047",
|
||||||
"webkit_revision": "1182"
|
"webkit_revision": "1182"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -480,7 +480,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FF
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Events.BrowserContext.Page', function() {
|
describe('Events.BrowserContext.Page', function() {
|
||||||
it.fail(FFOX)('should have url', async({browser, server}) => {
|
it('should have url', async({browser, server}) => {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
const [otherPage] = await Promise.all([
|
const [otherPage] = await Promise.all([
|
||||||
@ -512,7 +512,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FF
|
|||||||
expect(otherPage.url()).toBe('about:blank');
|
expect(otherPage.url()).toBe('about:blank');
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should have about:blank for empty url with domcontentloaded', async({browser, server}) => {
|
it('should have about:blank for empty url with domcontentloaded', async({browser, server}) => {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
const [otherPage] = await Promise.all([
|
const [otherPage] = await Promise.all([
|
||||||
@ -523,7 +523,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FF
|
|||||||
expect(otherPage.url()).toBe('about:blank');
|
expect(otherPage.url()).toBe('about:blank');
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should report when a new page is created and closed', async({browser, server}) => {
|
it('should report when a new page is created and closed', async({browser, server}) => {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
const [otherPage] = await Promise.all([
|
const [otherPage] = await Promise.all([
|
||||||
@ -582,7 +582,7 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, FF
|
|||||||
// Cleanup.
|
// Cleanup.
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should have an opener', async({browser, server}) => {
|
it('should have an opener', async({browser, server}) => {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
@ -843,13 +843,17 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
|
|||||||
await popup.waitForLoadState();
|
await popup.waitForLoadState();
|
||||||
expect(popup.url()).toBe(server.EMPTY_PAGE);
|
expect(popup.url()).toBe(server.EMPTY_PAGE);
|
||||||
});
|
});
|
||||||
it.fail(FFOX)('should wait for load state of empty url popup', async({browser, page}) => {
|
it('should wait for load state of empty url popup', async({browser, page}) => {
|
||||||
const [popup] = await Promise.all([
|
const [popup, readyState] = await Promise.all([
|
||||||
page.waitForEvent('popup'),
|
page.waitForEvent('popup'),
|
||||||
page.evaluate(() => window.open('') && 1),
|
page.evaluate(() => {
|
||||||
|
const popup = window.open('');
|
||||||
|
return popup.document.readyState;
|
||||||
|
}),
|
||||||
]);
|
]);
|
||||||
await popup.waitForLoadState({ waitUntil: 'load' });
|
await popup.waitForLoadState({ waitUntil: 'load' });
|
||||||
expect(await popup.evaluate(() => document.readyState)).toBe('complete');
|
expect(readyState).toBe(FFOX ? 'uninitialized' : 'complete');
|
||||||
|
expect(await popup.evaluate(() => document.readyState)).toBe(FFOX ? 'uninitialized' : 'complete');
|
||||||
});
|
});
|
||||||
it('should wait for load state of about:blank popup ', async({browser, page}) => {
|
it('should wait for load state of about:blank popup ', async({browser, page}) => {
|
||||||
const [popup] = await Promise.all([
|
const [popup] = await Promise.all([
|
||||||
|
@ -245,6 +245,18 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, WE
|
|||||||
expect(await popup.evaluate(() => !!window.opener)).toBe(true);
|
expect(await popup.evaluate(() => !!window.opener)).toBe(true);
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
it('should work with noopener and no url', async({browser}) => {
|
||||||
|
const context = await browser.newContext();
|
||||||
|
const page = await context.newPage();
|
||||||
|
const [popup] = await Promise.all([
|
||||||
|
page.waitForEvent('popup'),
|
||||||
|
page.evaluate(() => window.__popup = window.open(undefined, null, 'noopener')),
|
||||||
|
]);
|
||||||
|
expect(popup.url()).toBe('about:blank');
|
||||||
|
expect(await page.evaluate(() => !!window.opener)).toBe(false);
|
||||||
|
expect(await popup.evaluate(() => !!window.opener)).toBe(false);
|
||||||
|
await context.close();
|
||||||
|
});
|
||||||
it('should work with noopener and about:blank', async({browser}) => {
|
it('should work with noopener and about:blank', async({browser}) => {
|
||||||
const context = await browser.newContext();
|
const context = await browser.newContext();
|
||||||
const page = await context.newPage();
|
const page = await context.newPage();
|
||||||
@ -292,8 +304,6 @@ module.exports.describe = function({testRunner, expect, playwright, CHROMIUM, WE
|
|||||||
page.$eval('a', a => a.click()),
|
page.$eval('a', a => a.click()),
|
||||||
]);
|
]);
|
||||||
expect(await page.evaluate(() => !!window.opener)).toBe(false);
|
expect(await page.evaluate(() => !!window.opener)).toBe(false);
|
||||||
// TODO: At this point popup might still have about:blank as the current document.
|
|
||||||
// FFOX is slow enough to trigger this. We should do something about popups api.
|
|
||||||
expect(await popup.evaluate(() => !!window.opener)).toBe(false);
|
expect(await popup.evaluate(() => !!window.opener)).toBe(false);
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user