Refactor: improve starter project modal test (#5098)
Refactor: Add search input for templates in TemplateContentComponent
This commit is contained in:
parent
fa2ac6b9f0
commit
5c8bab57f1
2 changed files with 19 additions and 19 deletions
|
|
@ -83,6 +83,7 @@ export default function TemplateContentComponent({
|
|||
<Input
|
||||
type="search"
|
||||
placeholder="Search..."
|
||||
data-testid="search-input-template"
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
ref={searchInputRef}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ test(
|
|||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="modal-title"]', {
|
||||
timeout: 3000,
|
||||
});
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
|
|
@ -25,14 +27,15 @@ test(
|
|||
expect(page.getByRole("button", { name: "Blank Flow" })).toBeVisible();
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForSelector('[data-testid="search-input-template"]', {
|
||||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.getByPlaceholder("Search...").fill("Document");
|
||||
await page.waitForTimeout(500);
|
||||
await page.getByTestId("search-input-template").fill("Document");
|
||||
|
||||
expect(
|
||||
page.getByTestId("template_basic-prompting-(hello,-world)"),
|
||||
).not.toBeVisible();
|
||||
).toBeVisible({ visible: false, timeout: 3000 });
|
||||
|
||||
expect(page.getByTestId("template_document-q&a").first()).toBeVisible();
|
||||
expect(
|
||||
|
|
@ -46,16 +49,16 @@ test(
|
|||
page.getByTestId(`template_hierarchical-tasks-agent`),
|
||||
).not.toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByTestId(`side_nav_options_prompting`).click();
|
||||
await page.waitForTimeout(500);
|
||||
expect(page.getByTestId(`category_title_prompting`)).toBeVisible();
|
||||
expect(page.getByTestId(`category_title_prompting`)).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.getByTestId(`side_nav_options_rag`).click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(page.getByTestId(`category_title_rag`)).toBeVisible();
|
||||
expect(page.getByTestId(`category_title_rag`)).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).toBeVisible();
|
||||
|
||||
expect(
|
||||
|
|
@ -64,20 +67,16 @@ test(
|
|||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
|
||||
await page.getByTestId(`side_nav_options_agents`).click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(page.getByTestId(`category_title_agents`)).toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
expect(page.getByTestId(`category_title_agents`)).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
expect(
|
||||
page.getByTestId(`template_basic-prompting-(hello,-world)`),
|
||||
).not.toBeVisible();
|
||||
).toBeVisible({ visible: false, timeout: 3000 });
|
||||
expect(page.getByTestId(`template_document-qa`)).not.toBeVisible();
|
||||
expect(page.getByTestId(`template_vector-store-rag`)).not.toBeVisible();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await waitForTemplateVisibility(page, templateIds);
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue