| `PLAYWRIGHT_IMAGE` | The Docker image used to run Playwright. | `mcr.microsoft.com/playwright:latest` |
| `PLAYWRIGHT_PROJECT_DIR` | The Playwright root project directory (contains the `playwright.config.ts` file) | `.` |
| `PLAYWRIGHT_EXTRA_ARGS` | Playwright extra [run options](https://playwright.dev/docs/test-cli) | _none_ |
| `REVIEW_ENABLED` | Set to `true` to enable Playwright tests on review environments (dynamic environments instantiated on development branches) | _none_ (disabled) |
In addition to a textual report in the console, this job produces the following reports, kept for one day:
| `$PLAYWRIGHT_PROJECT_DIR/reports/playwright.xunit.xml` | [xUnit](https://github.com/jest-community/jest-junit#readme) test report(s) | [GitLab integration](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportsjunit) |
### base url auto evaluation
By default, the Playwright template tries to auto-evaluate its baseurl
By default, the Playwright template tries to auto-determine the [baseURL](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) to use
(i.e. the variable pointing at server under test) by looking either for a `$environment_url` variable or for an
`environment_url.txt` file.
When found, the base url is passed as `$BASE_URL` environment variable and can be reused in your Playwright tests (see below).
Therefore if an upstream job in the pipeline deployed your code to a server and propagated the deployed server url,
either through a [dotenv](https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html#artifactsreportsdotenv) variable `$environment_url`
@@ -43,3 +45,16 @@ or through a basic `environment_url.txt` file, then the Playwright test will aut
:warning: all our deployment templates implement this design. Therefore even purely dynamic environments (such as review
environments) will automatically be propagated to your Playwright tests.
If you want to retrieve the `$BASE_URL` environment variable evaluated by the template, simply load it from your `playwright.config.ts` file as follows: