Skip to content

Commit 32dc2a5

Browse files
committed
Wait to have all the spans in the text layer before trying to set the caret in integration tests
1 parent 1f94023 commit 32dc2a5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/integration/test_utils.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ async function firstPageOnTop(page) {
680680
}
681681

682682
async function setCaretAt(page, pageNumber, text, position) {
683+
// Wait for the text layer to finish rendering before trying to find the span.
684+
await page.waitForSelector(
685+
`.page[data-page-number="${pageNumber}"] .textLayer .endOfContent`
686+
);
683687
await page.evaluate(
684688
(pageN, string, pos) => {
685689
for (const el of document.querySelectorAll(

0 commit comments

Comments
 (0)