Merge pull request #17125 from timvandermeij/find-intermittent

Fix intermittent problems on Windows in the XFA search integration test
This commit is contained in:
Tim van der Meij 2023-10-15 18:32:17 +02:00 committed by GitHub
commit 22d6d95f03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,19 +88,19 @@ describe("find bar", () => {
pages.map(async ([browserName, page]) => { pages.map(async ([browserName, page]) => {
await page.click("#viewFind"); await page.click("#viewFind");
await page.waitForSelector("#viewFind", { hidden: false }); await page.waitForSelector("#viewFind", { hidden: false });
await page.type("#findInput", "city"); await page.type("#findInput", "preferences");
await page.waitForSelector("#findInput[data-status='']"); await page.waitForSelector("#findInput[data-status='']");
await page.waitForSelector(".xfaLayer .highlight"); await page.waitForSelector(".xfaLayer .highlight");
const resultElement = await page.waitForSelector("#findResultsCount"); const resultElement = await page.waitForSelector("#findResultsCount");
const resultText = await resultElement.evaluate(el => el.textContent); const resultText = await resultElement.evaluate(el => el.textContent);
expect(resultText).toEqual("1 of 7 matches"); expect(resultText).toEqual("1 of 1 match");
const selectedElement = await page.waitForSelector( const selectedElement = await page.waitForSelector(
".highlight.selected" ".highlight.selected"
); );
const selectedText = await selectedElement.evaluate( const selectedText = await selectedElement.evaluate(
el => el.textContent el => el.textContent
); );
expect(selectedText).toEqual("City"); expect(selectedText).toEqual("Preferences");
}) })
); );
}); });