mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
be33929770
**What kind of change does this PR introduce?** Adds `@puppeteer/ng-schematics` to the list of packages to be published to `npm` **Did you add tests for your changes?** Not relevant. **If relevant, did you update the documentation?** Not for in this PR. **Summary** We want to publish to `npm` so people can do `ng add @puppeteer/ng-schematics` and use it with Angular CLI. **Does this PR introduce a breaking change?** No **Other information** |
||
---|---|---|
.. | ||
src/schematics | ||
test/src | ||
.eslintignore | ||
.gitignore | ||
.mocharc.cjs | ||
copySchemaFiles.js | ||
package-lock.json | ||
package.json | ||
README.md | ||
tsconfig.json | ||
tsconfig.spec.json |
Puppeteer Angular Schematic
Adds Puppeteer-based e2e tests to your Angular project.
Usage
Run the command bellow in an Angular CLI app directory and follow the prompts. Note this will add the schematic as a dependency to your project.
ng add @puppeteer/ng-schematics
Or you can use the same command followed by the options bellow.
Currently, this schematic supports the following test frameworks:
- Jasmine [https://jasmine.github.io/]
- Jest [https://jestjs.io/]
- Mocha [https://mochajs.org/]
- Node Test Runner (Experimental) [https://nodejs.org/api/test.html]
With the schematics installed, you can run E2E tests:
npm run e2e
# or yarn e2e
Options
When adding schematics to your project you can to provide following options:
Option | Description | Value | Required |
---|---|---|---|
--exportConfig |
When true, creates an empty Puppeteer configuration file. (.puppeteerrc.cjs ) |
boolean |
true |
--testingFramework |
The testing framework to install along side Puppeteer. | "jasmine" , "jest" , "mocha" , "node" |
true |
Unit Testing
The schematics utilize @angular-devkit/schematics/testing
for verifying correct file creation and package.json
updates. To execute the test suit:
npm run test