fix: Update promptModalComponent.spec.ts to use waitForSelector instead of waitForTimeout (#4920)
- Replaced the usage of waitForTimeout with waitForSelector in promptModalComponent.spec.ts to improve reliability and stability of the tests.
This commit is contained in:
parent
ae7401bf7b
commit
fd399e9692
1 changed files with 6 additions and 2 deletions
|
|
@ -25,7 +25,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();
|
||||||
}
|
}
|
||||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||||
|
|
@ -35,7 +37,9 @@ test(
|
||||||
await page.getByTestId("sidebar-search-input").click();
|
await page.getByTestId("sidebar-search-input").click();
|
||||||
await page.getByTestId("sidebar-search-input").fill("prompt");
|
await page.getByTestId("sidebar-search-input").fill("prompt");
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForSelector('[data-testid="promptsPrompt"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.locator('//*[@id="promptsPrompt"]')
|
.locator('//*[@id="promptsPrompt"]')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue