Wait for selector instead of timeout in the bug1844576
integration test
This integration test currently fails intermittently on the bots because of the fixed timeout in the test, which is sometimes too low on slower systems. The issue can be reproduced 100% of the time by introducing a delay in the `WidgetAnnotationElement.showElementAndHideCanvas` method. Puppeteer also discourages this and instead recommends waiting for a selector instead, which we now do here. This ensures that the test only continues if the element under test is available and therefore prevents any timing problems.
This commit is contained in:
parent
dd46110f6b
commit
0d3fbc1818
@ -2011,7 +2011,9 @@ describe("Interaction", () => {
|
||||
expect(hasHiddenInput).withContext(`In ${browserName}`).toEqual(true);
|
||||
|
||||
await page.click(getSelector("12R"));
|
||||
await page.waitForTimeout(10);
|
||||
await page.waitForSelector(
|
||||
`[data-annotation-id="9R"] > canvas[hidden]`
|
||||
);
|
||||
|
||||
const hasHiddenCanvas = await page.$eval(
|
||||
`[data-annotation-id="9R"] > canvas`,
|
||||
|
Loading…
Reference in New Issue
Block a user