Skip to content

Instantly share code, notes, and snippets.

@fchabouis
Created December 18, 2020 15:48
Show Gist options
  • Save fchabouis/39d77ae07fc96d12833a5be7cd9cbbf0 to your computer and use it in GitHub Desktop.
Save fchabouis/39d77ae07fc96d12833a5be7cd9cbbf0 to your computer and use it in GitHub Desktop.
Run cypress tests with vuejs and docker
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
@fchabouis
Copy link
Author

fchabouis commented Dec 18, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment