fix: make component test pass if component tab is not present (#7865)

This commit is contained in:
Lucas Oliveira 2025-04-30 15:39:58 -03:00 • committed by GitHub
commit 37fbbe0ebf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,6 +77,7 @@ test("search flows", { tag: ["@release"] }, async ({ page }) => {
test("search components", { tag: ["@release"] }, async ({ page }) => { test("search components", { tag: ["@release"] }, async ({ page }) => {
await awaitBootstrapTest(page); await awaitBootstrapTest(page);
if (await page.getByTestId("components-btn").isVisible()) {
await page.getByTestId("side_nav_options_all-templates").click(); await page.getByTestId("side_nav_options_all-templates").click();
await page.getByRole("heading", { name: "Basic Prompting" }).click(); await page.getByRole("heading", { name: "Basic Prompting" }).click();
@ -131,9 +132,9 @@ test("search components", { tag: ["@release"] }, async ({ page }) => {
} }
await page.getByTestId("components-btn").click(); await page.getByTestId("components-btn").click();
await page.getByPlaceholder("Search components").fill("Chat Input"); await page.getByPlaceholder("Search components").fill("Chat Input");
await page.getByText("Chat Input", { exact: true }).isVisible(); await page.getByText("Chat Input", { exact: true }).isVisible();
await page.getByText("Prompt", { exact: true }).isHidden(); await page.getByText("Prompt", { exact: true }).isHidden();
await page.getByText("OpenAI", { exact: true }).isHidden(); await page.getByText("OpenAI", { exact: true }).isHidden();
}
}); });