I’ve been in the same boat with Playwright await element to be present after click. One trick I use is to chain the click and waitForSelector together like this:
```javascript
await page.click('button').then(() => page.waitForSelector('.new-element'));
```
This ensures the wait starts immediately after the click. It’s not perfect, but it’s been more reliable for me than separating the two actions.
```javascript
await page.click('button').then(() => page.waitForSelector('.new-element'));
```
This ensures the wait starts immediately after the click. It’s not perfect, but it’s been more reliable for me than separating the two actions.
