Refactor: remove unnecessary wait timeouts in regression test (#5133)
* refactor: Remove unnecessary wait timeouts in regression test
This commit is contained in:
parent
5a42c82fc4
commit
479cc3fa64
1 changed files with 15 additions and 19 deletions
|
|
@ -17,8 +17,6 @@ test(
|
|||
|
||||
await page.goto("/");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||
|
|
@ -31,7 +29,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();
|
||||
}
|
||||
|
||||
|
|
@ -43,8 +43,6 @@ test(
|
|||
|
||||
await page.waitForSelector("text=new flow", { timeout: 30000 });
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
expect(
|
||||
(
|
||||
await page.waitForSelector("text=new flow", {
|
||||
|
|
@ -61,19 +59,17 @@ test(
|
|||
await page.waitForSelector("text=api", { timeout: 30000 });
|
||||
await page.waitForSelector("text=share", { timeout: 30000 });
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
expect(
|
||||
await page.getByTestId("button_run_chat output").isVisible(),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
await page.getByTestId("button_run_openai").isVisible(),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
await page.getByTestId("button_run_prompt").isVisible(),
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
await page.getByTestId("button_run_chat input").isVisible(),
|
||||
).toBeTruthy();
|
||||
await expect(page.getByTestId("button_run_chat output")).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByTestId("button_run_openai")).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByTestId("button_run_prompt")).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
await expect(page.getByTestId("button_run_chat input")).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue