hardStudy question · answer published in JavaScript interview questions, so no pointsplaywrightflaky-testsasync-javascript
Missing the response you wait for
This test sometimes times out even though the request succeeds. Why, and what is the fix?
await page.getByRole('button', { name: 'Search' }).click()
const res = await page.waitForResponse('**/api/search*')
expect(res.ok()).toBeTruthy()Discussion 0
Join free to post in the discussion.
Related questions
- A missing awaitAutomation Test Engineer
- What makes a test flakyAutomation Test Engineer
- Browsers Playwright coversAutomation Test Engineer
- Using the trace viewerAutomation Test Engineer
- Finding a button by role and nameAutomation Test Engineer
- Recording a first draft of a testAutomation Test Engineer
- Stepping through a failing testAutomation Test Engineer
- What a browser context gives youAutomation Test Engineer