Configuration
Configuring URL Patterns
Q: How do I specify which URLs to intercept?
const stoobly = new Stoobly();
// Exact URL match
const interceptor1 = stoobly.playwrightInterceptor({
urls: ['https://api.example.com/users'],
});
// Regex pattern (match all API endpoints)
const interceptor2 = stoobly.playwrightInterceptor({
urls: [new RegExp('https://api.example.com/.*')],
});
// Multiple URLs
const interceptor3 = stoobly.playwrightInterceptor({
urls: [
'https://api.example.com/users',
'https://api.example.com/products',
new RegExp('https://cdn.example.com/.*'),
],
});Q: How do I configure per-URL options like match rules or fixture paths?
Q: How do I change the intercepted URLs dynamically?
Request Matching
Q: What determines whether a request matches a recording during mocking?
Scenarios and Sessions
Q: How do I specify a scenario for my tests?
Q: How do I change the scenario dynamically?
Q: What is a session ID and how do I use it?
Recording Configuration
Q: What record policies are available?
Q: What's the difference between record orders?
Q: What record strategies are available?
Q: How do I change record settings dynamically?
Controlling Interception
Q: How do I manage the intercept mode (mock, record, replay) for tests?
Q: How do I stop recording requests?
Q: How do I completely remove the interceptor?
Q: What's the difference between disable() and switching modes with enable()?
Advanced Configuration
Q: How do I set a custom Stoobly UI URL?
Q: How do I use test titles for request grouping?
Q: Can I use the interceptor without a test framework?
Q: How do I read or update the Stoobly agent's configuration from my tests?
Constants Reference
Q: What other constants does stoobly/constants export besides RecordPolicy, RecordOrder, RecordStrategy, and InterceptMode?
Last updated