From b4264e964830422b70242b479b6c6349249e3c69 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 25 Apr 2023 11:35:21 +0200 Subject: [PATCH] Fix two intermittents issues in integration tests --- test/integration/scripting_spec.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/integration/scripting_spec.js b/test/integration/scripting_spec.js index 7fd854623..77b7b277d 100644 --- a/test/integration/scripting_spec.js +++ b/test/integration/scripting_spec.js @@ -829,11 +829,15 @@ describe("Interaction", () => { expect(total).withContext(`In ${browserName}`).toEqual(`£${sum}`); } + await page.waitForSelector('.page[data-page-number = "4"]', { + timeout: 0, + }); + // Some unrendered annotations have been updated, so check // that they've the correct value when rendered. await page.evaluate(() => { window.document - .querySelectorAll('[data-page-number="4"][class="page"]')[0] + .querySelector('.page[data-page-number = "4"]') .scrollIntoView(); }); await page.waitForSelector(getSelector("299R"), { @@ -1738,11 +1742,11 @@ describe("Interaction", () => { "window.PDFViewerApplication.scriptingReady === true" ); - await page.type(getSelector("30R"), "abc"); + await page.type(getSelector("30R"), "abc", { delay: 100 }); await page.waitForFunction( `${getQuerySelector("30R")}.value !== "abc"` ); - await page.waitForTimeout(10); + await page.waitForTimeout(100); const focusedId = await page.evaluate(_ => window.document.activeElement.getAttribute("data-element-id")