From 5dcd6156b7b7b429a3712a3e42cb9036235825ea Mon Sep 17 00:00:00 2001 From: ShaMan123 Date: Wed, 19 Jul 2023 23:19:45 +0530 Subject: [PATCH] Update setupApp.ts --- e2e/setup/setupApp.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/e2e/setup/setupApp.ts b/e2e/setup/setupApp.ts index e3fbd035c78..2af6d7234d5 100644 --- a/e2e/setup/setupApp.ts +++ b/e2e/setup/setupApp.ts @@ -54,8 +54,19 @@ test.beforeEach(async ({ page }, { file }) => { // used to avoid a race condition that occurs because of script loading const trigger = page.evaluate( () => - new Promise((resolve) => { - window.addEventListener('fabric:setup', resolve, { once: true }); + new Promise((resolve) => { + window.addEventListener( + 'fabric:setup', + () => { + const t = setInterval(() => { + if (window.objectMap) { + clearInterval(t); + resolve(); + } + }, 100); + }, + { once: true } + ); }) ); await page.addScriptTag({