feat: add GitHub action for e2e testing
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
7eb6351530
commit
54c6190361
31
.github/workflows/cypress.yml
vendored
Normal file
31
.github/workflows/cypress.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
name: Cypress tests
|
||||
on: [push]
|
||||
jobs:
|
||||
cypress-run:
|
||||
name: Cypress run
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
mongodb:
|
||||
image: mongo:3.5.5
|
||||
# ports may not be necessary, try without
|
||||
ports:
|
||||
- 27017:27017
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Set up environment
|
||||
run: cp sample.env .env
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v1
|
||||
with:
|
||||
build: npm run build
|
||||
# this should mirror the production build, but for now we're just using the dev
|
||||
# server and gatsby serve instead (the npm script serve:client needs updating!)
|
||||
start: npm start
|
||||
wait-on: http://localhost:8000
|
||||
# the site builds in about 8 minutes, so there is currently 12 minutes of time
|
||||
# left for testing.
|
||||
wait-on-timeout: 1200
|
||||
config: baseUrl=http://localhost:8000
|
@ -94,7 +94,7 @@
|
||||
"format": "npm run format:gatsby && npm run format:src && npm run format:utils",
|
||||
"prestand-alone": "npm run prebuild",
|
||||
"stand-alone": "gatsby develop",
|
||||
"serve": "gatsby serve",
|
||||
"serve": "gatsby serve -p 8000",
|
||||
"test": "jest"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -47,6 +47,7 @@
|
||||
"seed:auth-user": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser",
|
||||
"seed:challenges": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedChallenges",
|
||||
"serve:client": "cd ./client && npm run serve",
|
||||
"start": "npm-run-all ensure-env -p develop:server serve:client",
|
||||
"test": "npm-run-all -p test:*",
|
||||
"test:client": "cd ./client && npm test && cd ../",
|
||||
"test:client:e2e": "cd ./client && npm run e2e:ci && cd ../",
|
||||
|
Reference in New Issue
Block a user