From 77fab57856b68be43c112c3f83616254c8f3460a Mon Sep 17 00:00:00 2001 From: Jack Franklin Date: Wed, 29 Jul 2020 11:10:57 +0100 Subject: [PATCH] Migrate from page.waitFor in e2e tests The next version of Puppeteer will deprecate `page.waitFor` (see https://github.com/puppeteer/puppeteer/pull/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 Reviewed-by: Paul Lewis Commit-Queue: Jack Franklin --- test/e2e/helpers/console-helpers.ts | 2 +- test/e2e/sources/script-in-multiple-workers_test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/helpers/console-helpers.ts b/test/e2e/helpers/console-helpers.ts index c5f5191106b..63434fb0b4f 100644 --- a/test/e2e/helpers/console-helpers.ts +++ b/test/e2e/helpers/console-helpers.ts @@ -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); diff --git a/test/e2e/sources/script-in-multiple-workers_test.ts b/test/e2e/sources/script-in-multiple-workers_test.ts index f17714043e4..9550188a5ad 100644 --- a/test/e2e/sources/script-in-multiple-workers_test.ts +++ b/test/e2e/sources/script-in-multiple-workers_test.ts @@ -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);