mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: navigator.storage.getDirectory() across browsers (#18305)
This commit is contained in:
parent
eb1c92630e
commit
12fdd3336e
@ -140,3 +140,21 @@ it('should not crash on showDirectoryPicker', async ({ page, server, browserName
|
|||||||
new Promise(r => setTimeout(r, 1000))
|
new Promise(r => setTimeout(r, 1000))
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not crash on storage.getDirectory()', async ({ page, server, browserName, isMac }) => {
|
||||||
|
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18235' });
|
||||||
|
it.skip(browserName === 'firefox', 'navigator.storage.getDirectory is not a function');
|
||||||
|
await page.goto(server.EMPTY_PAGE);
|
||||||
|
const error = await page.evaluate(async () => {
|
||||||
|
const dir = await navigator.storage.getDirectory();
|
||||||
|
return dir.name;
|
||||||
|
}).catch(e => e);
|
||||||
|
if (browserName === 'webkit') {
|
||||||
|
if (isMac)
|
||||||
|
expect(error.message).toContain('UnknownError: The operation failed for an unknown transient reason');
|
||||||
|
else
|
||||||
|
expect(error.message).toContain('TypeError: undefined is not an object');
|
||||||
|
} else {
|
||||||
|
expect(error).toBeFalsy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user