Skip to content

Commit

Permalink
Migrate from page.waitFor in e2e tests
Browse files Browse the repository at this point in the history
The next version of Puppeteer will deprecate `page.waitFor` (see
puppeteer/puppeteer#6268 for details) so this CL
gets us ahead of the curve by removing all the usages of it.

Change-Id: I0d8cf154b6ee561036df1cd999a64fac1b01cc6c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2325220
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
  • Loading branch information
jackfranklin authored and Commit Bot committed Jul 29, 2020
1 parent d2c5f38 commit 3d163eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/e2e/helpers/console-helpers.ts
Expand Up @@ -135,7 +135,7 @@ export async function typeIntoConsole(frontend: puppeteer.Page, message: string)
// The autocomplete element doesn't exist until the first autocomplete suggestion
// is actaully given.
const autocomplete = autocompleteHandle ? autocompleteHandle.asElement()! : null;
await frontend.waitFor(
await frontend.waitForFunction(
(msg, ln, ac) => ln.textContent === msg && (!ac || ac.textContent === ''), undefined, message, line,
autocomplete);

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/sources/script-in-multiple-workers_test.ts
Expand Up @@ -117,7 +117,7 @@ describe('Multi-Workers', async function() {
return;
}
await bpCheckbox.evaluate(n => (n as HTMLElement).click());
await frontend.waitFor('.cm-breakpoint-disabled');
await frontend.waitForSelector('.cm-breakpoint-disabled');
// Add another breakpoint
await addBreakpointForLine(frontend, 12);

Expand Down

0 comments on commit 3d163eb

Please sign in to comment.