Update dependency cypress-expect to v3 #482
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pr | |
on: [pull_request] | |
jobs: | |
pr-tests: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout 🛎 | |
uses: actions/checkout@v3 | |
# run tests tagged "@smoke" | |
# https://github.com/bahmutov/cy-grep | |
- name: Smoke tests 💨 | |
# https://github.com/cypress-io/github-action | |
uses: cypress-io/github-action@v5 | |
with: | |
build: npm run stop-only | |
start: npm run start:ci | |
# quote the url to be safe against YML parsing surprises | |
wait-on: 'http://localhost:8888' | |
# run only the tests tagged @smoke | |
env: grepTags=@smoke | |
# record the results on the Cypress Dashboard | |
# https://on.cypress.io/dashboard-introduction | |
record: true | |
group: '1 - smoke tests' | |
tag: smoke | |
# environment variables while running Cypress | |
env: | |
# pass the Dashboard record key as an environment variable | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# if smoke tests passed, run all the tests | |
- name: All E2E tests 🧪 | |
uses: cypress-io/github-action@v5 | |
with: | |
# we have already installed all dependencies above | |
install: false | |
# the server is already running | |
# record the results on the Cypress Dashboard | |
# https://on.cypress.io/dashboard-introduction | |
record: true | |
group: '2 - all tests' | |
# environment variables while running Cypress | |
env: | |
# pass the Dashboard record key as an environment variable | |
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | |
# pass GitHub token to allow accurately detecting a build vs a re-run build | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# https://github.com/bahmutov/find-cypress-specs | |
- name: Print test names 🖨 | |
run: npm run print-tests | |
# confirm the filtering and skipping tests works as expected | |
# using https://github.com/bahmutov/cypress-expect | |
- name: Run using grep 🔎 | |
# all specs without the tests are filtered | |
# and all other tests are skipped | |
run: | | |
npx cypress-expect run \ | |
--env grep="update state when items are completed" \ | |
--expect-exactly expected/one.json | |
- name: Run using grep tags 🔎 | |
run: | | |
npx cypress-expect run \ | |
--env grepTags='@misc' \ | |
--expect-exactly expected/tag-misc.json | |
- name: Burn tests 🔥 | |
run: | | |
npx cypress-expect run \ | |
--env burn=3 \ | |
--spec cypress/e2e/counter-spec.js \ | |
--expect-exactly expected/burn-counter.json |