From 01428f1e2379ea3ef628aeb70e29290914bf9844 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 17 Sep 2023 19:45:28 +0200 Subject: [PATCH] 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. --- test/integration/scripting_spec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/scripting_spec.js b/test/integration/scripting_spec.js index 540d0c7fb3fef..20c48a149c0b5 100644 --- a/test/integration/scripting_spec.js +++ b/test/integration/scripting_spec.js @@ -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']",