From 2c2d50aec93d37f2f6f37c563c6de343c9bfcfe5 Mon Sep 17 00:00:00 2001 From: Holger Benl Date: Mon, 4 Mar 2024 16:57:38 +0100 Subject: [PATCH] Fix e2e helper waitForRecordingToFinishIndexing() --- packages/e2e-tests/helpers/utils.ts | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/e2e-tests/helpers/utils.ts b/packages/e2e-tests/helpers/utils.ts index e93f6722d18..172522828a7 100644 --- a/packages/e2e-tests/helpers/utils.ts +++ b/packages/e2e-tests/helpers/utils.ts @@ -85,18 +85,18 @@ export async function mapLocators( } export async function getSupportFormErrorDetails(page: Page) { - if (await page.locator('[data-test-id="SupportForm"]').isVisible()) { - let details: string = ""; + if (await page.locator('[data-test-id="UnexpectedErrorDetails"]').isVisible()) { try { - const errorDetailsLocator = page.locator('[data-test-id="UnexpectedErrorDetails"]'); - if (await errorDetailsLocator.isVisible()) { - details = await errorDetailsLocator.innerText(); + const expandableLocator = page.locator('[data-test-name="ExpandablePreview"]'); + if (await expandableLocator.isVisible()) { + await expandableLocator.click(); + return await page.locator('[data-test-name="ErrorDetails"]').innerText(); } } catch (err) { // Ignore locator errors. console.error(`ERROR:`, err); } - return details || "(support form is visible)"; + return "(unexpected error modal is visible)"; } return null; } @@ -128,10 +128,14 @@ export async function waitForRecordingToFinishIndexing(page: Page): Promise