Skip to content

Commit 5acbfaa

Browse files
authored
Merge pull request #54 from NHSDigital/screening-appointment-playright
Add a system test covering the happy path for the "record a mammogram" journey
2 parents 2d76ad5 + fae9f57 commit 5acbfaa

13 files changed

Lines changed: 167 additions & 267 deletions

File tree

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,3 @@ jobs:
7272
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
7373
version: "${{ needs.metadata.outputs.version }}"
7474
secrets: inherit
75-
acceptance-stage:
76-
name: "Acceptance stage"
77-
needs: [metadata, build-stage]
78-
uses: ./.github/workflows/stage-4-acceptance.yaml
79-
with:
80-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
81-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
82-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
83-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
84-
python_version: "${{ needs.metadata.outputs.python_version }}"
85-
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
86-
version: "${{ needs.metadata.outputs.version }}"
87-
secrets: inherit

.github/workflows/cicd-2-main-branch.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,3 @@ jobs:
7777
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
7878
version: "${{ needs.metadata.outputs.version }}"
7979
secrets: inherit
80-
81-
acceptance-stage:
82-
name: "Acceptance stage"
83-
needs: [metadata, build-stage]
84-
uses: ./.github/workflows/stage-4-acceptance.yaml
85-
with:
86-
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
87-
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
88-
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
89-
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
90-
python_version: "${{ needs.metadata.outputs.python_version }}"
91-
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
92-
version: "${{ needs.metadata.outputs.version }}"
93-
secrets: inherit
94-
95-
# TODO: deploy the thing. This most likely will be done using Azure pipelines.

.github/workflows/stage-2-test.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ on:
3333
type: string
3434

3535
jobs:
36-
test-unit:
37-
name: "Unit tests"
36+
test:
37+
name: "Tests"
3838
runs-on: ubuntu-latest
3939
timeout-minutes: 5
4040

@@ -79,6 +79,14 @@ jobs:
7979
DATABASE_USER: postgres
8080
DATABASE_HOST: localhost
8181

82+
- name: "Run system test suite"
83+
run: make test-ui
84+
env:
85+
DATABASE_NAME: postgres
86+
DATABASE_PASSWORD: postgres
87+
DATABASE_USER: postgres
88+
DATABASE_HOST: localhost
89+
8290
test-lint:
8391
name: "Linting"
8492
runs-on: ubuntu-latest
@@ -92,23 +100,9 @@ jobs:
92100
- name: "Save the linting result"
93101
run: |
94102
echo "Nothing to save"
95-
test-coverage:
96-
name: "Test coverage"
97-
needs: [test-unit]
98-
runs-on: ubuntu-latest
99-
timeout-minutes: 5
100-
steps:
101-
- name: "Checkout code"
102-
uses: actions/checkout@v4
103-
- name: "Run test coverage check"
104-
run: |
105-
echo "Not implemented yet"
106-
- name: "Save the coverage check result"
107-
run: |
108-
echo "Nothing to save"
109103
perform-static-analysis:
110104
name: "Perform static analysis"
111-
needs: [test-unit]
105+
needs: [test]
112106
runs-on: ubuntu-latest
113107
permissions:
114108
id-token: write

.github/workflows/stage-4-acceptance.yaml

Lines changed: 0 additions & 170 deletions
This file was deleted.

.github/workflows/stage-5-deploy.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ help: # Print help @Others
4040
printf "\nUsage: \033[3m\033[93m[arg1=val1] [arg2=val2] \033[0m\033[0m\033[32mmake\033[0m\033[34m <command>\033[0m\n\n"
4141
perl -e '$(HELP_SCRIPT)' $(MAKEFILE_LIST)
4242

43-
test: test-unit test-lint # Run all tests @Testing
43+
test: test-unit test-ui test-lint # Run all tests @Testing
4444

4545
test-unit: # Run unit tests @Testing
46-
poetry run pytest
46+
poetry run pytest -m 'not system'
4747

4848
test-lint: # Lint files @Testing
4949
# TODO
5050

5151
test-ui: # Run UI tests @Testing
52-
# TODO
52+
poetry run pytest -m system
5353

5454
run: manage_breast_screening/config/.env # Start the development server @Development
5555
poetry run ./manage.py runserver

manage_breast_screening/config/system_test_setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
21
import os
2+
3+
import pytest
4+
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
35
from playwright.sync_api import sync_playwright
46

7+
8+
@pytest.mark.system
59
class SystemTestCase(StaticLiveServerTestCase):
610
@classmethod
711
def setUpClass(cls):
@@ -21,4 +25,4 @@ def setUp(self):
2125
self.page.set_default_timeout(5000)
2226

2327
def tearDown(self):
24-
self.page.close()
28+
self.page.close()

0 commit comments

Comments
 (0)