From 8686c4e87cce5bf8bbd273f29ca08bd724f9c99a Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Sun, 15 Dec 2024 10:47:58 +0100 Subject: [PATCH] Build: Refactor e2e test for composition to make it more stable --- code/e2e-tests/composition.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/e2e-tests/composition.spec.ts b/code/e2e-tests/composition.spec.ts index 15bc6c4c4ed9..ec5a96e5898d 100644 --- a/code/e2e-tests/composition.spec.ts +++ b/code/e2e-tests/composition.spec.ts @@ -27,8 +27,12 @@ test.describe('composition', () => { await page.locator('[id="storybook\\@7\\.6\\.18_components-badge"]').click(); await expect( - page.locator('[id="storybook\\@7\\.6\\.18_components-badge--default"]') - ).toBeVisible(); + page + .locator('iframe[title="storybook-ref-storybook\\@7\\.6\\.18"]') + .contentFrame() + .locator('#storybook-root') + .getByText('Default') + ).toBeVisible({ timeout: 15000 }); // Expect composed stories `to be available in the search await page.getByPlaceholder('Find components').fill('Button');