-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (52 loc) · 1.82 KB
/
cypress.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
name: Integration tests
on: [pull_request]
jobs:
cypress-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Waiting for pages to change
uses: fountainhead/[email protected]
id: wait-for-pages-changed
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
checkName: 'Pages changed - elated-hoover-5c29bf'
timeoutSeconds: 3600
- name: Waiting for 200 from the Netlify Preview
if: steps.wait-for-pages-changed.outputs.conclusion == 'neutral'
uses: jakepartusch/[email protected]
id: wait-for-netflify-preview
with:
site_name: 'elated-hoover-5c29bf'
max_timeout: 3600
env:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
- name: Fetch navigation.json
uses: wei/curl@v1
with:
args: -o src/tests/cypress/fixtures/navigation.json https://developers.vtex.com/navigation.json
- name: Cypress run
uses: cypress-io/github-action@v5
with:
browser: chrome
headed: true
env:
CYPRESS_baseUrl: ${{ steps.wait-for-netflify-preview.outputs.url }}
CYPRESS_testProbability: 0.1
- name: Generate summary report
if: always()
run: |
touch src/tests/summary.md
if [[ -f "./cypress.log" ]]; then
node src/tests/utils/summary-report.js > src/tests/summary.md
rm cypress.log
fi
- name: Comment PR with summary report
if: always()
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: tests-summary
filePath: src/tests/summary.md
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}