mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
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:
parent
4feab0c1fa
commit
28418598e5
7 changed files with 72 additions and 60 deletions
|
@ -27,6 +27,7 @@ import {
|
|||
loadAndWait,
|
||||
scrollIntoView,
|
||||
waitForEntryInStorage,
|
||||
waitForTimeout,
|
||||
} from "./test_utils.mjs";
|
||||
|
||||
describe("Interaction", () => {
|
||||
|
@ -1711,7 +1712,7 @@ describe("Interaction", () => {
|
|||
await clearInput(page, getSelector("27R"));
|
||||
await page.type(getSelector("27R"), exportValue);
|
||||
await page.click("[data-annotation-id='28R']");
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
value = await page.$eval(getSelector("24R"), el => el.value);
|
||||
expect(value).withContext(`In ${browserName}`).toEqual(exportValue);
|
||||
|
@ -1758,7 +1759,7 @@ describe("Interaction", () => {
|
|||
await page.waitForFunction(
|
||||
`${getQuerySelector("30R")}.value !== "abc"`
|
||||
);
|
||||
await page.waitForTimeout(100);
|
||||
await waitForTimeout(100);
|
||||
|
||||
const focusedId = await page.evaluate(_ =>
|
||||
window.document.activeElement.getAttribute("data-element-id")
|
||||
|
@ -1854,7 +1855,7 @@ describe("Interaction", () => {
|
|||
expect(text).withContext(`In ${browserName}`).toEqual("00000000123");
|
||||
|
||||
await page.click(getSelector("26R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("25R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("00000000123");
|
||||
|
@ -1888,13 +1889,13 @@ describe("Interaction", () => {
|
|||
expect(text).withContext(`In ${browserName}`).toEqual("5,25");
|
||||
|
||||
await page.click(getSelector("22R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("22R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("5,25");
|
||||
|
||||
await page.click(getSelector("31R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("31R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("5.25");
|
||||
|
@ -1925,7 +1926,7 @@ describe("Interaction", () => {
|
|||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
||||
|
||||
await page.select(getSelector("6R"), "Yes");
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("44R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("Yes");
|
||||
|
@ -1933,7 +1934,7 @@ describe("Interaction", () => {
|
|||
await clearInput(page, getSelector("44R"));
|
||||
|
||||
await page.select(getSelector("6R"), "No");
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("44R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("No");
|
||||
|
@ -1990,14 +1991,14 @@ describe("Interaction", () => {
|
|||
await page.type(getSelector("26R"), "abcde", { delay: 10 });
|
||||
|
||||
await page.click(getSelector("23R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
await page.click(getSelector("26R"));
|
||||
|
||||
await kbSelectAll(page);
|
||||
await page.keyboard.press("Backspace");
|
||||
|
||||
await page.click(getSelector("23R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
text = await page.$eval(getSelector("26R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("");
|
||||
|
@ -2093,7 +2094,7 @@ describe("Interaction", () => {
|
|||
expect(visibility).withContext(`In ${browserName}`).toEqual("hidden");
|
||||
|
||||
await page.click(getSelector("11R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
visibility = await page.$eval(
|
||||
getSelector("7R"),
|
||||
|
@ -2139,28 +2140,28 @@ describe("Interaction", () => {
|
|||
);
|
||||
expect(readonly).withContext(`In ${browserName}`).toEqual(true);
|
||||
await page.click(getSelector("334R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
readonly = await page.$eval(getSelector("353R"), el => el.disabled);
|
||||
expect(readonly).withContext(`In ${browserName}`).toEqual(true);
|
||||
await page.click(getSelector("351R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
readonly = await page.$eval(getSelector("353R"), el => el.disabled);
|
||||
expect(readonly).withContext(`In ${browserName}`).toEqual(true);
|
||||
await page.click(getSelector("352R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
readonly = await page.$eval(getSelector("353R"), el => el.disabled);
|
||||
expect(readonly).withContext(`In ${browserName}`).toEqual(false);
|
||||
|
||||
await page.click(getSelector("353R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
let checked = await page.$eval(getSelector("353R"), el => el.checked);
|
||||
expect(checked).withContext(`In ${browserName}`).toEqual(true);
|
||||
await page.click(getSelector("334R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
readonly = await page.$eval(getSelector("353R"), el => el.disabled);
|
||||
expect(readonly).withContext(`In ${browserName}`).toEqual(true);
|
||||
|
@ -2199,16 +2200,16 @@ describe("Interaction", () => {
|
|||
await page.click(getSelector("55R"));
|
||||
await page.type(getSelector("55R"), "Hello", { delay: 10 });
|
||||
await page.click(getSelector("56R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
await page.click(getSelector("55R"));
|
||||
await page.type(getSelector("55R"), " World", { delay: 10 });
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
|
||||
await otherPages[i].bringToFront();
|
||||
await otherPages[i].waitForTimeout(100);
|
||||
await waitForTimeout(100);
|
||||
await page.bringToFront();
|
||||
await page.waitForTimeout(100);
|
||||
await waitForTimeout(100);
|
||||
|
||||
const text = await page.$eval(getSelector("55R"), el => el.value);
|
||||
expect(text).withContext(`In ${browserName}`).toEqual("Hello World");
|
||||
|
@ -2243,7 +2244,7 @@ describe("Interaction", () => {
|
|||
);
|
||||
|
||||
await page.click(getSelector("25R"));
|
||||
await page.waitForTimeout(10);
|
||||
await waitForTimeout(10);
|
||||
await page.click(getSelector("26R"));
|
||||
|
||||
await page.waitForFunction(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue