puppeteer/packages/ng-schematics
Nikolay Vitkov 16784fc8cb chore(ng-schematics): Update ng e2e to custom builder (#9300)
**What kind of change does this PR introduce?**

This replaces the default `ng e2e` with our custom builder. In the
feature it seem possible to remove the necessity of the user running the
server separately and run it from the builder - that will improve the
easy of use and CI of this schematic.

**Did you add tests for your changes?**

**If relevant, did you update the documentation?**

Yes - Updated `@puppeteer/ng-schematics` README.md

**Summary**

We want to not see the default `ng e2e` and we want to make it easier
for the user to run commands.
Angular Developer are likely to also use its' CLI.

**Does this PR introduce a breaking change?**

Yes. Users need to delete the default and initialize the schematics
again.

**Other information**
2022-11-22 19:52:29 +01:00
..
src chore(ng-schematics): Update ng e2e to custom builder (#9300) 2022-11-22 19:52:29 +01:00
test/src chore(ng-schematics): Update ng e2e to custom builder (#9300) 2022-11-22 19:52:29 +01:00
.eslintignore chore: Add Jest as a ng-schematics option (#9257) 2022-11-11 14:38:52 +01:00
.gitignore chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00
.mocharc.cjs chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00
copySchemaFiles.js chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00
package-lock.json chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00
package.json chore(ng-schematics): Update ng e2e to custom builder (#9300) 2022-11-22 19:52:29 +01:00
README.md chore(ng-schematics): Update ng e2e to custom builder (#9300) 2022-11-22 19:52:29 +01:00
tsconfig.json chore(ng-schematics): Update ng e2e to custom builder (#9300) 2022-11-22 19:52:29 +01:00
tsconfig.spec.json chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00

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:

With the schematics installed you can run E2E tests:

ng e2e

Note: Server must be running before executing the command.

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