Skip to content

Commit 5e235a0

Browse files
committed
Merge branch 'main' into feature/smokescreen_compartment_3
# Conflicts: # pages/bcss_home_page.py # pytest.ini # requirements.txt # tests/test_bowel_scope_page.py # tests/test_call_and_recall_page.py # tests/test_communications_production_page.py # tests/test_contacts_list_page.py # tests/test_download_page.py # tests/test_fit_test_kits_page.py # tests/test_gfobt_test_kits_page.py # tests/test_home_page_links.py # tests/test_login_to_bcss.py # tests/test_lynch_surveillance_page.py # tests/test_organisations_page.py # tests/test_reports_page.py # tests/test_screening_practitioner_appointments_page.py # tests/test_screening_subject_search_page.py # users.json
2 parents 6b5b34c + 9cdc583 commit 5e235a0

28 files changed

+116
-147
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# DO NOT COMMIT THIS FILE
2+
3+
BCSS_PASS=

.github/workflows/stage-3-build.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030

3131
jobs:
3232
run-tests:
33-
name: "Run Util & Example Tests"
33+
name: "Run Util Tests"
3434
runs-on: ubuntu-latest
3535
timeout-minutes: 3
3636
steps:
@@ -43,12 +43,8 @@ jobs:
4343
run: |
4444
python -m pip install --upgrade pip
4545
pip install -r requirements.txt
46-
- name: Ensure browsers are installed
47-
run: python -m playwright install --with-deps
4846
- name: Run util tests
4947
run: pytest -m "utils" --ignore=tests/
50-
- name: Run example tests
51-
run: pytest
5248
- uses: actions/upload-artifact@v4
5349
if: ${{ !cancelled() }}
5450
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ __pycache__/
1616
.pytest_cache/
1717
test-results/
1818
axe-reports/
19+
.env

LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT Licence
22

3-
Copyright (c) 2024 Crown Copyright NHS England.
3+
Copyright (c) 2025 Crown Copyright NHS England.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
[![CI/CD Pull Request](https://github.com/nhs-england-tools/repository-template/actions/workflows/cicd-1-pull-request.yaml/badge.svg)](https://github.com/nhs-england-tools/playwright-python-blueprint/actions/workflows/cicd-1-pull-request.yaml)
44

5-
This project is designed to provide a blueprint to allow for development teams to start quickly developing UI tests using [Playwright Python](https://playwright.dev/python/), providing the base framework and utilities to allow for initial focus on writing tests, rather than configuration of the framework itself.
5+
This project is designed to provide a blueprint to allow for development teams to start quickly developing UI tests using [Playwright Python](https://playwright.dev/python/), providing the base framework and utilities to allow for initial focus on writing tests, rather than configuration of the framework itself. Playwright is the current mainstream UI testing tool for NHS England, as outlined on the [NHS England Tech Radar](https://radar.engineering.england.nhs.uk/).
66

7-
NOTE: This project is currently under initial development so isn't finalised, but should work if you want to experiment with Playwright Python.
8-
9-
> **NOTE: When considering this project, please be advised that currently Playwright is a "proposed" tool within the [NHS England Tech Radar](https://radar.engineering.england.nhs.uk/). Whilst we are taking steps to get Playwright moved to the "mainstream" section of the radar, as it has not yet been formally adopted it is possible that Playwright may not be fully endorsed by NHS England as a standard tool going forward, and using this framework for an NHS England project is currently at your own risk.**
7+
> NOTE: This project is currently under initial development so isn't finalised, but should work if you want to experiment with Playwright Python.
108
119
## Table of Contents
1210

buildBase.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12-slim
1+
FROM python:3.13-slim
22

33
WORKDIR /test
44

pages/bcss_home_page.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from playwright.sync_api import Page, expect
1+
from playwright.sync_api import Page
22

33

44
class BcssHomePage:
@@ -13,8 +13,6 @@ def __init__(self, page: Page):
1313
self.refresh_alerts_link = self.page.get_by_role("link", name="Refresh alerts")
1414
self.user_guide_link = self.page.get_by_role("link", name="User guide")
1515
self.help_link = self.page.get_by_role("link", name="Help")
16-
# Bowel Cancer Screening System header
17-
self.bowel_cancer_screening_system_header = self.page.locator("#ntshAppTitle")
1816

1917
def click_sub_menu_link(self):
2018
self.sub_menu_link.click()
@@ -40,9 +38,6 @@ def click_user_guide_link(self):
4038
def click_help_link(self):
4139
self.help_link.click()
4240

43-
def bowel_cancer_screening_system_header_is_displayed(self):
44-
expect(self.bowel_cancer_screening_system_header).to_contain_text("Bowel Cancer Screening System")
45-
4641

4742
class MainMenu:
4843
def __init__(self, page: Page):

pages/cognito_login_page.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
3+
from playwright.sync_api import Page
4+
5+
6+
class CognitoLoginPage:
7+
8+
def __init__(self, page: Page):
9+
self.page = page
10+
self.username = page.get_by_role("textbox", name="Username")
11+
self.password = page.get_by_role("textbox", name="Password")
12+
self.submit_button = page.get_by_role("button", name="submit")
13+
14+
def login_as_user(self, username: str, password: str) -> None:
15+
"""Logs in to bcss with specified user credentials
16+
Args:
17+
username (str) enter a username that exists in users.json
18+
password (str) the password for the user provided
19+
"""
20+
# Retrieve and enter username from users.json
21+
self.username.fill(username)
22+
# Retrieve and enter password from .env file
23+
self.password.fill(password)
24+
# Click Submit
25+
self.submit_button.click()

pytest.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ addopts =
1717
# Allows pytest to identify the base of this project as the pythonpath
1818
pythonpath = .
1919

20-
2120
# These are the tags that pytest will recognise when using @pytest.mark
2221
markers =
2322
#example: tests used for example purposes by this blueprint
@@ -28,4 +27,3 @@ markers =
2827
utils: test setup and support methods
2928
smoke: tests designed to run as part of the smokescreen regression test suite
3029
wip: tests that are currently in progress
31-
smokescreen: test containing the compartment smokescreen tests

requirements.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
pytest-playwright>=0.5.1
22
pytest-html>=4.1.1
33
pytest-json-report>=1.5.0
4-
pypdf>=5.3.0
5-
oracledb>=2.5.1
6-
pandas>=2.2.3
74
python-dotenv~=1.0.1
8-
Flask~=3.0.3
9-
sqlalchemy>=2.0.38

0 commit comments

Comments
 (0)