Troubleshooting & Examples
Troubleshooting
Q: Why are my Playwright requests missing the scenario key?
// Recommended order in beforeEach (Playwright)
test.beforeEach(async ({ page }, testInfo) => {
interceptor.withScenarioKey('<SCENARIO-KEY>'); // can be before or after withPage
interceptor.withTestTitle(testInfo.title);
await interceptor.withPage(page).enable(); // enable after withPage
});Q: Why aren't my requests being intercepted?
// Check URL pattern
const interceptor = stoobly.playwrightInterceptor({
urls: [new RegExp('https://api.example.com/.*')], // Make sure pattern matches
scenarioKey: '<SCENARIO-KEY>',
});
test.beforeEach(async ({ page }, testInfo) => {
// Ensure interceptor is applied
await interceptor.withPage(page).enable();
interceptor.withTestTitle(testInfo.title);
});
// Verify stoobly-agent is running
// stoobly-agent run --headlessQ: 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