Troubleshooting & Examples
Troubleshooting
Q: Why are my page test requests recorded without a scenario key?
// BAD: withScenarioKey set before withPage — state is reset
interceptor.withScenarioKey('<SCENARIO-KEY>'); // set here...
interceptor.withPage(page); // ...wiped here
await interceptor.apply(); // no scenario key// GOOD: withScenarioKey set after withPage, right before apply
interceptor.withPage(page);
interceptor.withTestTitle(testInfo.title);
interceptor.withScenarioKey('<SCENARIO-KEY>'); // set after withPage
await interceptor.apply(); // scenario key is presentQ: Why aren't my requests being intercepted?
Q: How do I debug interceptor issues?
Q: Why do I get "page is not defined" errors in Playwright?
Q: How do I handle TypeScript errors?
Complete Examples
Q: What's a complete Playwright example with recording and mocking?
Q: What's a complete Cypress example with recording and mocking?
Quick Reference
Q: What are the key methods for the interceptor?
Q: What constants are available?
Last updated