Skip to content

Commit 64a2d70

Browse files
committed
Fix intermittent failure in the find integration tests
After clicking the find button we need to wait for the input field to appear before we try to type in it, but instead we were waiting for the button to appear. However, the button is always present, so the current `waitForSelector` call is basically a no-op, and this can cause the integration tests to fail intermittently if we continue before the input field is actually visible. This appears to be due a typo first introduced in commit d10da90 that has been copy/pasted. This commit fixes the issue by waiting for the input field to be visible before we continue typing in it.
1 parent 18d7aaf commit 64a2d70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/integration/find_spec.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("find bar", () => {
4141
pages.map(async ([browserName, page]) => {
4242
// Highlight all occurrences of the letter A (case insensitive).
4343
await page.click("#viewFindButton");
44-
await page.waitForSelector("#viewFindButton", { hidden: false });
44+
await page.waitForSelector("#findInput", { visible: true });
4545
await page.type("#findInput", "a");
4646
await page.click("#findHighlightAll + label");
4747
await page.waitForSelector(".textLayer .highlight");
@@ -101,7 +101,7 @@ describe("find bar", () => {
101101
await Promise.all(
102102
pages.map(async ([browserName, page]) => {
103103
await page.click("#viewFindButton");
104-
await page.waitForSelector("#viewFindButton", { hidden: false });
104+
await page.waitForSelector("#findInput", { visible: true });
105105
await page.type("#findInput", "preferences");
106106
await page.waitForSelector("#findInput[data-status='']");
107107
await page.waitForSelector(".xfaLayer .highlight");
@@ -139,7 +139,7 @@ describe("find bar", () => {
139139
pages.map(async ([browserName, page]) => {
140140
// Search for "40"
141141
await page.click("#viewFindButton");
142-
await page.waitForSelector("#viewFindButton", { hidden: false });
142+
await page.waitForSelector("#findInput", { visible: true });
143143
await page.type("#findInput", "40");
144144

145145
const highlight = await page.waitForSelector(".textLayer .highlight");

0 commit comments

Comments
 (0)