feat: support AbortController in waitForSelector (#10018)

This commit is contained in:
Alex Rudenko
2023-04-18 18:45:10 +02:00
committed by GitHub
parent fd08e6ad22
commit 9109b76276
8 changed files with 81 additions and 7 deletions

View File

@@ -380,6 +380,18 @@ describe('waittask specs', function () {
await frame.waitForSelector('div');
});
it('should be cancellable', async () => {
const {page, server} = getTestState();
await page.goto(server.EMPTY_PAGE);
const abortController = new AbortController();
const task = page.waitForSelector('wrong', {
abortController,
});
abortController.abort();
expect(task).rejects.toThrow(/aborted/);
});
it('should work with removed MutationObserver', async () => {
const {page} = getTestState();