Merge pull request #311 from bahmutov/add-cypress-workflow
add Cypress starter workflow
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
name: Cypress
|
||||
|
||||
on: [push]
|
||||
|
||||
env:
|
||||
CI: 1 # minimal progress output
|
||||
TERM: xterm # good terminal rendering
|
||||
|
||||
jobs:
|
||||
# for simpler configuration you can use 3rd party action
|
||||
# https://github.com/cypress-io/github-action
|
||||
e2e:
|
||||
name: Cypress tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache NPM modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-npm-
|
||||
- name: Cache Cypress binary
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/Cypress
|
||||
key: ${{ runner.os }}-cypress-${{ hashFiles('**/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cypress-
|
||||
- name: install Cypress
|
||||
run: |
|
||||
npm ci
|
||||
npx cypress verify
|
||||
- name: E2E tests
|
||||
run: npx cypress run
|
||||
# save any error screenshots as test artifacts
|
||||
- uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: screenshots
|
||||
path: cypress/screenshots
|
||||
# video should always be generated
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: videos
|
||||
path: cypress/videos
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Cypress",
|
||||
"description": "Run end-to-end web application tests using Cypress.io",
|
||||
"iconName": "cypress",
|
||||
"categories": ["Testing", "Cypress"]
|
||||
}
|
||||
Reference in New Issue
Block a user