fix: make component test pass if component tab is not present (#7865)
This commit is contained in:
parent
cf5dba11df
commit
37fbbe0ebf
1 changed files with 48 additions and 47 deletions
|
|
@ -77,63 +77,64 @@ 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);
|
||||||
|
|
||||||
await page.getByTestId("side_nav_options_all-templates").click();
|
if (await page.getByTestId("components-btn").isVisible()) {
|
||||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
await page.getByTestId("side_nav_options_all-templates").click();
|
||||||
|
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||||
|
|
||||||
await page.waitForSelector('[data-testid="fit_view"]', {
|
await page.waitForSelector('[data-testid="fit_view"]', {
|
||||||
timeout: 100000,
|
timeout: 100000,
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.getByTestId("fit_view").click();
|
await page.getByTestId("fit_view").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
await page.getByTestId("zoom_out").click();
|
await page.getByTestId("zoom_out").click();
|
||||||
|
|
||||||
await page.getByText("Chat Input").first().click();
|
await page.getByText("Chat Input").first().click();
|
||||||
await page.waitForSelector('[data-testid="more-options-modal"]', {
|
await page.waitForSelector('[data-testid="more-options-modal"]', {
|
||||||
timeout: 1000,
|
timeout: 1000,
|
||||||
});
|
});
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await page
|
await page
|
||||||
.getByText("Prompt", {
|
.getByText("Prompt", {
|
||||||
exact: true,
|
exact: true,
|
||||||
})
|
})
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.getByText("OpenAI", {
|
.getByText("OpenAI", {
|
||||||
exact: true,
|
exact: true,
|
||||||
})
|
})
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
await page.getByTestId("more-options-modal").click();
|
await page.getByTestId("more-options-modal").click();
|
||||||
|
|
||||||
await page.getByTestId("icon-SaveAll").first().click();
|
await page.getByTestId("icon-SaveAll").first().click();
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
|
|
||||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||||
timeout: 100000,
|
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) {
|
if (exitButton > 0) {
|
||||||
await page.getByText("Exit", { exact: true }).click();
|
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();
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue