{"id":49323883,"url":"https://github.com/chaos-maker-dev/chaos-maker","last_synced_at":"2026-05-09T12:05:05.559Z","repository":{"id":320088661,"uuid":"1080764128","full_name":"chaos-maker-dev/chaos-maker","owner":"chaos-maker-dev","description":"A lightweight chaos engineering toolkit that simulates network failures in browser-based test frameworks to build resilient, failure-ready applications.","archived":false,"fork":false,"pushed_at":"2026-04-26T02:43:46.000Z","size":533,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T04:24:13.719Z","etag":null,"topics":["automation-tools","browser-testing","chaos-engineering","chaos-testing","cypress","fault-injection","network-simulation","playwright","puppeteer","qa-tools","resilience-engineering","test-automation","testing","ui-testing-framework","webdriverio"],"latest_commit_sha":null,"homepage":"https://chaos-maker-dev.github.io/chaos-maker/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaos-maker-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-21T20:45:11.000Z","updated_at":"2026-04-26T02:43:48.000Z","dependencies_parsed_at":"2025-10-21T22:27:23.337Z","dependency_job_id":"6e04aa5c-30b2-4c5e-8c27-16477214bb1f","html_url":"https://github.com/chaos-maker-dev/chaos-maker","commit_stats":null,"previous_names":["jvjithin/chaos-maker","chaos-maker-dev/chaos-maker"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/chaos-maker-dev/chaos-maker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaos-maker-dev%2Fchaos-maker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaos-maker-dev%2Fchaos-maker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaos-maker-dev%2Fchaos-maker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaos-maker-dev%2Fchaos-maker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaos-maker-dev","download_url":"https://codeload.github.com/chaos-maker-dev/chaos-maker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaos-maker-dev%2Fchaos-maker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32308879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation-tools","browser-testing","chaos-engineering","chaos-testing","cypress","fault-injection","network-simulation","playwright","puppeteer","qa-tools","resilience-engineering","test-automation","testing","ui-testing-framework","webdriverio"],"created_at":"2026-04-26T19:02:15.686Z","updated_at":"2026-05-09T12:05:05.553Z","avatar_url":"https://github.com/chaos-maker-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chaos Maker\n\n[![Build Status](https://github.com/chaos-maker-dev/chaos-maker/actions/workflows/ci.yml/badge.svg)](https://github.com/chaos-maker-dev/chaos-maker/actions)\n[![npm](https://img.shields.io/npm/v/@chaos-maker/core)](https://www.npmjs.com/package/@chaos-maker/core)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nInject controlled chaos into web applications to test frontend resilience. Works with Playwright, Cypress, WebdriverIO, and Puppeteer with no backend changes.\n\n## Install\n\n```bash\nnpm install @chaos-maker/core @chaos-maker/playwright\nnpm install @chaos-maker/core @chaos-maker/cypress\nnpm install @chaos-maker/core @chaos-maker/webdriverio\nnpm install @chaos-maker/core @chaos-maker/puppeteer\n```\n\n## 30-second Playwright quickstart\n\n```bash\nnpm install @chaos-maker/core @chaos-maker/playwright\n```\n\n```typescript\nimport { test, expect } from '@playwright/test';\nimport { injectChaos, getChaosLog } from '@chaos-maker/playwright';\n\ntest('shows error state when payment API fails', async ({ page }) =\u003e {\n  await injectChaos(page, {\n    seed: 42,\n    network: {\n      failures: [{ urlPattern: '/api/payments', statusCode: 503, probability: 1.0 }],\n    },\n  });\n\n  await page.goto('/checkout');\n  await page.click('#pay-now');\n  await expect(page.locator('[data-testid=\"error-banner\"]')).toBeVisible();\n\n  const log = await getChaosLog(page);\n  expect(log.some(e =\u003e e.type === 'network:failure' \u0026\u0026 e.applied)).toBe(true);\n});\n```\n\n## Adapter coverage\n\n| Surface | Playwright | Cypress | WebdriverIO | Puppeteer |\n| --- | --- | --- | --- | --- |\n| Network fetch/XHR | Yes | Yes | Yes | Yes |\n| UI assaults | Yes | Yes | Yes | Yes |\n| WebSocket | Yes | Yes | Yes | Yes |\n| Service Worker fetch | Yes | Yes | Yes | Yes |\n| Server-Sent Events | Yes | Yes | Yes | Yes |\n| GraphQL operation matcher | Yes | Yes | Yes | Yes |\n| Rule Groups | Yes | Yes | Yes | Yes |\n\n## Service Worker chaos\n\nPWAs and offline-first apps serve fetches from a Service Worker. Those bypass page-side chaos, so add one line to your SW and chaos applies there too:\n\n```js\n// classic sw.js\nimportScripts('/chaos-maker-sw.js');\n```\n\nPage-side: `injectSWChaos` / `removeSWChaos` / `getSWChaosLog` in each adapter. See adapter READMEs.\n\n## Rule Groups\n\nGroup related rules so a test can turn a whole failure scenario on or off at runtime without restarting chaos.\n\n### Creating Groups\n\n```ts\nimport { ChaosConfigBuilder } from '@chaos-maker/core';\n\nconst chaos = new ChaosConfigBuilder()\n  .inGroup(\"payments\")\n  .failRequests(\"/api/pay\", 503, 1)\n  .build();\n```\n\nRules without `.inGroup()` stay in the default group and continue to work as before.\n\n### Runtime Toggle\n\nThe examples below use `page` as a generic adapter handle. See each adapter README for exact syntax.\n\n```ts\nawait page.enableGroup(\"payments\");\nawait page.disableGroup(\"payments\");\n```\n\nBrowser-side toggles affect rules injected into the page with `injectChaos`.\n\n### Service Worker Toggle\n\n```ts\nawait page.enableSWGroup(\"payments\");\nawait page.disableSWGroup(\"payments\");\n```\n\nService Worker toggles affect rules injected into the active Service Worker with `injectSWChaos`. Browser-side and SW-side toggles are separate because they run in different JavaScript contexts. If a group has rules in both places, toggle both explicitly.\n\n### Multiple Groups Example\n\n```ts\nimport { ChaosConfigBuilder } from '@chaos-maker/core';\n\nconst chaos = new ChaosConfigBuilder()\n  .inGroup(\"payments\")\n  .failRequests(\"/api/pay\", 503, 1)\n  .inGroup(\"auth\")\n  .failRequests(\"/api/session\", 401, 1)\n  .inGroup(\"analytics\")\n  .addLatency(\"/api/events\", 750, 1)\n  .build();\n\nawait injectChaos(page, chaos);\n\nawait page.disableGroup(\"payments\");\nawait page.enableGroup(\"auth\");\nawait page.enableGroup(\"analytics\");\n```\n\nIn this state, payment failures are skipped, auth failures run, and analytics latency runs.\n\n### Troubleshooting\n\n- Group not working: confirm the rule was created with `.inGroup(\"name\")` or `group: \"name\"`, and confirm you awaited the toggle before triggering the request.\n- Group name errors: group names must be strings after trimming. Empty strings, whitespace-only strings, and `null` throw.\n- SW toggling issues: call `injectSWChaos` after the page has an active Service Worker controller, and use `enableSWGroup` or `disableSWGroup` for SW rules. Page-side `enableGroup` does not toggle SW rules.\n\n## SSE and GraphQL\n\n```typescript\nawait injectChaos(page, {\n  sse: {\n    drops: [{ urlPattern: '/events', eventType: 'token', probability: 0.1 }],\n  },\n  network: {\n    failures: [{\n      urlPattern: '/graphql',\n      graphqlOperation: 'GetUser',\n      statusCode: 503,\n      probability: 1,\n    }],\n  },\n});\n```\n\n## Full docs\n\n[Getting started](https://chaos-maker-dev.github.io/chaos-maker/getting-started/install) | [Concepts](https://chaos-maker-dev.github.io/chaos-maker/concepts/chaos-types) | [Recipes](https://chaos-maker-dev.github.io/chaos-maker/recipes/slow-checkout) | [API](https://chaos-maker-dev.github.io/chaos-maker/api/core)\n\n## Development\n\n```bash\npnpm install        # install all workspace dependencies\npnpm build          # build all packages\npnpm test           # unit tests\npnpm lint           # eslint\npnpm dev:docs                 # local docs dev server\npnpm build:docs               # build docs for production\n```\n\n## Contributing\n\nPull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nRun the full check before submitting:\n\n```bash\npnpm lint \u0026\u0026 pnpm test \u0026\u0026 pnpm build\npnpm --filter e2e-tests-playwright exec playwright test --reporter=line --project=chromium\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaos-maker-dev%2Fchaos-maker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaos-maker-dev%2Fchaos-maker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaos-maker-dev%2Fchaos-maker/lists"}