refactor: Remove unnecessary wait timeouts in chat components tests (#4605)
* refactor: Remove unnecessary wait timeouts in chatInputOutputUser-shard-0.spec.ts * update timer limit
This commit is contained in:
parent
3391a266a4
commit
076bc314ed
1 changed files with 6 additions and 5 deletions
|
|
@ -15,8 +15,6 @@ test("user must be able to send an image on chat", async ({ page }) => {
|
||||||
|
|
||||||
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");
|
||||||
|
|
@ -29,7 +27,9 @@ test("user must be able to send an image on chat", async ({ page }) => {
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,14 +48,15 @@ test("user must be able to send an image on chat", async ({ page }) => {
|
||||||
|
|
||||||
while (outdatedComponents > 0) {
|
while (outdatedComponents > 0) {
|
||||||
await page.getByTestId("icon-AlertTriangle").first().click();
|
await page.getByTestId("icon-AlertTriangle").first().click();
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForSelector('[data-testid="icon-AlertTriangle"]', {
|
||||||
|
timeout: 1000,
|
||||||
|
});
|
||||||
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
|
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
|
||||||
}
|
}
|
||||||
|
|
||||||
let filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
let filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||||
while (filledApiKey > 0) {
|
while (filledApiKey > 0) {
|
||||||
await page.getByTestId("remove-icon-badge").first().click();
|
await page.getByTestId("remove-icon-badge").first().click();
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
filledApiKey = await page.getByTestId("remove-icon-badge").count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue