=== @ensono-stacks/playwright:init

.Create a Playwright test project for your chosen application
[%collapsible]
=====
[.details]
====
The _init_ generator creates a Playwright project for the application you choose.
====

[discrete]
== Usage

----
nx g @ensono-stacks/playwright:init
----

Upon calling the _init_ generator, you will be presented with the following question:

* What app would you like to generate a test project for?
** The name of the existing application to generate a test project for (named <app-name>-e2e)

[discrete]
== Command line arguments

[cols="1,1"]
|===
| Option | Description

| --project | The name of the application to generate a test project for
|===

[discrete]
== Generator Output

The _init_ generator will create a new test project for your chosen application containing an example test and predefined configuration for the monorepo and the individual test projects.
By default, the _init_ generator will configure both a baseline Playwright configuration and an individual project-based Playwright configuration.

[source,text]
----
.
├── apps
│   ├── <app-name>-e2e
│   │   ├── src
│   │   │   ├── example.spec.ts #Example tests using Playwright
│   ├── playwright.config.ts #Example Playwright configuration catering for multiple browsers and devices
│   ├── project.json #Configuration for the project, including various NX targets
│   ├── tsconfig.e2e.json #E2E TypeScript config file
│   ├── tsconfig.json #TypeScript config file
│   ├── .eslintrc.json #Linting configuration for the E2E project
└── playwright.config.base.ts
----

NOTE: Visit the link:../../testing/testing_in_nx/playwright_nx.adoc[Testing with Playwright] documentation for further details!
=====
