mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-04 06:05:47 +02:00
Wait to have all the spans in the text layer before trying to set the caret in integration tests
This commit is contained in:
parent
1f94023d42
commit
32dc2a5894
@ -680,6 +680,10 @@ async function firstPageOnTop(page) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setCaretAt(page, pageNumber, text, position) {
|
async function setCaretAt(page, pageNumber, text, position) {
|
||||||
|
// Wait for the text layer to finish rendering before trying to find the span.
|
||||||
|
await page.waitForSelector(
|
||||||
|
`.page[data-page-number="${pageNumber}"] .textLayer .endOfContent`
|
||||||
|
);
|
||||||
await page.evaluate(
|
await page.evaluate(
|
||||||
(pageN, string, pos) => {
|
(pageN, string, pos) => {
|
||||||
for (const el of document.querySelectorAll(
|
for (const el of document.querySelectorAll(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user