https://github.com/unb-libraries/docker-cypress
Cypress Docker image including default configuration.
https://github.com/unb-libraries/docker-cypress
Last synced: about 1 year ago
JSON representation
Cypress Docker image including default configuration.
- Host: GitHub
- URL: https://github.com/unb-libraries/docker-cypress
- Owner: unb-libraries
- License: mit
- Created: 2022-08-17T18:22:40.000Z (almost 4 years ago)
- Default Branch: 10.x-1.x
- Last Pushed: 2022-11-23T15:01:59.000Z (over 3 years ago)
- Last Synced: 2025-02-15T18:53:37.488Z (over 1 year ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unb-libraries/docker-cypress
A Cypress docker image that provides basic configuration to add Cypress testing to a dockerized project and development workflow.
## Usage
Given a project layout similar to the following:
```
project_root/
├─ src/
├─ tests/
│ ├─ cypress/
│ │ ├─ e2e/
│ │ │ ├─ spec_1.cy.js
│ │ │ ├─ spec_2.cy.js
├─ Dockerfile
├─ docker-compose.yml
```
In a docker-compose project, set the `BASE_URL` environment variable to your app container's address. This will be used as the `baseUrl` in all Cypress tests. Mount cypress specs as a volume.
```
services:
app:
...
networks:
- appnet
cypress:
image: ghcr.io/unb-libraries/cypress:10.x-1.x
environment:
- BASE_URL=http://app
volumes:
- ./tests/cypress/e2e:/cypress/e2e
networks:
- appnet
networks:
- appnet
```
## Run
Execute tests and display the latest results as follows:
```
docker start && docker logs -f --since 0s
```