Fix two intermittents issues in integration tests

This commit is contained in:
Calixte Denizet 2023-04-25 11:35:21 +02:00
parent 1b79b0cd21
commit b4264e9648

View File

@ -829,11 +829,15 @@ describe("Interaction", () => {
expect(total).withContext(`In ${browserName}`).toEqual(`£${sum}`); 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 // Some unrendered annotations have been updated, so check
// that they've the correct value when rendered. // that they've the correct value when rendered.
await page.evaluate(() => { await page.evaluate(() => {
window.document window.document
.querySelectorAll('[data-page-number="4"][class="page"]')[0] .querySelector('.page[data-page-number = "4"]')
.scrollIntoView(); .scrollIntoView();
}); });
await page.waitForSelector(getSelector("299R"), { await page.waitForSelector(getSelector("299R"), {
@ -1738,11 +1742,11 @@ describe("Interaction", () => {
"window.PDFViewerApplication.scriptingReady === true" "window.PDFViewerApplication.scriptingReady === true"
); );
await page.type(getSelector("30R"), "abc"); await page.type(getSelector("30R"), "abc", { delay: 100 });
await page.waitForFunction( await page.waitForFunction(
`${getQuerySelector("30R")}.value !== "abc"` `${getQuerySelector("30R")}.value !== "abc"`
); );
await page.waitForTimeout(10); await page.waitForTimeout(100);
const focusedId = await page.evaluate(_ => const focusedId = await page.evaluate(_ =>
window.document.activeElement.getAttribute("data-element-id") window.document.activeElement.getAttribute("data-element-id")