generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 4
94 lines (86 loc) · 2.8 KB
/
e2e-regression-tests.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
name: E2E Regression Tests
on:
workflow_run:
workflows: ['PR Opened']
types: [completed]
workflow_dispatch:
inputs:
### Required
target:
description: 'PR number, test, uat or prod.'
default: 'test'
required: true
type: string
jobs:
vars:
name: Set Variables
outputs:
target: ${{ steps.env.outputs.target }}
environment: ${{ steps.env.outputs.environment }}
runs-on: ubuntu-22.04
steps:
- name: env
id: env
run: |
pr="${{github.event.workflow_run.pull_requests[0].number}}"
if [[ $pr ]]; then
target="$pr"
environment="dev"
else
target=${{inputs.target}}
environment=${{inputs.target}}
fi
echo "target=$target" >> $GITHUB_OUTPUT
echo "environment=$environment" >> $GITHUB_OUTPUT
e2e-tests:
name: ${{matrix.test}}
needs: [vars]
environment: ${{needs.vars.outputs.environment}}
runs-on: ubuntu-22.04
defaults:
run:
working-directory: tests/
strategy:
fail-fast: false
matrix:
browser:
- chrome
#- edge
#- firefox
test:
- 'bceid-crud-power-units.cy.js'
- 'bceid-crud-trailers.cy.js'
- 'bceid-new-term-oversize.cy.js'
- 'bceid-new-term-overweight.cy.js'
- 'bceid-update-term-oversize.cy.js'
- 'idir-amend-term-oversize.cy.js'
- 'idir-void-term-oversize.cy.js'
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: cypress-io/[email protected]
name: Cypress run
env:
CYPRESS_baseUrl: https://${{ github.event.repository.name }}-${{ needs.vars.outputs.target || 'test' }}-frontend.apps.silver.devops.gov.bc.ca/
CYPRESS_bceid_username: ${{vars.BCEID_USERNAME}}
CYPRESS_bceid_password: ${{secrets.BCEID_PASSWORD}}
CYPRESS_idir_username: ${{vars.IDIR_USERNAME}}
CYPRESS_idir_password: ${{secrets.IDIR_PASSWORD}}
with:
browser: ${{ matrix.browser }}
config: pageLoadTimeout=10000,video=true
spec: cypress/e2e/${{matrix.test}}
working-directory: tests
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{matrix.test}}-${{matrix.browser}} screenshot
path: tests/cypress/screenshots/
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
- uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{matrix.test}}-${{matrix.browser}} video
path: tests/cypress/videos/
overwrite: true
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`