Update puppeteer to version 22.0.0

This is a major version bump that requires two changes on our side:

- The new headless mode is now the default, so we can remove our
  transformation code (see https://github.com/puppeteer/puppeteer/pull/11815).
- The `page.waitForTimeout` API is removed. Sadly we still used it in
  the integration tests (but fortunately much less than before we worked
  on fixing intermittent failures), so until we remove the final
  occurrences we provide an implementation ourselves (see
  https://github.com/puppeteer/puppeteer/pull/11780).

The full changelog can be found here:
https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v22.0.0
This commit is contained in:
Tim van der Meij 2024-02-10 18:21:34 +01:00
parent 4feab0c1fa
commit 28418598e5
No known key found for this signature in database
GPG key ID: 8C3FD2925A5F2762
7 changed files with 72 additions and 60 deletions

View file

@ -43,6 +43,7 @@ import {
waitForSelectedEditor,
waitForSerialized,
waitForStorageEntries,
waitForTimeout,
waitForUnselectedEditor,
} from "./test_utils.mjs";
import { PNG } from "pngjs";
@ -52,7 +53,7 @@ const copyPaste = async page => {
await kbCopy(page);
await promise;
await page.waitForTimeout(10);
await waitForTimeout(10);
promise = waitForEvent(page, "paste");
await kbPaste(page);
@ -1137,7 +1138,7 @@ describe("FreeText Editor", () => {
await kbUndo(page);
// Nothing should happen, it's why we can't wait for something
// specific!
await page.waitForTimeout(200);
await waitForTimeout(200);
// We check that the editor hasn't been removed.
editorIds = await getEditors(page, "freeText");
@ -1343,7 +1344,7 @@ describe("FreeText Editor", () => {
// Enter in editing mode.
await switchToFreeText(page);
await page.waitForTimeout(200);
await waitForTimeout(200);
// Disable editing mode.
await page.click("#editorFreeText");
@ -2373,7 +2374,7 @@ describe("FreeText Editor", () => {
// The editor must be moved in the DOM and potentially the focus
// will be lost, hence there's a callback will get back the focus.
await page.waitForTimeout(200);
await waitForTimeout(200);
const focused = await page.evaluate(sel => {
const editor = document.querySelector(sel);