inject_latency
Adds artificial delay to matching browser requests, then observes whether the app shows loading indicators or skeleton screens and handles timeouts gracefully.
Instructions
Opens the browser, navigates directly to the user application, and adds artificial delay to requests matching a URL pattern. Observes whether loading indicators or skeleton screens appear. Use to answer: does the app show loading states when the API takes 3 seconds? Does it time out gracefully?
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the page to test | |
| headless | No | Whether to run in headless mode (default: false, launches real browser so user sees application) | |
| viewport | No | Viewport size (default: 1280×720) | |
| jitter_ms | No | Random additional delay in milliseconds (default: 0) | |
| latency_ms | No | Base delay in milliseconds to add to each matched request (default: 3000) | |
| loading_selector | No | CSS selector for the loading state that should appear (e.g., '.skeleton-loader') | |
| preview_delay_ms | No | Milliseconds to pause after simulation before closing browser, allowing visual inspection (default: 2000) | |
| intercept_pattern | Yes | Glob pattern for requests to delay (e.g., '**/api/**') | |
| keep_browser_open | No | Keep browser window open after test completes so user can interactively inspect the app (default: false) | |
| api_health_check_url | No | Optional backend or hosted API health check URL to verify before running chaos test. Aborts if backend is down or errors. |