{"id":13602437,"url":"https://github.com/nightwatchjs/nightwatch-chrome-recorder","last_synced_at":"2025-06-17T03:37:43.366Z","repository":{"id":54345801,"uuid":"521926597","full_name":"nightwatchjs/nightwatch-chrome-recorder","owner":"nightwatchjs","description":"Generate Nightwatch Tests from Google Chrome DevTools Recorder","archived":false,"fork":false,"pushed_at":"2023-09-21T21:19:07.000Z","size":2223,"stargazers_count":29,"open_issues_count":6,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-16T19:27:29.300Z","etag":null,"topics":["automation","e2e","nightwatch","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nightwatchjs.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-08-06T11:22:17.000Z","updated_at":"2025-06-15T02:47:20.000Z","dependencies_parsed_at":"2023-02-10T13:46:43.358Z","dependency_job_id":"41a3ba2d-570e-4a6d-9e70-19796e46458d","html_url":"https://github.com/nightwatchjs/nightwatch-chrome-recorder","commit_stats":{"total_commits":37,"total_committers":2,"mean_commits":18.5,"dds":0.08108108108108103,"last_synced_commit":"144dcf42208aa8704f5b14cbab5c89ecf254c967"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/nightwatchjs/nightwatch-chrome-recorder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-chrome-recorder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-chrome-recorder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-chrome-recorder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-chrome-recorder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nightwatchjs","download_url":"https://codeload.github.com/nightwatchjs/nightwatch-chrome-recorder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-chrome-recorder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260286543,"owners_count":22986607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","e2e","nightwatch","testing"],"created_at":"2024-08-01T18:01:23.239Z","updated_at":"2025-06-17T03:37:43.323Z","avatar_url":"https://github.com/nightwatchjs.png","language":"TypeScript","funding_links":[],"categories":["automation"],"sub_categories":[],"readme":"# Nightwatch Chrome Recorder\n\n[![Build](https://github.com/vaibhavsingh97/nightwatch-chrome-recorder/actions/workflows/build.yml/badge.svg)](https://github.com/vaibhavsingh97/nightwatch-chrome-recorder/actions/workflows/build.yml)\n[![npm][npm-badge]][npm]\n[![Discord][discord-badge]][discord]\n\nThis repo provide tools to convert JSON user flows from [Google Chrome DevTools Recorder](https://goo.gle/devtools-recorder) to Nightwatch test scripts programmatically.\n\n✅ Converts multiple recordings to Nightwatch tests in one go (out-of-the-box glob support)  \n🗂 User can pass their custom path to export tests.  \n💃 Users can also use a dry run to see the interim output of the recordings  \n👨‍💻 Programmatic API which users can use in their own project to create plugins or custom scripts.\n\nAlternatively, you can export JSON user flows as Nightwatch test scripts straight away from Chrome DevTools with our [Nightwatch Recorder Chrome extension](https://chrome.google.com/webstore/detail/nightwatch-chrome-recorde/nhbccjfogdgkahamfohokdhcnemjafjk/).\n\nSee [Create Nightwatch test using Google Chrome DevTools Recorder](https://nightwatchjs.org/guide/writing-tests/chrome-devtools-recorder.html) to learn more.\n\n## 📹 Demo\n\n![Nightwatch Chrome Recorder Demo](.github/assets/demo.gif)\n\n## 🏗 Installation\n\n```sh\nnpm install -g @nightwatch/chrome-recorder\n```\n\n## 🚀 Usage\n\nTo quickly run the interactive CLI, run:\n\n```sh\nnpx @nightwatch/chrome-recorder\n```\n\n\u003e The CLI will prompt you to enter the path of directory or file of the chrome devtool recordings that you will modify and path to write the generated Nightwatch tests\n\n**⚡️ Transform individual recordings**\n\n```sh\nnpx @nightwatch/chrome-recorder \u003cpath to the chrome devtools recording\u003e\n```\n\n**⚡️ Transform multiple recordings**\n\n```sh\nnpx @nightwatch/chrome-recorder \u003cpath to the chrome devtools recording\u003e*.json\n```\n\n👉 By default output will be written to `nightwatch` folder. If you don't have these folders, tool will create it for you or install nightwatch by running `npm init nightwatch` in your project.\n\nYou can specify different output directory, specify that via cli\n\n```sh\nnpx @nightwatch/chrome-recorder \u003cpath to the chrome devtools recording\u003e --output=\u003cfolder-name\u003e\n```\n\n## ⚙️ CLI Options\n\n| Option       | Description                                            |\n| ------------ | ------------------------------------------------------ |\n| -d, --dry    | Dry run the output of the transformed recordings       |\n| -o, --output | Output location of the files generated by the exporter |\n\n## 💻 Programmatic API\n\n```javascript\nimport { nightwatchStringifyChromeRecording } from '@nightwatch/chrome-recorder';\n\nconst recordingContent = {\n  title: 'recording',\n  steps: [\n    {\n      type: 'setViewport',\n      width: 1905,\n      height: 223,\n      deviceScaleFactor: 1,\n      isMobile: false,\n      hasTouch: false,\n      isLandscape: false,\n    },\n  ],\n};\n\nconst stringifiedContent = await nightwatchStringifyChromeRecording(\n  JSON.stringify(recordingContent),\n);\n\nconsole.log(stringifiedContent);\n// Console Log output\n//\n// describe('recording', function () {\n//   it('tests recording', function (browser) {\n//     browser.windowRect({ width: 1905, height: 223 });\n//   });\n// });\n```\n\n## 📝 Documentation\n\nYou can find about more about Programmatic API [here](docs/README.md)\n\n## 🐛 Issues\n\nIssues with this schematic can filed [here](https://github.com/nightwatchjs/nightwatch-chrome-recorder/issues)\n\nIf you want to contribute (or have contributed in the past), feel free to add yourself to the list of contributors in the package.json before you open a PR!\n\n## 👨‍💻 Development\n\n### Getting started\n\n🛠️ [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) are required for the scripts. Make sure it's installed on your machine.\n\n⬇️ **Install** the dependencies for the nightwatch chrome recorder tool\n\n```bash\nnpm install\n```\n\n👷‍♂️ **Build** the tools using typescript compiler\n\n```bash\nnpm run build\n```\n\n🏃 **Run** the tool\n\n```bash\n./bin/nightwatch-chrome-recorder.js\n```\n\n### 🧪 Unit Testing\n\nRun the unit tests using mocha as a runner and test framework\n\n```bash\nnpm run test\n```\n\n### ♻️ Clean build files\n\n```bash\nnpm run clean\n```\n\n## Supported Chrome Devtools Recorder Steps\n\nWe only support following steps:\n\n1. `setViewport`\n2. `navigate`\n3. `click`\n4. `change`\n5. `keyDown`\n6. `keyUp`\n7. `scroll`\n8. `doubleClick`\n9. `hover`\n10. `emulateNetworkConditions`\n11. `waitForElement`\n\nIf the step type is not mentioned above, a warning will be shown.\n\n[npm-badge]: https://img.shields.io/npm/v/@nightwatch/chrome-recorder.svg\n[npm]: https://www.npmjs.com/package/@nightwatch/chrome-recorder\n[discord-badge]: https://img.shields.io/discord/618399631038218240.svg?color=7389D8\u0026labelColor=6A7EC2\u0026logo=discord\u0026logoColor=ffffff\u0026style=flat-square\n[discord]: https://discord.gg/SN8Da2X\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightwatchjs%2Fnightwatch-chrome-recorder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightwatchjs%2Fnightwatch-chrome-recorder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightwatchjs%2Fnightwatch-chrome-recorder/lists"}