generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 3
165 lines (152 loc) · 5.65 KB
/
accessibility.yaml
File metadata and controls
165 lines (152 loc) · 5.65 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Accessibility tests
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
inputs:
tests:
description: 'Tests to run (leave blank to run all tests!)'
required: false
default: ''
device:
description: 'Device to test'
required: true
default: 'Desktop Chrome'
type: choice
options:
- Desktop Chrome
- Desktop Edge
- Desktop Firefox
- Desktop Safari
- Galaxy S9+
- Pixel 7
- iPad (gen 7) landscape
- iPhone 15
programmes:
description: Programmes to use (FLU, HPV, MENACWY, MMR or TD_IPV)
required: true
default: FLU,HPV,MENACWY,MMR,TD_IPV
environment:
description: Environment to run tests on
required: true
default: 'qa'
type: choice
options:
- qa
- training
- sandbox-alpha
- sandbox-beta
screenshot_all_steps:
description: Take screenshots for all steps (in addition to failures)
required: true
default: 'false'
type: choice
options:
- true
- false
set_feature_flags:
description: >-
Set feature flags in the flipper page before running tests (affects all
users of the environment being tested!)
required: true
default: 'false'
type: choice
options:
- true
- false
additional_feature_flags:
description: >-
(If enabled above) Additional feature flags to set. api, basic_auth,
dev_tools will be set by default
required: false
default: ''
jobs:
test:
permissions:
contents: write
id-token: write
name: End-to-End tests
runs-on: ubuntu-latest
env:
TZ: "Europe/London"
steps:
# yamllint disable rule:line-length
- name: Set variables
id: set-variables
run: |
declare -A env_map=(
[qa]="https://qa.mavistesting.com"
[training]="https://training.manage-vaccinations-in-schools.nhs.uk"
[sandbox-alpha]="https://sandbox-alpha.mavistesting.com"
[sandbox-beta]="https://sandbox-beta.mavistesting.com"
)
if [[ "${{ github.event_name }}" == "pull_request" || "${{ github.event_name }}" == "schedule" ]]; then
{
echo "tests="
echo "device=Desktop Chrome"
echo "environment=${env_map[qa]}"
echo "programmes=FLU,HPV,MENACWY,MMR,TD_IPV"
echo "set_feature_flags=false"
echo "additional_feature_flags="
echo "deploy_report=false"
echo "screenshot_all_steps=false"
} >> "$GITHUB_OUTPUT"
else
{
echo "tests=${{ github.event.inputs.tests }}"
echo "device=${{ github.event.inputs.device }}"
input_env="${{ github.event.inputs.environment }}"
url="${env_map[$input_env]:-${env_map[qa]}}"
echo "environment=$url"
echo "programmes=${{ github.event.inputs.programmes }}"
echo "set_feature_flags=${{ github.event.inputs.set_feature_flags }}"
echo "additional_feature_flags=${{ github.event.inputs.additional_feature_flags }}"
echo "deploy_report=true"
echo "screenshot_all_steps=${{ github.event.inputs.screenshot_all_steps }}"
} >> "$GITHUB_OUTPUT"
fi
# yamllint enable rule:line-length
- uses: actions/checkout@v6
- name: Deployment health check
uses: ./.github/actions/deployment-health-check
with:
environment_url: ${{ steps.set-variables.outputs.environment }}
- name: Cache Playwright browsers
uses: actions/cache@v5
id: playwright-cache
with:
path: /home/runner/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
- name: Run tests
uses: ./.github/actions/run-end-to-end-tests
with:
tests: ${{ steps.set-variables.outputs.tests }}
accessibility_tests: 'true'
device: ${{ steps.set-variables.outputs.device }}
base_url: ${{ steps.set-variables.outputs.environment }}
programmes_enabled: ${{ steps.set-variables.outputs.programmes }}
screenshot_all_steps: ${{ steps.set-variables.outputs.screenshot_all_steps }}
set_feature_flags: ${{ steps.set-variables.outputs.set_feature_flags }}
additional_feature_flags: >-
${{ steps.set-variables.outputs.additional_feature_flags }}
playwright_cache_hit: ${{ steps.playwright-cache.outputs.cache-hit }}
env:
BASIC_AUTH_TOKEN: ${{ secrets.HTTP_AUTH_TOKEN_FOR_TESTS }}
IMMS_BASE_URL: ${{ vars.IMMS_BASE_URL }}
IMMS_API_KEY: ${{ secrets.IMMS_API_KEY }}
IMMS_API_KID: ${{ secrets.IMMS_API_KID }}
IMMS_API_PEM: ${{ secrets.IMMS_API_PEM }}
- name: Configure AWS credentials
if: always() && steps.set-variables.outputs.deploy_report == 'true'
uses: aws-actions/configure-aws-credentials@v6
with:
aws-region: eu-west-2
role-to-assume: arn:aws:iam::393416225559:role/GitHubAssuranceTestRole
- name: Process reports
if: always() && steps.set-variables.outputs.deploy_report == 'true'
uses: ./.github/actions/deploy-reports
with:
device: ${{ steps.set-variables.outputs.device }}
environment: ${{ github.event.inputs.environment }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}