This patch:
- Removes all `process.exit(1)` from `docker.ts` and instead throws
errors.
- Drops the `npx playwright docker test` command. We agreed to
engage docker when `PLAYWRIGHT_DOCKER` environment variable
is set.
- Introduces hidden `npx playwright docker status` command that
dumps a JSON with docker status:
```sh
aslushnikov:~/prog/playwright$ npx playwright docker status
{
"dockerEngineRunning": true,
"imageName": "playwright:local-1.27.0-next-focal",
"imageIsPulled": true,
"containerWSEndpoing":
"ws://127.0.0.1:55077/eafeb84c-571b-4d12-ac51-f6a2b43e9155",
"containerVNCEndpoint":
"http://127.0.0.1:55076/?path=fb6d4add-9adf-4c3c-b335-893bdc235cd7&resize=scale&autoconnect=1"
}
```
This patch opts into the `__screnshots__` folder snapshot management
for docker.
With this patch, docker-originating snapshots will be stored in the
following folder:
```
{testDir}/__screenshots__/{projectName}/{testFilePath}/{snapshotName}
```
Where `{testFilePath}` is a test file path relative to `testDir`
Drive-by: introduce and document the `PLAYWRIGHT_DOCKER` environment
variable that enables docker integration.
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
launched docker container.