Skip to content
RED SAGSkills
medium10 pts · first answer countsplaywrighte2e-testing

Flaky end-to-end test with fixed waits

A Playwright test clicks Save, waits 3 seconds and then checks for a success message. It fails randomly on CI. What is the better approach?

await page.getByRole('button', { name: 'Save' }).click()
await page.waitForTimeout(3000)
expect(await page.locator('.toast').isVisible()).toBe(true)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions