From 1b3dfeca98494d57b91a6f2c985064042ba99d35 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:18:03 +0100 Subject: [PATCH] chore: Update ng-schemactics README (#9269) **What kind of change does this PR introduce?** Updates the README for `@puppeteer/ng-schematics` with better information. Fixes broken command --- packages/ng-schematics/README.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/ng-schematics/README.md b/packages/ng-schematics/README.md index 0cde58ec..cd117b70 100644 --- a/packages/ng-schematics/README.md +++ b/packages/ng-schematics/README.md @@ -1,23 +1,41 @@ -# Puppeteer Schematics Angular +# Puppeteer Angular Schematic -This schematics provide a simple set up of Puppeteer for an Angular project. +Adds Puppeteer-based e2e tests to your Angular project. ## Usage -Run the command in an Angular CLI app directory. +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._ ```bash -ng add puppetter-schematics +ng add @puppeteer/ng-schematics ``` -With the schematics installed, you can run E2E tests with your chose: +Or you can use the same command followed by the [options](#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: ```bash 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](https://pptr.dev/guides/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: