Skip to content

Commit

Permalink
docs(readme): Explain how to override the PLAYWRIGHT_TEST_DIR value
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Jul 6, 2023
1 parent b51bf4e commit 2deb214
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,22 @@ ddev restart

#### `ddev playwright-install`

This command will install `playwright` and all dependencies in a Playwright folder defined by the environment variable `PLAYWRIGHT_TEST_DIR` of the `docker-compose.playwright.yaml` file. By default, `tests/Playwright` is used but you can modify this value to suit your needs.
This command will install `playwright` and all dependencies in a folder defined by the environment variable `PLAYWRIGHT_TEST_DIR` of the `docker-compose.playwright.yaml` file.

**Before running this command**, ensure that you have a `package.json` file in the Playwright folder. You will find an example of such a file in the `tests/project_root/tests/Playwright`folder of this repository. You will also find an example of a `playwright.config.js` file.
**Before running this command**, ensure that you have a `package.json` file in the `PLAYWRIGHT_TEST_DIR` folder. You will find an example of such a file in the `tests/project_root/tests/Playwright`folder of this repository. You will also find an example of a `playwright.config.js` file.

If there is a `.env.example` file in the folder, it will be copied into a `.env` file (to be used with the `dotenv` package for example).
By default, `tests/Playwright` is used as `PLAYWRIGHT_TEST_DIR` value, but you can override this value to suit your need by creating a `docker-compose.override.yaml` in the `.ddev` root directory with the following content:

```yaml
services:
playwright:
environment:
- PLAYWRIGHT_TEST_DIR=your/playwright/directory/path
```
You could also edit the value directly in the `docker-compose.playwright.yaml` file but you risk losing your changes every time you do a `ddev get julienloizelet/ddev-playwright` (unless you delete the `#ddev-generated` line at the beginning of the file).

In addition, if there is a `.env.example` file in the folder, it will be copied into a `.env` file (to be used with the `dotenv` package for example).

#### `ddev playwright`

Expand Down

0 comments on commit 2deb214

Please sign in to comment.