-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (79 loc) · 2.99 KB
/
Copy path.automated-tests.yml
File metadata and controls
90 lines (79 loc) · 2.99 KB
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
name: Automated user flow tests
on:
workflow_call:
inputs:
url:
required: true
type: string
jobs:
cypress-run:
name: "User flow test"
permissions:
pull-requests: write
runs-on: ubuntu-24.04
environment: tools
steps:
- name: Checkout
uses: actions/checkout@v7
- uses: actions/setup-node@v6
name: Start node
with:
node-version: 24
- name: Run Cypress End-to-End
uses: cypress-io/github-action@v7.4.0
with:
working-directory: cypress
env:
CYPRESS_baseUrl: https://${{ inputs.url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_editor_password: ${{ secrets.UAT_EDITOR_PASSWORD }}
CYPRESS_editor_username: ${{ secrets.UAT_EDITOR_USERNAME }}
CYPRESS_admin_password: ${{ secrets.UAT_ADMIN_PASSWORD }}
CYPRESS_admin_username: ${{ secrets.UAT_ADMIN_USERNAME }}
CYPRESS_viewer_password: ${{ secrets.UAT_VIEWER_PASSWORD }}
CYPRESS_viewer_username: ${{ secrets.UAT_VIEWER_USERNAME }}
CYPRESS_bceid_password: ${{ secrets.UAT_BCEID_PASSWORD }}
CYPRESS_bceid_username: ${{ secrets.UAT_BCEID_USERNAME }}
CYPRESS_bcsc_password: ${{ secrets.UAT_BCSC_PASSWORD }}
CYPRESS_bcsc_username: ${{ secrets.UAT_BCSC_USERNAME }}
- name: Publish Cypress Results
uses: mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6
continue-on-error: true
if: always()
with:
report_paths: cypress/result.xml
commit: ${{ github.event.pull_request.head.sha }}
summary: Cypress Test Results
detailed_summary: true
job_name: User Journeys
- name: Check for Cypress Screenshots and Videos
run: |
if [ -d "cypress/cypress/screenshots" ] && [ "$(ls -A cypress/cypress/screenshots)" ]; then
echo "Screenshots folder is not empty, uploading artifacts."
echo "screenshots=true" >> $GITHUB_OUTPUT
else
echo "Screenshots folder is empty or does not exist."
echo "screenshots=false" >> $GITHUB_OUTPUT
fi
if [ -d "cypress/cypress/videos" ] && [ "$(ls -A cypress/cypress/videos)" ]; then
echo "Videos folder is not empty, uploading artifacts."
echo "videos=true" >> $GITHUB_OUTPUT
else
echo "Videos folder is empty or does not exist."
echo "videos=false" >> $GITHUB_OUTPUT
fi
id: check_artifacts
- uses: actions/upload-artifact@v7
name: Upload Cypress Screenshots
if: always()
with:
name: cypress-screenshots
path: cypress/cypress/screenshots
retention-days: 7
- uses: actions/upload-artifact@v7
name: Upload Cypress Videos
if: always()
with:
name: cypress-videos
path: cypress/cypress/videos
retention-days: 7