Created
December 18, 2020 15:48
-
-
Save fchabouis/39d77ae07fc96d12833a5be7cd9cbbf0 to your computer and use it in GitHub Desktop.
Run cypress tests with vuejs and docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2.1 | |
jobs: | |
build_and_test: | |
docker: | |
- image: cypress/included:3.2.0 | |
environment: | |
## this enables colors in the output | |
TERM: xterm | |
steps: | |
- checkout | |
- run: | |
name: Install Dependencies | |
command: npm install | |
- run: | |
name: Run tests | |
command: npm run test:e2e -- --headless | |
workflows: | |
workflow: | |
jobs: | |
- build_and_test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
A vuejs project, with cypress tests, hosted on github.
The vue project is created with the vue-cli, cypress is added with a vue-cli plugin
Goal
Have my tests running automatically with circleci for each PR.
For some reason, I could not use the cypress orb in circleci, so I needed to run my cypress tests with docker instead.
Took me some time to find the way to go, so I share it here.
The key was to run
npm run test:e2e -- --headless
instead of trying to run the dev server and then run cypress, as I did on my computer.