diff --git a/packages/testing-kit/src/__TESTS__/button.spec.js b/packages/testing-kit/src/__TESTS__/button.spec.js index ab87a3cf98..cf70ea2c2d 100644 --- a/packages/testing-kit/src/__TESTS__/button.spec.js +++ b/packages/testing-kit/src/__TESTS__/button.spec.js @@ -3,7 +3,7 @@ import { Button } from '../buttons/Button'; // Assuming you have this Button cl test('should fire a click event and log to console', async ({ page }) => { // Navigate to the Storybook page with the component - await page.goto('/?path=/story/buttons-button--overview'); + await page.goto('/?path=/story/buttons-button--overview', {timeout: 60000}); // Locate the iframe where the button is rendered const frame = page.frameLocator("[id='storybook-preview-iframe']"); const button = new Button(page, frame.locator('button[data-testid="button"]'), 'Button'); diff --git a/packages/testing-kit/src/__TESTS__/buttonGroup.spec.js b/packages/testing-kit/src/__TESTS__/buttonGroup.spec.js index 1ab16c2ea4..33b0128201 100644 --- a/packages/testing-kit/src/__TESTS__/buttonGroup.spec.js +++ b/packages/testing-kit/src/__TESTS__/buttonGroup.spec.js @@ -8,13 +8,19 @@ test.describe("ButtonGroup Class with Storybook", () => { test.beforeEach(async ({ page }) => { // Navigate to the Storybook story where the ButtonGroup component is rendered await page.goto("/?path=/story/buttons-buttongroup--default"); - + //TODO - find a better way to wait for the storybook to load // Locate the iframe where the Storybook component is rendered const frame = page.frameLocator("[id='storybook-preview-iframe']"); // Locate the button group inside the iframe const buttonGroupLocator = frame.locator('div[data-testid="button-group"]'); - + while (await button.locator.isVisible() === false) { + await page.waitForTimeout(30000); + await page.reload(); + if (await buttonGroupLocator.locator.isVisible() === true) { + break; + } + } // Initialize ButtonGroup with the Playwright page and locator buttonGroup = new ButtonGroup(page, buttonGroupLocator, "Test Button Group"); }); diff --git a/packages/testing-kit/src/__TESTS__/dropdown.spec.js b/packages/testing-kit/src/__TESTS__/dropdown.spec.js index b728f9daa0..10c70a4d32 100644 --- a/packages/testing-kit/src/__TESTS__/dropdown.spec.js +++ b/packages/testing-kit/src/__TESTS__/dropdown.spec.js @@ -1,7 +1,7 @@ import { test, expect } from "@playwright/test"; import { DropDown } from "../inputs/DropDown"; -test.describe("menuButton Class with Storybook", () => { +test.describe("dropdown Class with Storybook", () => { let Dropdown; test.beforeEach(async ({ page }) => {