puppeteer/packages/ng-schematics
dependabot[bot] c05a94a8c4
chore(deps): Bump @angular-devkit/architect from 0.1502.7 to 0.1600.1 (#10157)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-12 07:37:28 +00:00
..
src chore: Add EsLint rule import/order (#9685) 2023-02-15 15:09:31 -08:00
test/src chore: Add EsLint rule import/order (#9685) 2023-02-15 15:09:31 -08:00
tools chore: add sandbox to ng-schematics (#9816) 2023-03-09 14:19:40 +01:00
.eslintignore chore: added * pattern for test expectations (#9870) 2023-03-20 10:59:50 +01:00
.gitignore chore: add sandbox to ng-schematics (#9816) 2023-03-09 14:19:40 +01:00
.mocharc.cjs chore(ng-schematics): Add Angular Schematics (#9222) 2022-11-09 14:52:10 +01:00
CHANGELOG.md chore: release main (#10108) 2023-05-02 16:56:03 +00:00
package-lock.json chore: release main (#10108) 2023-05-02 16:56:03 +00:00
package.json chore(deps): Bump @angular-devkit/architect from 0.1502.7 to 0.1600.1 (#10157) 2023-05-12 07:37:28 +00:00
README.md chore: add sandbox to ng-schematics (#9816) 2023-03-09 14:19:40 +01:00
tsconfig.json chore(ng-schematics): Use WireIt for builds and tests (#9356) 2022-12-05 10:35:31 +01:00
tsconfig.spec.json chore(ng-schematics): Use WireIt for builds and tests (#9356) 2022-12-05 10:35:31 +01:00

Puppeteer Angular Schematic

Adds Puppeteer-based e2e tests to your Angular project.

Usage

Run the command below 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 below.

Currently, this schematic supports the following test frameworks:

With the schematics installed you can run E2E tests:

ng e2e

Note: Command spawns it's own server on the same port ng serve does.

Options

When adding schematics to your project you can to provide following options:

Option Description Value Required
--isDefaultTester When true, replaces default ng e2e command. boolean true
--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

Contributing

Check out our contributing guide to get an overview of what you need to develop in the Puppeteer repo.

Sandbox

For easier development we provide a script to auto-generate the Angular project to test against. Simply run:

npm run sandbox -- --init

After that to run @puppeteer/ng-schematics against the Sandbox Angular project run:

npm run sandbox
# or to auto-build and then run schematics
npm run sandbox -- --build

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