Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Cypress tests into separate groups #927

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 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,43 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

coverage-cypress:
coverage-cypress-stateless:
env:
REACT_APP_NOTIFY_DAPP_ID: ${{ secrets.REACT_APP_NOTIFY_DAPP_ID }}
runs-on: ubuntu-latest
services:
saddle-contract:
image: saddlefinance/contracts:latest
ports:
- 8545:8545
strategy:
fail-fast: false
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: 240
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/

coverage-cypress-stateful:
env:
REACT_APP_NOTIFY_DAPP_ID: ${{ secrets.REACT_APP_NOTIFY_DAPP_ID }}
runs-on: ubuntu-latest
Expand All @@ -94,7 +130,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 +143,4 @@ jobs:
name: E2E Failures
path: |
cypress/screenshots/
cypress/videos/
cypress/videos/
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PoolName } from "../../src/constants"
import { PoolName } from "../../../src/constants"

const poolTokens: { [key: string]: string[] } = {
"BTC V2": ["WBTC", "RENBTC", "sBTC"],
Expand All @@ -9,7 +9,7 @@ context("Deposit Flow", () => {
beforeEach(() => {
const host = Cypress.env("DAPP_HOST") as string
cy.visit(`${host}#/pools`)
cy.wait(3000)
cy.wait(5000)
})
function testPoolDeposit(poolName: PoolName) {
it(`successfully completes a deposit of all ${poolName} assets`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PoolName } from "../../src/constants"
import { PoolName } from "../../../src/constants"

// have two seperate maps here since the naming convention is different throughout the page
const poolTokensFullName: { [key: string]: string[] } = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PoolName } from "../../src/constants"
import { PoolName } from "../../../src/constants"

context("Advanced option test", () => {
// have two seperate maps here since the naming convention is different throughout the page
Expand Down
7 changes: 6 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 Expand Up @@ -153,5 +155,8 @@
}
}
]
},
"nyc": {
"reporter": ["html"]
}
}