Do (+1)
Do
- Wait appropriately using
networkidlefor dynamic content - Select elements by text, role, or data-testid over CSS
- Handle async operations with proper waits
- Clean up browsers and pages after tests
- Use fixtures for browser instance reuse
- Capture console logs for debugging
Don't
- Use arbitrary
time.sleep()for waits - Rely on fragile CSS selectors
- Skip error handling in test cleanup
- Run tests without checking server status
- Ignore network errors during testing