mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Remove the arbitrary timeout in the "must check that first text field has focus" integration-test (PR 12702 follow-up)
It seems that the timeout is way too short in practice, since this new integration-test failed *intermittently* already in PR 12702 (which is where the test was added). The ideal solution here would be to simply await an event, dispatched by the viewer, however that unfortunately doesn't appear to be supported by Puppeteer. Instead, the solution implemented here is to add a new method in `PDFViewerApplication` which Puppeteer can query to check if the scripting/sandbox has been fully initialized.
This commit is contained in:
parent
54f45dc935
commit
6f40f4e7c2
2 changed files with 27 additions and 2 deletions
|
@ -30,9 +30,12 @@ describe("Interaction", () => {
|
|||
it("must check that first text field has focus", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForFunction(
|
||||
"window.PDFViewerApplication.scriptingReady === true"
|
||||
);
|
||||
|
||||
// The document has an open action in order to give
|
||||
// the focus to 401R.
|
||||
await page.waitForTimeout(1000);
|
||||
const id = await page.evaluate(
|
||||
() => window.document.activeElement.id
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue