|
15 | 15 | */
|
16 | 16 |
|
17 | 17 | import { browserTest, expect } from '../config/browserTest';
|
18 |
| -import type { BrowserContext, BrowserContextOptions } from '@playwright/test'; |
| 18 | +import type { BrowserContext } from '@playwright/test'; |
19 | 19 |
|
20 |
| -const test = browserTest.extend<{ reusedContext: (options?: BrowserContextOptions) => Promise<BrowserContext> }>({ |
| 20 | +const test = browserTest.extend<{ reusedContext: () => Promise<BrowserContext> }>({ |
21 | 21 | reusedContext: async ({ browserType, browser }, use) => {
|
22 |
| - await use(async (options: BrowserContextOptions = {}) => { |
| 22 | + await use(async () => { |
23 | 23 | const defaultContextOptions = (browserType as any)._defaultContextOptions;
|
24 |
| - const context = await (browser as any)._newContextForReuse({ |
25 |
| - ...defaultContextOptions, |
26 |
| - ...options, |
27 |
| - }); |
| 24 | + const context = await (browser as any)._newContextForReuse(defaultContextOptions); |
28 | 25 | return context;
|
29 | 26 | });
|
30 | 27 | },
|
@@ -238,33 +235,6 @@ test('should reset mouse position', async ({ reusedContext, browserName, platfor
|
238 | 235 | await expect(page.locator('#two')).toHaveCSS('background-color', 'rgb(0, 0, 255)');
|
239 | 236 | });
|
240 | 237 |
|
241 |
| -test('should reset Origin Private File System', async ({ reusedContext, httpsServer, browserName }) => { |
242 |
| - test.skip(browserName === 'webkit', 'getDirectory is not supported in ephemeral context in WebKit https://github.com/microsoft/playwright/issues/18235#issuecomment-1289792576'); |
243 |
| - test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/29901' }); |
244 |
| - |
245 |
| - let context = await reusedContext({ ignoreHTTPSErrors: true }); |
246 |
| - let page = await context.newPage(); |
247 |
| - await page.goto(httpsServer.EMPTY_PAGE); |
248 |
| - await page.evaluate(async () => { |
249 |
| - const root = await navigator.storage.getDirectory(); |
250 |
| - await root.getDirectoryHandle('someDirectoryName', { create: true }); |
251 |
| - await root.getFileHandle('foo.txt', { create: true }); |
252 |
| - }); |
253 |
| - |
254 |
| - context = await reusedContext({ ignoreHTTPSErrors: true }); |
255 |
| - page = await context.newPage(); |
256 |
| - await page.goto(httpsServer.EMPTY_PAGE); |
257 |
| - const { directoryExits, fileExits } = await page.evaluate(async () => { |
258 |
| - const root = await navigator.storage.getDirectory(); |
259 |
| - let directoryExits = true, fileExits = true; |
260 |
| - await root.getDirectoryHandle('someDirectoryName').catch(() => { directoryExits = false; }); |
261 |
| - await root.getFileHandle('foo.txt').catch(() => { fileExits = false; }); |
262 |
| - return { directoryExits, fileExits }; |
263 |
| - }); |
264 |
| - expect(directoryExits).toBe(false); |
265 |
| - expect(fileExits).toBe(false); |
266 |
| -}); |
267 |
| - |
268 | 238 | test('should reset tracing', async ({ reusedContext, trace }, testInfo) => {
|
269 | 239 | test.skip(trace === 'on');
|
270 | 240 |
|
|
0 commit comments