Wait for visibility change in the issue15053 integration test

Especially on slower bots there is some time between clicking the
element and the actual visibility change, but we didn't await this and
checked the visibility state immediately after clicking. This can be
reproduced 100% of the time by introducing a delay in the `display` and
`hidden` handlers of the `_commonActions` shadow call.

This commit fixes the problem by waiting until the first visibility
change actually happened before continuing with the assertions.
This commit is contained in:
Tim van der Meij 2023-09-17 19:45:28 +02:00
parent 97819891b6
commit 01428f1e23
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -1414,6 +1414,9 @@ describe("Interaction", () => {
.toEqual("visible");
await page.click(getSelector("44R"));
await page.waitForFunction(
`document.querySelector("[data-annotation-id='35R']").style.visibility === "hidden"`
);
visibility = await page.$eval(
"[data-annotation-id='35R']",