hardStudy question · answer published in Playwright interview questions, so no pointsplaywrightasync
Hidden race in a test
What is wrong with this Playwright test?
test('shows cart count', async ({ page }) => {
await page.getByRole('button', { name: 'Add to cart' }).click()
expect(page.getByTestId('cart-count')).toHaveText('1')
})Discussion 0
Join free to post in the discussion.
Related questions
- A missing awaitAutomation 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
- Uploading a fileAutomation Test Engineer