Skip to content

Commit 4c2a96e

Browse files
committed
Fix failing integration test on Windws with Chrome
It fixes #18775.
1 parent 81cf42d commit 4c2a96e

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

test/integration/highlight_editor_spec.mjs

+20-6
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,10 @@ describe("Highlight Editor", () => {
17851785
await page.keyboard.press("Escape");
17861786
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
17871787

1788+
const clickHandle = await waitForPointerUp(page);
1789+
y = rect.y - rect.height;
1790+
await page.mouse.move(x, y);
1791+
17881792
const counterHandle = await page.evaluateHandle(sel => {
17891793
const el = document.querySelector(sel);
17901794
const counter = { count: 0 };
@@ -1798,10 +1802,10 @@ describe("Highlight Editor", () => {
17981802
return counter;
17991803
}, editorSelector);
18001804

1801-
const clickHandle = await waitForPointerUp(page);
1802-
y = rect.y - rect.height;
1803-
await page.mouse.move(x, y);
18041805
await page.mouse.down();
1806+
await page.waitForSelector(
1807+
`.page[data-page-number = "1"] .annotationEditorLayer.drawing`
1808+
);
18051809
for (
18061810
const endY = rect.y + 2 * rect.height;
18071811
y <= endY;
@@ -1811,6 +1815,9 @@ describe("Highlight Editor", () => {
18111815
}
18121816
await page.mouse.up();
18131817
await awaitPromise(clickHandle);
1818+
await page.waitForSelector(
1819+
`.page[data-page-number = "1"] .annotationEditorLayer:not(.drawing)`
1820+
);
18141821

18151822
const { count } = await counterHandle.jsonValue();
18161823
expect(count).withContext(`In ${browserName}`).toEqual(0);
@@ -1849,6 +1856,10 @@ describe("Highlight Editor", () => {
18491856
await page.keyboard.press("Escape");
18501857
await page.waitForSelector(`${editorSelector}:not(.selectedEditor)`);
18511858

1859+
const clickHandle = await waitForPointerUp(page);
1860+
y = rect.y - 3 * rect.height;
1861+
await page.mouse.move(x, y);
1862+
18521863
const counterHandle = await page.evaluateHandle(sel => {
18531864
const el = document.querySelector(sel);
18541865
const counter = { count: 0 };
@@ -1862,10 +1873,10 @@ describe("Highlight Editor", () => {
18621873
return counter;
18631874
}, editorSelector);
18641875

1865-
const clickHandle = await waitForPointerUp(page);
1866-
y = rect.y - 3 * rect.height;
1867-
await page.mouse.move(x, y);
18681876
await page.mouse.down();
1877+
await page.waitForSelector(
1878+
`.page[data-page-number = "1"] .textLayer.selecting`
1879+
);
18691880
for (
18701881
const endY = rect.y + 3 * rect.height;
18711882
y <= endY;
@@ -1875,6 +1886,9 @@ describe("Highlight Editor", () => {
18751886
}
18761887
await page.mouse.up();
18771888
await awaitPromise(clickHandle);
1889+
await page.waitForSelector(
1890+
`.page[data-page-number = "1"] .textLayer:not(.selecting)`
1891+
);
18781892

18791893
const { count } = await counterHandle.jsonValue();
18801894
expect(count).withContext(`In ${browserName}`).toEqual(0);

0 commit comments

Comments
 (0)