-
Notifications
You must be signed in to change notification settings - Fork 4
119 lines (101 loc) · 3.37 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: ci
on:
push:
branches:
- main
jobs:
all-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: All E2E tests 🧪
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
start: npm run start:ci
# quote the url to be safe against YML parsing surprises
wait-on: 'http://localhost:8888'
# record the results on the Cypress Dashboard
# https://on.cypress.io/dashboard-introduction
record: true
# tags and groups make it simple to find this run
# on the Dashboard
tag: main
group: main
# 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
by-title:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: Install 📦
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
runTests: false
- name: Start server 🏁
run: npm run start:ci &
# 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 title 🔎
# 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
by-tag:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: Install 📦
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
runTests: false
- name: Stop only 🛑
run: npm run stop-only
- name: Start server 🏁
run: npm run start:ci &
# https://github.com/bahmutov/find-cypress-specs
- name: Print test names 🖨
run: npm run print-tests
- name: Run using grep tags 🔎
run: |
npx cypress-expect run \
--env grepTags='@misc' \
--expect-exactly expected/tag-misc.json
burn-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎
uses: actions/checkout@v3
- name: Install 📦
# https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
runTests: false
- name: Start server 🏁
run: npm run start:ci &
# https://github.com/bahmutov/find-cypress-specs
- name: Print test names 🖨
run: npm run print-tests
- name: Burn tests 🔥
run: |
npx cypress-expect run \
--env burn=3 \
--spec cypress/e2e/counter-spec.js \
--expect-exactly expected/burn-counter.json