{"_id":"cypress-test-data-generator","_rev":"33-76bff6eb944533b8a8c3d9a26e34e2a0","name":"cypress-test-data-generator","dist-tags":{"latest":"2.1.1"},"versions":{"1.0.0":{"name":"cypress-test-data-generator","version":"1.0.0","keywords":["cypress","testing","data-generator","faker"],"author":"","license":"ISC","_id":"cypress-test-data-generator@1.0.0","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"dist":{"shasum":"9bb05566c444c7a180e90ba2899573748157bd7b","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-1.0.0.tgz","fileCount":5,"integrity":"sha512-8DfsUUqY+9hdnRoVHSzDU9MZfKZw/rH1L5MnFwB814R/rgCJkda8zvjnP3Db+OQqiBvQ/A7af/A6CfSPXzFq0w==","signatures":[{"sig":"MEYCIQCBSshHJXqzQUv4tSJXiYMM6aQOi5dj1SGgcXqEBp/d9AIhAPNVKkAyIol1dAxbzwLlZ1RRulCpq94ojcPIgPMw7zbR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17057},"main":"src/index.js","gitHead":"a30200dc63f7b166323355d8fe80592931f91608","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"_npmVersion":"10.8.2","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@faker-js/faker":"^9.0.3"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^13.14.2"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_1.0.0_1727401482324_0.4624474387820616","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"cypress-test-data-generator","version":"1.0.1","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@1.0.1","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"c50729782dc4b86d107d71cb687c65daf0d54f73","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-1.0.1.tgz","fileCount":6,"integrity":"sha512-YkuRakEYpyQsepVcMH3s2MgUgeSdflM2RI/4KiVBG0MsCd/kqRUU57dzAVqPopdJzyl8FOKK3koX8X60FNzsBA==","signatures":[{"sig":"MEUCIQCfzMDCeiUHI6/9EXYdTXXYGgfOdBmCuD1oLXGwtKoLWwIgI1C0/t1WsyZZe+pLCW1tiMMlwPMMtXOVuxUHeqTElb4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18872},"main":"src/index.js","gitHead":"365e8839a187c75c5967deb3bfa75098a16cb556","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"10.8.2","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@faker-js/faker":"^9.0.3"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^13.14.2"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_1.0.1_1727616044921_0.6212735578227773","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"cypress-test-data-generator","version":"1.0.2","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@1.0.2","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"adc5a53d6ebd3034b3b6e977353d730c98b04253","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-1.0.2.tgz","fileCount":5,"integrity":"sha512-knt8dyO3a/xKBXjhUy2LFLbxEjJnSRwNrzxIynXzYKWN+cgZZH5aDnph2x0E6MYbvRwzaC+a6dZJFlTL0Oqt0w==","signatures":[{"sig":"MEYCIQDhwKUcIyV1ILyvo2V7flGcv2JrbZXnsKKt1hiHFPo5hwIhAMGtNkVrsTxYMabY0MfxyK3mm9kgtlIqxlOh7Tjh7Hgr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18257},"main":"src/index.js","gitHead":"2833e1356bf446a8190a924f499592fbc0128083","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"10.8.2","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@faker-js/faker":"^9.0.3"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^13.14.2"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_1.0.2_1727617117176_0.4260978102526556","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"cypress-test-data-generator","version":"1.1.1","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@1.1.1","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"8b1ec621a0c22231c473883a04c3884566fdea40","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-1.1.1.tgz","fileCount":6,"integrity":"sha512-POXQIpfDkI/9lGo0+z2Z7kY1DaEPy4KAfoX0ntZyNxpefjgoLxLUQws0RtnwDhel1SQn4iUvxSQ5+8MWzXX+PA==","signatures":[{"sig":"MEUCIQCgUg4bUh8q/1TY1N10xWFGAiM511XhcMqF8s/9+g4guQIgCwka7zzn5aMgf30hiIMgYwIiac0BxbABWkwW4qK+7V4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32261},"main":"src/index.js","gitHead":"767499754a7ef1f559fd05dbdd92e2d979dd6925","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"10.8.2","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.8.0","dependencies":{"@faker-js/faker":"^9.0.3"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^13.14.2"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_1.1.1_1729296410222_0.9135833886038729","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"cypress-test-data-generator","version":"2.0.0","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@2.0.0","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"d24c251861afe11cfd975206e4a1873f09e3c227","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-2.0.0.tgz","fileCount":20,"integrity":"sha512-CGvWQOlNMtx84YufTTKwhOTiSbDyE0xUZCDgJ2LvQkpedd6KPbNnQn+Xk1lOrpIoBOiKOzgpY+U3YGxQha2f8A==","signatures":[{"sig":"MEYCIQDWxEEeDn5YGRVZ04wLN9svpoox/xaCkDZJof3ulF9ICAIhAPKk9s4rShl0GiRhwK4pYf/sjVTxWLAPExh8V8i23Fyg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":99614},"main":"src/index.js","gitHead":"12ad3e089435e1fb54bc5128fc92b38700d51615","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"11.7.0","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@faker-js/faker":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^15.8.1"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_2.0.0_1767564554085_0.771188428622017","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"cypress-test-data-generator","version":"2.0.1","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@2.0.1","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"bac4d4fecdccf8126d1defa47955bd3bfa8ffab7","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-2.0.1.tgz","fileCount":20,"integrity":"sha512-pVReHuHgXOEhbco5UY/y+uyl2gGP60Kejx7jxFQMHJirLQqPb2kuOXs2v84oomFHo9QlE593l+hQ1RaN9w84zQ==","signatures":[{"sig":"MEYCIQDt5rUjZ6oEtDclnBwHHpOgt2l9bW3l/9TIvVKtWxnXrQIhALYoIfnCycoLM34WSDqaUIHPBGwPJOiOPb0ChlZK9gLu","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102875},"main":"src/index.js","gitHead":"683c94dea4c0bf9212c406d429243454c73b14bd","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"11.7.0","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@faker-js/faker":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^15.8.1"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_2.0.1_1767565805633_0.6201757139522486","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"cypress-test-data-generator","version":"2.0.2","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@2.0.2","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"dist":{"shasum":"8f861f00514046f7c56a246b91374d33d57795bb","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-2.0.2.tgz","fileCount":20,"integrity":"sha512-pux+cyq5aRISeV3OVBdf2aVqyv/WM0mTnhgj32Ww6MTe/b2bICE/OUKuebpM0fDaomP01W5efYqSy2CzxwVLfg==","signatures":[{"sig":"MEUCIQCuUDJZfeh2iXUccBS2ihU1Pk39fgPcltxbzd10dK8AKwIgfmBZNMBpnVkOWza/2Ej4tV9zKncIywAUAm7lkw77UlY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103023},"main":"src/index.js","gitHead":"a5137221e17f91cecfaa1e239345d813ce444d20","scripts":{"test":"cypress run","test:e2e":"cypress run"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"11.7.0","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@faker-js/faker":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"cypress":"^15.8.1"},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_2.0.2_1767566150961_0.8255117538108205","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"cypress-test-data-generator","version":"2.1.0","keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","_id":"cypress-test-data-generator@2.1.0","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"bin":{"ctdg":"bin/ctdg.js"},"dist":{"shasum":"663c7068e59f592c65c2837ea791d53db181e285","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-2.1.0.tgz","fileCount":44,"integrity":"sha512-Ng6w9SE0Cf+Unn6lvOS7u4zyfXzcIphreqPeX9kml0XTx2GUX52/KOfLFW1f4DxITfprFr1WQMFTmA6VgU5Opw==","signatures":[{"sig":"MEYCIQCJpzvoPRFwWeMzBpp/3MI5PoNRqYph16YMR5XJWoBKBQIhAKjQEgU5/yDEkGOw694mVpw1Y7FEM1A3EQSZXuqYO+Y3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":236113},"main":"src/index.js","types":"./src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./src/*":"./src/*","./schemas":{"types":"./src/schemas/index.d.ts","default":"./src/schemas/index.js"},"./commands":{"types":"./src/commands.d.ts","default":"./src/commands.js"},"./package.json":"./package.json"},"gitHead":"6f7b2a26c8e8e28747ae3ca097b10238f4664883","scripts":{"test":"cypress run","bench":"node scripts/benchmark.js","test:e2e":"cypress run","cli:smoke":"node scripts/cli-smoke.js","types:check":"tsc -p tsconfig.json","release:local":"node scripts/release-local.js","schemas:check":"node scripts/parity-check.js"},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"repository":{"url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git","type":"git"},"_npmVersion":"10.9.4","description":"Cypress plugin for generating test data using Faker","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@faker-js/faker":"^10.2.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.6","cypress":"^15.14.0","typescript":"^6.0.3"},"peerDependencies":{"zod":"^4.3.6"},"peerDependenciesMeta":{"zod":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/cypress-test-data-generator_2.1.0_1776863112937_0.17387906278784881","host":"s3://npm-registry-packages-npm-production"}},"2.1.1":{"name":"cypress-test-data-generator","version":"2.1.1","description":"Cypress plugin for generating test data using Faker","main":"src/index.js","types":"./src/index.d.ts","bin":{"ctdg":"bin/ctdg.js"},"exports":{".":{"types":"./src/index.d.ts","default":"./src/index.js"},"./schemas":{"types":"./src/schemas/index.d.ts","default":"./src/schemas/index.js"},"./commands":{"types":"./src/commands.d.ts","default":"./src/commands.js"},"./package.json":"./package.json","./src/*":"./src/*"},"repository":{"type":"git","url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git"},"bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"scripts":{"test":"cypress run","test:e2e":"cypress run","bench":"node scripts/benchmark.js","types:check":"tsc -p tsconfig.json","schemas:check":"node scripts/parity-check.js","cli:smoke":"node scripts/cli-smoke.js","release:local":"node scripts/release-local.js"},"keywords":["cypress","testing","data-generator","faker"],"author":{"name":"Ahmad Waqar"},"license":"MIT","dependencies":{"@faker-js/faker":"^10.2.0"},"peerDependencies":{"zod":"^4.3.6"},"peerDependenciesMeta":{"zod":{"optional":true}},"devDependencies":{"cypress":"^15.14.0","typescript":"^6.0.3","zod":"^4.3.6"},"_id":"cypress-test-data-generator@2.1.1","gitHead":"69d2af8ee9daa8aef7a44b3f533b8bb5b5415044","homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-nFKUp1SnuCfdSzc/Dp1DkiLtjBEXYbj2fFB0+dVZPoPqqe03Yqg7Syjb/Jijkd4s0GId8jbScgGTEBZkPC+D5g==","shasum":"5009aac1208f2b1c5e23fea18b0ef7f95c4dc622","tarball":"https://registry.npmjs.org/cypress-test-data-generator/-/cypress-test-data-generator-2.1.1.tgz","fileCount":44,"unpackedSize":236258,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4SBoJqd+PvfM+pu+7O/xawuQ0hYG8E4jR9Mdw3lOEJAIgOwg6BKErhWBikIs8RVrHIJwsY7LIOGKCw1hm1b5+tV8="}]},"_npmUser":{"name":"ahmadw","email":"khawjaahmad@gmail.com"},"directories":{},"maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cypress-test-data-generator_2.1.1_1776863368113_0.1721119138925813"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-27T01:44:42.324Z","modified":"2026-04-22T13:09:28.373Z","1.0.0":"2024-09-27T01:44:42.510Z","1.0.1":"2024-09-29T13:20:45.128Z","1.0.2":"2024-09-29T13:38:37.347Z","1.1.0":"2024-10-18T23:46:21.483Z","1.1.1":"2024-10-19T00:06:50.409Z","2.0.0":"2026-01-04T22:09:14.220Z","2.0.1":"2026-01-04T22:30:05.813Z","2.0.2":"2026-01-04T22:35:51.118Z","2.1.0":"2026-04-22T13:05:13.096Z","2.1.1":"2026-04-22T13:09:28.281Z"},"bugs":{"url":"https://github.com/khawjaahmad/cypress-test-data-generator/issues"},"author":{"name":"Ahmad Waqar"},"license":"MIT","homepage":"https://github.com/khawjaahmad/cypress-test-data-generator#readme","keywords":["cypress","testing","data-generator","faker"],"repository":{"type":"git","url":"git+https://github.com/khawjaahmad/cypress-test-data-generator.git"},"description":"Cypress plugin for generating test data using Faker","maintainers":[{"name":"ahmadw","email":"khawjaahmad@gmail.com"}],"readme":"<div align=\"center\">\n\n# Cypress Test Data Generator\n\n**Generate realistic, reproducible test data for Cypress tests**\n\n[![npm version](https://img.shields.io/npm/v/cypress-test-data-generator.svg?style=flat-square)](https://www.npmjs.com/package/cypress-test-data-generator)\n[![npm downloads](https://img.shields.io/npm/dm/cypress-test-data-generator.svg?style=flat-square)](https://www.npmjs.com/package/cypress-test-data-generator)\n[![license](https://img.shields.io/npm/l/cypress-test-data-generator.svg?style=flat-square)](https://github.com/khawjaahmad/cypress-test-data-generator/blob/main/LICENSE)\n\n[Installation](#installation) •\n[Quick Start](#quick-start) •\n[Scenarios](#relational-scenarios--cyscenario) •\n[Mocking](#api-mocking--cymockapi) •\n[CLI](#outside-cypress--the-ctdg-cli) •\n[Schemas](#runtime-schemas) •\n[Generators](#available-generators)\n\n</div>\n\n---\n\n## Why This Plugin?\n\nWriting realistic test data by hand is tedious and error-prone. This plugin provides **40+ data generators** powered by [Faker.js](https://fakerjs.dev/) plus the Cypress-native wiring to use them without boilerplate.\n\n```javascript\n// Before: manual test data\nconst user = { name: 'Test User', email: 'test@test.com', age: 25 };\n\n// After: rich, realistic, reproducible\ncy.generateUser({ seed: 42 }).then((user) => {\n  // { id, firstName, lastName, email, age, address: { street, city, state, zipCode, country } }\n});\n```\n\n### Key Features\n\n- **40+ Generators** — Users, products, orders, invoices, social profiles, and more\n- **Relational scenarios** — `cy.scenario({ users, ordersPerUser, productsPerOrder })` returns linked entities with guaranteed foreign keys (no manual ID wiring)\n- **One-line API mocking** — `cy.mockApi('/api/users', { generator: 'generateUser', count: 20, paginated: true })` replaces ~15 lines of `cy.intercept` boilerplate\n- **Native Cypress commands** — `cy.generateUser()`, `cy.scenario()`, `cy.mockApi()`, and 40+ more, chainable and aliasable\n- **`ctdg` CLI** — generate fixtures outside Cypress (`npx ctdg generateUser --count 1000 --seed 42 -o users.json`)\n- **Runtime Zod schemas** — validate real API responses against the exact shape the generator produces\n- **Reproducible Data** — seed support, with hermetic per-call Faker instances that never leak state between calls\n- **Internationalization** — 10 built-in locales (en, de, fr, es, it, pt_BR, ja, zh_CN, ko, ru) with automatic fallback to `en` for unknown codes\n- **Fully typed** — TypeScript definitions shipped for every generator, option, and return shape\n\n---\n\n## Installation\n\n```bash\nnpm install --save-dev cypress-test-data-generator\n\n# Optional: install zod only if you plan to use the schemas subpath\nnpm install --save-dev zod\n```\n\n## Setup\n\n**1.** Register the tasks in `cypress.config.js`:\n\n```javascript\nconst { defineConfig } = require('cypress');\nconst dataGenerator = require('cypress-test-data-generator');\n\nmodule.exports = defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      dataGenerator.registerTasks(on, config);\n      return config;\n    },\n  },\n});\n```\n\n**2.** Load the native Cypress commands in `cypress/support/e2e.js`:\n\n```javascript\nimport 'cypress-test-data-generator/commands';\n```\n\nThat's it. You now have `cy.generateUser()`, `cy.scenario()`, `cy.mockApi()`, and 40+ other chainable commands available in every spec.\n\n---\n\n## Quick Start\n\n```javascript\n// Native Cypress commands — chainable, aliasable, fully typed\ncy.generateUser({ seed: 12345, locale: 'de' }).as('user');\ncy.get('@user').then((user) => {\n  cy.visit('/register');\n  cy.get('#email').type(user.email);\n});\n\n// Relational data — one call, full FK integrity\ncy.scenario({ users: 3, ordersPerUser: 2, productsPerOrder: 4 }).then((s) => {\n  // s.orders[0].userId === s.users[i].id for some i\n  // s.orders[0].products are real entries from s.products\n  // s.orders[0].shippingAddress === the user's address\n});\n\n// Kill cy.intercept boilerplate — one line mocks an endpoint with generated data\ncy.mockApi('/api/users', {\n  generator: 'generateUser',\n  count: 20,\n  paginated: true,   // wraps in { data, meta } envelope\n  seed: 42,\n}).as('users');\ncy.visit('/users');\ncy.wait('@users');\n\n// Raw cy.task still works if you prefer\ncy.task('generateProduct', { seed: 1 });\n```\n\n---\n\n## Relational Scenarios — `cy.scenario()`\n\nInstead of manually wiring IDs between `generateUser`/`generateOrder`/`generateReview` calls, generate a linked bundle in one shot:\n\n```javascript\ncy.scenario({\n  users: 3,              // 3 users\n  ordersPerUser: 2,      // 6 orders total, each tied to a user\n  productsPerOrder: 4,   // each order contains 4 products from a shared catalog\n  reviewsPerProduct: 1,  // each product gets 1 review by a random user\n  seed: 42,              // reproducible\n}).then(({ users, products, orders, reviews }) => {\n  // Foreign keys are guaranteed:\n  //   order.userId       → real users[i].id\n  //   order.shippingAddress → users[i].address\n  //   order.products[]   → entries from the shared `products` catalog\n  //   review.productId   → real products[i].id\n  //   review.userId      → real users[i].id\n});\n```\n\n---\n\n## API Mocking — `cy.mockApi()`\n\nOne line replaces ~15 lines of `cy.intercept` + fixture + pagination boilerplate.\n\n```javascript\n// Basic list endpoint\ncy.mockApi('/api/users', { generator: 'generateUser', count: 20 });\n\n// Paginated\ncy.mockApi('/api/products', {\n  generator: 'generateProduct',\n  count: 10,\n  paginated: true,\n  page: 1,\n  pageSize: 10,\n  total: 247,\n});\n// → { data: [...10 products], meta: { page, pageSize, total, totalPages } }\n\n// Error case\ncy.mockApi('/api/users/999', { status: 404, body: { error: 'not found' } });\n\n// Relational bundle\ncy.mockApi('/api/bootstrap', { scenario: { users: 3, ordersPerUser: 2 } });\n\n// Transform before serving\ncy.mockApi('/api/suggestions', {\n  generator: 'generateProduct',\n  count: 50,\n  transform: (items) => items.slice(0, 3).map((p) => p.name),\n});\n```\n\nAll options: `method`, `generator`, `count`, `seed`, `locale`, `paginated`, `page`, `pageSize`, `total`, `status`, `headers`, `delay`, `body`, `scenario`, `transform`.\n\n---\n\n## Outside Cypress — the `ctdg` CLI\n\nThe plugin ships a `ctdg` binary so you can generate deterministic test data outside Cypress — for Jest, Playwright, Storybook, local dev seeding, CI bootstrap scripts, or anywhere you need realistic fixtures.\n\n```bash\n# A single user\nnpx ctdg generateUser --seed 42 --pretty\n\n# 1000 products as an array, written to a file\nnpx ctdg generateProduct --count 1000 --seed 1 -o fixtures/products.json\n\n# Newline-delimited JSON — great for piping into tools\nnpx ctdg generateUser --count 500 --format jsonl > users.jsonl\n\n# Relational bundle\nnpx ctdg generateScenario \\\n  --users 3 --ordersPerUser 2 --productsPerOrder 4 --reviewsPerProduct 1 \\\n  --seed 42 -o fixtures/scenario.json\n\n# Localized\nnpx ctdg generateUser --locale de --count 10\n\n# Discover what's available\nnpx ctdg --list\nnpx ctdg --help\n```\n\nUse it in a package.json script to bake fixtures as part of your build:\n\n```json\n{\n  \"scripts\": {\n    \"fixtures:generate\": \"ctdg generateScenario --users 50 --ordersPerUser 5 --seed 1 -o src/__fixtures__/scenario.json\"\n  }\n}\n```\n\n---\n\n## Available Generators\n\n<details>\n<summary><strong>User & Profile</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateUser` | Complete user profile with address and preferences |\n| `generateAddress` | Standalone address with coordinates |\n\n</details>\n\n<details>\n<summary><strong>E-commerce</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateProduct` | Product with SKU, pricing, stock status |\n| `generateProductWithRelations` | Product with related products |\n| `generateOrder` | Order with products and shipping |\n| `generateReview` | Product review with rating |\n| `generateCategory` | Category with hierarchy support |\n| `generateCart` | Shopping cart with items |\n| `generateWishlist` | User wishlist |\n| `generateReturn` | Return/refund request |\n| `generateInventory` | Product inventory |\n| `generateCoupon` | Discount coupon |\n| `generateShippingMethod` | Shipping option |\n| `generatePaymentMethod` | Payment method |\n\n</details>\n\n<details>\n<summary><strong>Social & Communication</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateSocialProfile` | Social media profile (Twitter, Instagram, etc.) |\n| `generateComment` | Comment with replies support |\n| `generateNotification` | App notification |\n| `generateMessage` | Chat/direct message |\n\n</details>\n\n<details>\n<summary><strong>Business & Enterprise</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateCompany` | Company with industry and revenue |\n| `generateInvoice` | Invoice with line items |\n| `generateEmployee` | Employee with department and salary |\n| `generateProject` | Project with team and milestones |\n| `generateTicket` | Support ticket |\n| `generateMeeting` | Meeting with attendees |\n| `generateJobListing` | Job posting |\n\n</details>\n\n<details>\n<summary><strong>Finance</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateBankAccount` | Bank account with balance |\n| `generateLoan` | Loan with terms and payments |\n| `generateInsurancePolicy` | Insurance policy |\n| `generateCreditCard` | Credit card details |\n| `generateTransaction` | Financial transaction |\n| `generateSubscription` | Subscription plan |\n\n</details>\n\n<details>\n<summary><strong>Content & Media</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateBlogPost` | Blog post with SEO metadata |\n| `generateEvent` | Event with tickets and speakers |\n\n</details>\n\n<details>\n<summary><strong>Travel & Automotive</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateTravelItinerary` | Travel plan with flights and hotels |\n| `generateVehicle` | Vehicle with specifications |\n\n</details>\n\n<details>\n<summary><strong>Real Estate</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateProperty` | Property listing with agent info |\n\n</details>\n\n<details>\n<summary><strong>Food & Restaurant</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateRestaurant` | Restaurant with hours and features |\n| `generateMenuItem` | Menu item with nutrition info |\n| `generateFoodOrder` | Food delivery order |\n\n</details>\n\n<details>\n<summary><strong>Technical & API</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateApiResponse` | API response with pagination |\n| `generateLogEntry` | Application log entry |\n\n</details>\n\n<details>\n<summary><strong>Healthcare & Education</strong></summary>\n\n| Generator | Description |\n|-----------|-------------|\n| `generateMedicalRecord` | Medical record |\n| `generateEducation` | Education record |\n\n</details>\n\n---\n\n## Usage Examples\n\n### E-commerce Testing\n\n```javascript\ndescribe('Shopping Flow', () => {\n  it('completes checkout with generated data', () => {\n    cy.task('generateProduct').then((product) => {\n      cy.task('generateCart', { itemCount: 3 }).then((cart) => {\n        cy.task('generateUser').then((user) => {\n          // Use generated data in your test\n          expect(cart.items).to.have.length(3);\n          expect(cart.total).to.be.greaterThan(0);\n        });\n      });\n    });\n  });\n\n  it('displays order history', () => {\n    cy.task('generateOrder', { productCount: 5 }).then((order) => {\n      expect(order.products).to.have.length(5);\n      const sum = order.products.reduce((acc, p) => acc + p.price, 0);\n      // totalAmount is rounded to 2 decimals, so compare with tolerance.\n      expect(order.totalAmount).to.be.closeTo(sum, 0.01);\n    });\n  });\n});\n```\n\n### Business Application Testing\n\n```javascript\ndescribe('Invoice Management', () => {\n  it('creates invoice with line items', () => {\n    cy.task('generateInvoice', { itemCount: 5 }).then((invoice) => {\n      expect(invoice.invoiceNumber).to.match(/^INV-\\d{6}$/);\n      expect(invoice.items).to.have.length(5);\n      expect(invoice.total).to.be.greaterThan(invoice.subtotal); // Includes tax\n    });\n  });\n});\n\ndescribe('Employee Directory', () => {\n  it('filters by department', () => {\n    cy.task('generateEmployee', { department: 'Engineering' }).then((emp) => {\n      expect(emp.department).to.equal('Engineering');\n      expect(emp.employeeId).to.match(/^EMP-\\d{6}$/);\n    });\n  });\n});\n```\n\n### Social Features Testing\n\n```javascript\ndescribe('Social Feed', () => {\n  it('displays user notifications', () => {\n    cy.task('generateNotification', { type: 'payment' }).then((notif) => {\n      expect(notif.type).to.equal('payment');\n      expect(notif.priority).to.be.oneOf(['low', 'medium', 'high', 'urgent']);\n    });\n  });\n\n  it('shows social profile', () => {\n    cy.task('generateSocialProfile', { platform: 'instagram' }).then((profile) => {\n      expect(profile.platform).to.equal('instagram');\n      expect(profile.followers).to.be.a('number');\n      expect(profile.isVerified).to.be.a('boolean');\n    });\n  });\n});\n```\n\n---\n\n## Common Options\n\nAll generators accept these common options:\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `seed` | `number \\| string` | Seed for reproducible data generation |\n| `locale` | `string` | Locale code — `en`, `de`, `fr`, `es`, `it`, `pt_BR`, `ja`, `zh_CN`, `ko`, or `ru`. Unknown codes fall back to `en`. |\n| `strict` | `boolean` | *(generateUser only)* Throw on invalid input instead of returning `{ error }`. Will become the default in v3. |\n\n### Reproducible Tests with Seeds\n\n```javascript\nconst seed = 12345;\n\n// These will always generate identical data\ncy.task('generateUser', { seed }).then((user1) => {\n  cy.task('generateUser', { seed }).then((user2) => {\n    expect(user1.email).to.equal(user2.email);\n    expect(user1.firstName).to.equal(user2.firstName);\n  });\n});\n```\n\n### Localized Data\n\n```javascript\n// German names and addresses\ncy.task('generateUser', { locale: 'de' }).then((user) => {\n  // User with German-style data\n});\n\n// French company\ncy.task('generateCompany', { locale: 'fr' }).then((company) => {\n  // Company with French-style data\n});\n```\n\n---\n\n## Runtime Schemas\n\nEvery generator ships a matching [Zod](https://zod.dev) schema at the `cypress-test-data-generator/schemas` subpath. Validate real API responses against the exact shape the generator produces — one source of truth for tests and contracts:\n\n```javascript\nimport {\n  UserSchema,\n  ProductSchema,\n  OrderSchema,\n} from 'cypress-test-data-generator/schemas';\n\ndescribe('Checkout API', () => {\n  it('backend returns the same User shape the generator produces', () => {\n    cy.request('/api/users/123').then(({ body }) => {\n      const result = UserSchema.safeParse(body);\n      expect(result.success, JSON.stringify(result.error)).to.be.true;\n    });\n  });\n});\n```\n\nSchemas are also usable for asserting generator output directly:\n\n```javascript\ncy.task('generateOrder', { productCount: 3 }).then((order) => {\n  expect(OrderSchema.safeParse(order).success).to.be.true;\n});\n```\n\n> `zod` is an **optional peer dependency** — only install it if you import the schemas subpath. Install with `npm install --save-dev zod`.\n\n---\n\n## Error Handling\n\nBy default, `generateUser` returns an `{ error: string }` object on invalid input so tests can continue:\n\n```javascript\ncy.task('generateUser', { ageMin: 50, ageMax: 30 }).then((result) => {\n  // Returns: { error: 'Max 30 should be greater than min 50' }\n});\n```\n\n### Strict mode (recommended)\n\nPass `strict: true` to make invalid input throw. Test runners surface this as a clear failure instead of silently passing malformed data downstream:\n\n```javascript\ncy.task('generateUser', { strict: true, ageMin: 50, ageMax: 30 });\n// → task rejects, test fails with 'Max 30 should be greater than min 50'\n```\n\n> **Deprecation notice.** The default `{ error }` return shape will be removed in **v3** — `strict: true` will become the default. Adopt `strict` in new code to avoid a future breaking change.\n\nAll other generators already throw on invalid input (e.g. `generateOrder({ productCount: 0 })`).\n\n---\n\n## Requirements\n\n| Dependency | Version | Notes |\n|------------|---------|-------|\n| Cypress | 13.0.0+ | Required |\n| Node.js | 18+ | Required |\n| zod | 3.23.0+ | Optional peer — only if you use `cypress-test-data-generator/schemas` |\n\n---\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a [Pull Request](https://github.com/khawjaahmad/cypress-test-data-generator/pulls).\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n---\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n<div align=\"center\">\n\nMade by [Ahmad Waqar](https://github.com/khawjaahmad)\n\n</div>\n","readmeFilename":"README.md"}