{"id":18728582,"url":"https://github.com/nightwatchjs/nightwatch-schematics","last_synced_at":"2025-04-12T16:33:17.745Z","repository":{"id":42574340,"uuid":"369505258","full_name":"nightwatchjs/nightwatch-schematics","owner":"nightwatchjs","description":"Add Nightwatchjs to an Angular CLI project","archived":false,"fork":false,"pushed_at":"2024-02-29T14:39:06.000Z","size":3248,"stargazers_count":8,"open_issues_count":8,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-30T00:55:17.954Z","etag":null,"topics":["angular","nightwatch","schematics","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@nightwatch/schematics","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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-21T10:56:06.000Z","updated_at":"2024-04-10T18:29:04.000Z","dependencies_parsed_at":"2024-03-03T21:48:49.039Z","dependency_job_id":null,"html_url":"https://github.com/nightwatchjs/nightwatch-schematics","commit_stats":{"total_commits":150,"total_committers":6,"mean_commits":25.0,"dds":0.6133333333333333,"last_synced_commit":"6ca2f9bf1efa7f9519ed15166a90c1580c8377c6"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-schematics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-schematics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-schematics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nightwatchjs%2Fnightwatch-schematics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nightwatchjs","download_url":"https://codeload.github.com/nightwatchjs/nightwatch-schematics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583108,"owners_count":20961970,"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":["angular","nightwatch","schematics","typescript"],"created_at":"2024-11-07T14:22:00.643Z","updated_at":"2025-04-12T16:33:16.908Z","avatar_url":"https://github.com/nightwatchjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nightwatch Schematics\n\n[![Node CI](https://github.com/nightwatchjs/nightwatch-schematics/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/nightwatchjs/nightwatch-schematics/actions/workflows/build.yml)\n[![npm package](https://img.shields.io/npm/v/@nightwatch/schematics)](https://www.npmjs.com/package/@nightwatch/schematics)\n\n\u003e Fast and easy installation of [Nightwatch][nightwatchlink] into your projects\n\nFramework \u0026 Language Supported: [Angular](#angular)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Nightwatch.js Schematic Logo\" src=\".github/assets/nightwatch-logo.svg\" width=300 /\u003e\n\u003c/p\u003e\n\nThis project is a Schematics implementation that allows you to easily integrate [Nightwatch][nightwatchlink] into your Angular projects.\n\n**This Schematic will:**\n\n🏗️ Install Nightwatch, and it's dependencies  \n⚙️ Add NPM scripts for running Nightwatch tests  \n📦 Scaffold base Nightwatch config and test files  \n❓ Prompt for removal of Protractor files and configuration\n\n## Angular\n\n### ✨ Demo\n\n![Nightwatch Schematics Demo](.github/assets/angular-demo.gif)\n\n### 🚀 Usage\n\nRun as one command in an Angular CLI app directory. Note this will add the schematic as a dependency to your project.\n\n```bash\nng add @nightwatch/schematics\n```\n\nOne can provide following options:\n| Option | Description |\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| noBuilder | This will skip the builder addition, leaving the angular.json file unmodified and requiring you to run Nightwatch from the command line or through your IDE. Include --noBuilder in your ng add command. |\n\nWith the custom builder installed, you can run Nightwatch with the following commands:\n\n```bash\nng e2e\n```\n\n```bash\nng run {your-project-name}:nightwatch-run\n```\n\nThese two commands do the same thing. They will run nightwatch e2e tests.\n\nOnce Nightwatch is added to your project, all [Nightwatch CLI options][nightwatchclioptionslink] will be available when triggering e2e tests. E.g.: `--verbose`, `--retries` etc.\n\n### ✨ Demo\n\n![Nightwatch Schematics Demo](.github/assets/typescript-demo.gif)\n\n### 🚀 Usage\n\nInstall [Schematics CLI][schematicsclilink] globally\n\n```bash\nnpm install -g @angular-devkit/schematics-cli\n```\n\nInstall [Nightwatch-schematics][nightwatchschematicslink] in your project\n\n```bash\nnpm install @nightwatch/schematics\n```\n\nRun following command to install Nightwatch in your project:\n\n```bash\nschematics @nightwatch/schematics:ng-add\n```\n\nOnce Nightwatch is added to your project, all [Nightwatch CLI options][nightwatchclioptionslink] will be available when triggering e2e tests. E.g.: `--verbose`, `--retries` etc. One can update `e2e:test` to include cli options.\n\n## 🐛 Issues\n\nIssues with this schematic can filed [here](https://github.com/nightwatchjs/nightwatch-schematics/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## FAQ\n\n### How do I update @nightwatch/schematics package?\n\nThis command will update nightwatch schematic package\n\n```bash\nnpm update @nightwatch/schematics\n```\n\n### Where can I ask for help and report bugs?\n\nThe best way to ask for help and to report bugs is to [open an issue][githubissuelink].\n\n[Gitter][gitterlink] is another option.\n\n### I created new angular project, how do I remove Protractor and install Nightwatch?\n\nIt's very simple, you just have to run `ng add @nightwatch/schematics` command, and it will prompt you to remove Protractor from angular project.\n\n### How do I run on another browser that was initially selected in angular app?\n\nAll you have to do is install the relevant drivers, and replace `env` value (Check the column names in the [table](#drivers-available-to-install) below) `env-name` in `angular.json`. The config in `angular.json` will look like this.\n\n```javascript\n  \"nightwatch-run\": {\n    \"builder\": \"@nightwatch/schematics:nightwatch\",\n    \"options\": {\n      \"devServerTarget\": \"angularapp:serve\",\n      \"tsConfig\": \"../nightwatch/tsconfig.e2e.json\",\n      \"config\": \"./nightwatch.conf.js\",\n      \"env\": \"\u003cenv-name\u003e\"\n    },\n    \"configurations\": {\n      \"production\": {\n        \"devServerTarget\": \"angularapp:serve:production\"\n      }\n    }\n  },\n  \"e2e\": {\n    \"builder\": \"@nightwatch/schematics:nightwatch\",\n    \"options\": {\n      \"devServerTarget\": \"angularapp:serve\",\n      \"tsConfig\": \"../nightwatch/tsconfig.e2e.json\",\n      \"config\": \"./nightwatch.conf.js\",\n      \"env\": \"\u003cenv-name\u003e\"\n    },\n    \"configurations\": {\n      \"production\": {\n        \"devServerTarget\": \"angularapp:serve:production\"\n      }\n    }\n  }\n```\n\n### How to run e2e tests using npm?\n\n| Projects           | command          |\n| ------------------ | ---------------- |\n| Angular App        | npm run e2e      |\n| Typescript Project | npm run e2e:test |\n\n## Drivers\n\n### Drivers available to install\n\n| Name            | driver          | command                                  |\n| --------------- | --------------- | ---------------------------------------- |\n| chrome          | chromedriver    | `npm install chromedriver --save-dev`    |\n| firefox         | geckodriver     | `npm install geckodriver --save-dev`     |\n| selenium-server | selenium-server | `npm install selenium-server --save-dev` |\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 schematic and the sandbox application\n\n```bash\nnpm i \u0026\u0026 cd sandbox \u0026\u0026 npm i \u0026\u0026 cd ..\n```\n\n🖇 **Link** the schematic in the sandbox to run locally\n\n```bash\nnpm run link:sandbox\n```\n\n🏃 **Run** the schematic\n\n```bash\nnpm run build:clean:launch\n```\n\n## 🧪 E2E Testing\n\nExecute the schematic against the sandbox. It will add Nightwatch config, tests, and custom builder, then run e2e tests in the sandbox.\n\n```bash\nnpm run test\n```\n\n## 🧪 Unit Testing\n\nRun the unit tests using Jasmine as a runner and test framework\n\n```bash\nnpm run build:test\nnpm run test:unit\n```\n\n## ♻️ Reset the Sandbox\n\nRunning the schematic locally performs file system changes. The sandbox is version-controlled so that viewing a diff of the changes is trivial. After the schematic has run locally, reset the sandbox with the following.\n\n```bash\nnpm run clean\n```\n\n---\n\nThese projects: [@briebug/cypress-schematic](https://github.com/briebug/cypress-schematic/), [schuchard/prettier-schematic](https://github.com/schuchard/prettier-schematic) helped us in development of this project. Thank you!\n\n[nightwatchlink]: https://nightwatchjs.org/\n[nightwatchclioptionslink]: https://nightwatchjs.org/guide/running-tests/command-line-options.html\n[nightwatchgetstartedlink]: https://nightwatchjs.org/gettingstarted/\n[nightwatchschematicslink]: https://github.com/nightwatchjs/nightwatch-schematics\n[vuenightwatchpluginlink]: https://cli.vuejs.org/core-plugins/e2e-nightwatch.html\n[schematicsclilink]: https://www.npmjs.com/package/@angular-devkit/schematics-cli\n[githubissuelink]: https://github.com/nightwatchjs/nightwatch-schematics/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc\n[gitterlink]: https://gitter.im/nightwatchjs/nightwatch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightwatchjs%2Fnightwatch-schematics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnightwatchjs%2Fnightwatch-schematics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnightwatchjs%2Fnightwatch-schematics/lists"}