diff --git a/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts b/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts index 42203f050..ccaba57a5 100644 --- a/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts +++ b/src/frontend/tests/core/features/actionsMainPage-shard-1.spec.ts @@ -77,63 +77,64 @@ test("search flows", { tag: ["@release"] }, async ({ page }) => { test("search components", { tag: ["@release"] }, async ({ page }) => { await awaitBootstrapTest(page); - await page.getByTestId("side_nav_options_all-templates").click(); - await page.getByRole("heading", { name: "Basic Prompting" }).click(); + if (await page.getByTestId("components-btn").isVisible()) { + await page.getByTestId("side_nav_options_all-templates").click(); + await page.getByRole("heading", { name: "Basic Prompting" }).click(); - await page.waitForSelector('[data-testid="fit_view"]', { - timeout: 100000, - }); + await page.waitForSelector('[data-testid="fit_view"]', { + timeout: 100000, + }); - await page.getByTestId("fit_view").click(); - await page.getByTestId("zoom_out").click(); - await page.getByTestId("zoom_out").click(); + await page.getByTestId("fit_view").click(); + await page.getByTestId("zoom_out").click(); + await page.getByTestId("zoom_out").click(); - await page.getByText("Chat Input").first().click(); - await page.waitForSelector('[data-testid="more-options-modal"]', { - timeout: 1000, - }); - await page.getByTestId("more-options-modal").click(); + await page.getByText("Chat Input").first().click(); + await page.waitForSelector('[data-testid="more-options-modal"]', { + timeout: 1000, + }); + await page.getByTestId("more-options-modal").click(); - await page.getByTestId("icon-SaveAll").first().click(); - await page.keyboard.press("Escape"); - await page - .getByText("Prompt", { - exact: true, - }) - .first() - .click(); - await page.getByTestId("more-options-modal").click(); + await page.getByTestId("icon-SaveAll").first().click(); + await page.keyboard.press("Escape"); + await page + .getByText("Prompt", { + exact: true, + }) + .first() + .click(); + await page.getByTestId("more-options-modal").click(); - await page.getByTestId("icon-SaveAll").first().click(); - await page.keyboard.press("Escape"); + await page.getByTestId("icon-SaveAll").first().click(); + await page.keyboard.press("Escape"); - await page - .getByText("OpenAI", { - exact: true, - }) - .first() - .click(); - await page.getByTestId("more-options-modal").click(); + await page + .getByText("OpenAI", { + exact: true, + }) + .first() + .click(); + await page.getByTestId("more-options-modal").click(); - await page.getByTestId("icon-SaveAll").first().click(); - await page.keyboard.press("Escape"); + await page.getByTestId("icon-SaveAll").first().click(); + await page.keyboard.press("Escape"); - await page.waitForSelector('[data-testid="icon-ChevronLeft"]', { - timeout: 100000, - }); + await page.waitForSelector('[data-testid="icon-ChevronLeft"]', { + timeout: 100000, + }); - await page.getByTestId("icon-ChevronLeft").first().click(); + await page.getByTestId("icon-ChevronLeft").first().click(); - const exitButton = await page.getByText("Exit", { exact: true }).count(); + const exitButton = await page.getByText("Exit", { exact: true }).count(); - if (exitButton > 0) { - await page.getByText("Exit", { exact: true }).click(); + if (exitButton > 0) { + await page.getByText("Exit", { exact: true }).click(); + } + + await page.getByTestId("components-btn").click(); + await page.getByPlaceholder("Search components").fill("Chat Input"); + await page.getByText("Chat Input", { exact: true }).isVisible(); + await page.getByText("Prompt", { exact: true }).isHidden(); + await page.getByText("OpenAI", { exact: true }).isHidden(); } - - await page.getByTestId("components-btn").click(); - - await page.getByPlaceholder("Search components").fill("Chat Input"); - await page.getByText("Chat Input", { exact: true }).isVisible(); - await page.getByText("Prompt", { exact: true }).isHidden(); - await page.getByText("OpenAI", { exact: true }).isHidden(); });