Skip to content

Commit

Permalink
Separated stateful and stateless cypress test
Browse files Browse the repository at this point in the history
Run both groups in parallel

Readded lost changes

Readded package del and removed integration folder
  • Loading branch information
Duy Nguyen authored and Duy Nguyen committed Mar 29, 2022
1 parent f4de519 commit 7eb677d
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 6 deletions.
47 changes: 43 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- run: npm test
env:
CI: true

coverage:
runs-on: ubuntu-latest
steps:
Expand All @@ -76,7 +76,46 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

coverage-cypress:
coverage-cypress-stateless:
runs-on: ubuntu-latest
services:
saddle-contract:
image: saddlefinance/contracts:latest
ports:
- 8545:8545
strategy:
fail-fast: false
matrix:
# run copies of the current job in parallel
containers: [1]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: 'UI Tests - Stateless'
uses: cypress-io/github-action@v2
with:
install: true
start: npm run cy:coveragestateless
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
browser: chrome
spec: cypress/integration/stateless/*
- run: npx nyc report --reporter=text
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: E2E Failures
path: |
cypress/screenshots/
cypress/videos/
env:
REACT_APP_NOTIFY_DAPP_ID: ${{ secrets.REACT_APP_NOTIFY_DAPP_ID }}

coverage-cypress-stateful:
env:
REACT_APP_NOTIFY_DAPP_ID: ${{ secrets.REACT_APP_NOTIFY_DAPP_ID }}
runs-on: ubuntu-latest
Expand All @@ -94,7 +133,7 @@ jobs:
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://git@github.com/'
- run: npm ci
- run: npm run cy:coverage
- run: npm run cy:coveragestateful
env:
CHOKIDAR_USEPOLLING: 1
- run: npx nyc report --reporter=text
Expand All @@ -107,4 +146,4 @@ jobs:
name: E2E Failures
path: |
cypress/screenshots/
cypress/videos/
cypress/videos/
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@
"build-storybook": "build-storybook -s public",
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` react-scripts build",
"bundlemon": "bundlemon --subProject no-compression --defaultCompression none && bundlemon --subProject gzip-compression --defaultCompression gzip",
"cy:coverage": "start-test 3000 'cypress run'",
"cy:coverage": "start-test 3000 'cypress run --config video=false'",
"cy:open": "cypress open",
"cy:run": "cypress run",
"cy:coveragestateful": "start-test 3000 'cypress run --spec ./cypress/integration/stateful/*.test.ts'",
"cy:coveragestateless": "start-test 3000 'cypress run --spec ./cypress/integration/stateless/*.test.ts'",
"cy:startopen": "start-test 3000 'cypress open'",
"eject": "react-scripts eject",
"lint:fix": "eslint --max-warnings=0 --ext ts,tsx --fix src/ && prettier --write 'src/**/*.{ts,tsx,scss}'",
Expand Down

0 comments on commit 7eb677d

Please sign in to comment.