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.goto("/");
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
let modalCount = 0;
|
let modalCount = 0;
|
||||||
try {
|
try {
|
||||||
const modalTitleElement = await page?.getByTestId("modal-title");
|
const modalTitleElement = await page?.getByTestId("modal-title");
|
||||||
|
|
@ -31,7 +29,9 @@ test(
|
||||||
|
|
||||||
while (modalCount === 0) {
|
while (modalCount === 0) {
|
||||||
await page.getByText("New Flow", { exact: true }).click();
|
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();
|
modalCount = await page.getByTestId("modal-title")?.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -43,8 +43,6 @@ test(
|
||||||
|
|
||||||
await page.waitForSelector("text=new flow", { timeout: 30000 });
|
await page.waitForSelector("text=new flow", { timeout: 30000 });
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
(
|
(
|
||||||
await page.waitForSelector("text=new flow", {
|
await page.waitForSelector("text=new flow", {
|
||||||
|
|
@ -61,19 +59,17 @@ test(
|
||||||
await page.waitForSelector("text=api", { timeout: 30000 });
|
await page.waitForSelector("text=api", { timeout: 30000 });
|
||||||
await page.waitForSelector("text=share", { timeout: 30000 });
|
await page.waitForSelector("text=share", { timeout: 30000 });
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await expect(page.getByTestId("button_run_chat output")).toBeVisible({
|
||||||
|
timeout: 30000,
|
||||||
expect(
|
});
|
||||||
await page.getByTestId("button_run_chat output").isVisible(),
|
await expect(page.getByTestId("button_run_openai")).toBeVisible({
|
||||||
).toBeTruthy();
|
timeout: 30000,
|
||||||
expect(
|
});
|
||||||
await page.getByTestId("button_run_openai").isVisible(),
|
await expect(page.getByTestId("button_run_prompt")).toBeVisible({
|
||||||
).toBeTruthy();
|
timeout: 30000,
|
||||||
expect(
|
});
|
||||||
await page.getByTestId("button_run_prompt").isVisible(),
|
await expect(page.getByTestId("button_run_chat input")).toBeVisible({
|
||||||
).toBeTruthy();
|
timeout: 30000,
|
||||||
expect(
|
});
|
||||||
await page.getByTestId("button_run_chat input").isVisible(),
|
|
||||||
).toBeTruthy();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue