simulate_stateful_failure
Simulate transient failures by failing initial requests, then allow success, to test retry and recovery logic.
Instructions
Intercepts requests matching a URL pattern and fails the first N requests with an error status, then lets subsequent requests succeed. Simulates transient failures and tests retry/recovery logic. Use to answer: does the app retry after a 503 and recover when the service comes back?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the page to test | |
| wait_ms | No | Milliseconds to wait after navigation before checking state (default: 2000) | |
| viewport | No | Viewport size (default: 1280×720) | |
| http_status | No | HTTP error status code for the failing requests (default: 503) | |
| failure_count | No | Number of requests to fail before allowing success (default: 3) | |
| success_payload | No | Response body for requests after the failure window (default: {"ok":true}) | {"ok":true} |
| fallback_selector | No | CSS selector for the fallback/retry UI that should appear (e.g., '.retry-button') | |
| intercept_pattern | Yes | Glob pattern for requests to intercept (e.g., '**/api/data**') |