Skip to content
RED SAG Skills
hard20 pts · first answer countsui-automationplaywrightflaky-tests

Retrying a group of steps

A settings panel sometimes ignores the first click while it initialises, and fixing the app is not possible this sprint. Which Playwright tool retries both the click and the check together?

await expect(async () => {
  await page.getByRole('switch', { name: 'Dark mode' }).click()
  await expect(page.locator('html')).toHaveAttribute('data-theme', 'dark', { timeout: 1000 })
}).toPass({ timeout: 10_000 })
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions