Skip to main content
Many production incidents come from third-party dependencies, not your own code. Playwright can simulate these failures so you verify graceful behavior before users see an outage.

Failure Modes to Simulate

  • Timeout from external API
  • 5xx response from provider
  • 429 rate limit
  • Invalid payload shape
  • Partial success (one request succeeds, next fails)

Route Stubbing Pattern

Use page.route to intercept provider requests and force failure conditions.
tests/resilience/maps-provider.spec.ts

Timeout Example

Assertions That Matter

  • User sees actionable message, not generic failure.
  • Retry works and does not duplicate side effects.
  • App remains responsive while waiting.
  • Error is logged with enough metadata for support/debugging.

Stably Features to Use for Resilience Monitoring

  • Run resilience suites on Stably Cloud with high parallelism to cover multiple providers quickly.
  • Add Scheduled Test Runs for recurring synthetic outage drills.
  • Configure Alerts & Notifications so third-party regressions are surfaced before customers report them.
  • Use run artifacts in Test Results to inspect traces, screenshots, and failure context when fallback behavior breaks.