mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: change test for BrowserContext (#12321)
This commit is contained in:
parent
c9a5644c65
commit
97637036c1
@ -202,55 +202,6 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] *",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["firefox", "webDriverBiDi"],
|
|
||||||
"expectations": ["FAIL"],
|
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should be prompt by default",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should close all belonging targets once closing context",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should create new incognito context",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should have default context",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should timeout waiting for a non-existent target",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should wait for a target",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext window.open should use parent tab context",
|
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
|
||||||
"parameters": ["webDriverBiDi"],
|
|
||||||
"expectations": ["PASS"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"testIdPattern": "[CDPSession.spec] Target.createCDPSession *",
|
"testIdPattern": "[CDPSession.spec] Target.createCDPSession *",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -1001,10 +952,11 @@
|
|||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should fail when bad permission is given",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should deny permission when not listed",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
"parameters": ["firefox", "webDriverBiDi"],
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
"expectations": ["PASS"]
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant permission when listed",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant permission when listed",
|
||||||
@ -1013,6 +965,13 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant permission when listed",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant persistent-storage",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant persistent-storage",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -1020,6 +979,13 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should grant persistent-storage",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should isolate permissions between browser contexts",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should isolate permissions between browser contexts",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -1027,6 +993,13 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should isolate permissions between browser contexts",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should reset permissions",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should reset permissions",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -1034,12 +1007,26 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should reset permissions",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should trigger permission onchange",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["cdp", "firefox"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should trigger permission onchange",
|
"testIdPattern": "[browsercontext.spec] BrowserContext BrowserContext.overridePermissions should trigger permission onchange",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
"parameters": ["cdp", "firefox"],
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "Firefox does not have support for the Permissions BiDi extension yet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should fire target events",
|
"testIdPattern": "[browsercontext.spec] BrowserContext should fire target events",
|
||||||
@ -1055,6 +1042,13 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext should fire target events",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "In BiDi currently more events than needed are fired (because target is updated more often). We probably need to adjust the test as the behavior is not broken per se"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[browsercontext.spec] BrowserContext should wait for a target",
|
"testIdPattern": "[browsercontext.spec] BrowserContext should wait for a target",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
@ -1069,6 +1063,13 @@
|
|||||||
"expectations": ["FAIL"],
|
"expectations": ["FAIL"],
|
||||||
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"testIdPattern": "[browsercontext.spec] BrowserContext should work across sessions",
|
||||||
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
"parameters": ["firefox", "webDriverBiDi"],
|
||||||
|
"expectations": ["FAIL"],
|
||||||
|
"comment": "Firefox does not support multiple connection at this time"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"testIdPattern": "[CDPSession.spec] Target.createCDPSession should be able to detach session",
|
"testIdPattern": "[CDPSession.spec] Target.createCDPSession should be able to detach session",
|
||||||
"platforms": ["darwin", "linux", "win32"],
|
"platforms": ["darwin", "linux", "win32"],
|
||||||
|
@ -155,6 +155,7 @@ describe('BrowserContext', function () {
|
|||||||
skipContextCreation: true,
|
skipContextCreation: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const contextCount = browser.browserContexts().length;
|
||||||
// Create two incognito contexts.
|
// Create two incognito contexts.
|
||||||
const context1 = await browser.createBrowserContext();
|
const context1 = await browser.createBrowserContext();
|
||||||
const context2 = await browser.createBrowserContext();
|
const context2 = await browser.createBrowserContext();
|
||||||
@ -209,7 +210,7 @@ describe('BrowserContext', function () {
|
|||||||
|
|
||||||
// Cleanup contexts.
|
// Cleanup contexts.
|
||||||
await Promise.all([context1.close(), context2.close()]);
|
await Promise.all([context1.close(), context2.close()]);
|
||||||
expect(browser.browserContexts()).toHaveLength(1);
|
expect(browser.browserContexts()).toHaveLength(contextCount);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should work across sessions', async () => {
|
it('should work across sessions', async () => {
|
||||||
@ -238,12 +239,13 @@ describe('BrowserContext', function () {
|
|||||||
skipContextCreation: true,
|
skipContextCreation: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(browser.browserContexts()).toHaveLength(1);
|
const contextCount = browser.browserContexts().length;
|
||||||
expect(browser.browserContexts()[0]!.id).toBeUndefined();
|
|
||||||
|
expect(contextCount).toBeGreaterThanOrEqual(1);
|
||||||
|
|
||||||
const context = await browser.createBrowserContext();
|
const context = await browser.createBrowserContext();
|
||||||
expect(browser.browserContexts()).toHaveLength(2);
|
expect(browser.browserContexts()).toHaveLength(contextCount + 1);
|
||||||
expect(browser.browserContexts()[1]!.id).toBeDefined();
|
expect(context.id).toBeDefined();
|
||||||
await context.close();
|
await context.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user