Skip to content

Commit b8abcd4

Browse files
authored
Merge pull request #393 from NHSDigital/update-workflow
Create new workflow to run tests with one device
2 parents 06ca32a + 8fe6ed9 commit b8abcd4

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/functional.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Functional tests
1+
name: Functional tests (all devices)
22

33
on:
44
schedule:
@@ -10,6 +10,7 @@ jobs:
1010
name: Test
1111

1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
device:
1516
- Desktop Chrome
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Functional tests (selected device)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
device:
7+
description: 'Device to test (exact name - defaults to "Desktop Chrome")'
8+
required: false
9+
default: 'Desktop Chrome'
10+
pull_request:
11+
12+
jobs:
13+
test:
14+
name: Test
15+
16+
permissions: {}
17+
18+
runs-on: ubuntu-latest
19+
20+
env:
21+
TZ: "Europe/London"
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set device variable
27+
id: set-device
28+
run: |
29+
if [ "${{ github.event_name }}" = "pull_request" ]; then
30+
echo "device=Desktop Chrome" >> $GITHUB_OUTPUT
31+
else
32+
echo "device=${{ github.event.inputs.device }}" >> $GITHUB_OUTPUT
33+
fi
34+
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v6
37+
38+
- name: Install Playwright
39+
run: uv run playwright install --with-deps
40+
41+
- name: Run tests
42+
run: uv run pytest --device "${{ steps.set-device.outputs.device }}"
43+
env:
44+
BASE_URL: ${{ vars.BASE_URL }}
45+
BASIC_AUTH_PASSWORD: ${{ secrets.BASIC_AUTH_PASSWORD }}
46+
BASIC_AUTH_USERNAME: ${{ secrets.BASIC_AUTH_USERNAME }}
47+
48+
- name: Upload Allure results
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: results
52+
path: allure-results

0 commit comments

Comments
 (0)