Skip to content

Commit

Permalink
Add Docker configuration. 🐳
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffnyman committed Aug 11, 2024
1 parent c758e7a commit 342ae63
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Get the latest version of Playwright
FROM mcr.microsoft.com/playwright:v1.46.0-jammy

RUN mkdir /tests
COPY . /tests
WORKDIR /tests

RUN npm install
RUN npx @playwright/test install
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,38 @@ npx playwright test --project "Playground UI Tests"
npx playwright test --project "Ludic UI Tests"
```

## 🐳 Docker

To run tests in docker containers, install docker and use the followings commands to compose the docker image from the docker file.

```shell
docker build -t {image name} .
```

To create the container and launch it for use:

```shell
docker run -it -d {image name}
```

Check that the container is up and running and copy the container id.

```shell
docker ps -a
```

Now you can login in to the running container:

```shell
docker exec -it {container id} bash
```

Finally, just run the commands as per normal but in the docker bash shell:

```shell
npx playwright test
```

## 📜 Rationale

As an existential note, this project is not intended to [immanentize the eschaton](https://en.wikipedia.org/wiki/Immanentize_the_eschaton). (Just in case anyone was worried.)
Expand Down

0 comments on commit 342ae63

Please sign in to comment.