Skip to content

Commit 8f650cf

Browse files
committed
Merge branch 'main' of github.com:NHSDigital/bcss-playwright into feature/BCSS-20326-compartment5-pom-for-screening-practitioner-day-view
# Conflicts: # tests/smokescreen/test_compartment_5.py
2 parents 80dc467 + e3ab573 commit 8f650cf

File tree

4 files changed

+65
-19
lines changed

4 files changed

+65
-19
lines changed

.github/actions/run-playwright-tests/action.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1-
name: "Run Util & Example Tests"
1+
name: "Run Playwright Tests"
22
runs-on: ubuntu-latest
3-
timeout-minutes: 3
3+
timeout-minutes: 10
4+
5+
inputs:
6+
bcss_cloud_environment:
7+
description: "The environment to run against in lower case (e.g. bcss-1234)"
8+
required: true
9+
type: string
10+
marker_to_use:
11+
description: "The test marker to use when running tests (e.g. smokescreen)"
12+
required: true
13+
type: string
14+
415
runs:
516
using: "composite"
617
steps:
@@ -16,18 +27,15 @@ runs:
1627
- name: Ensure browsers are installed
1728
shell: bash
1829
run: python -m playwright install --with-deps
19-
- name: Run util tests
30+
- name: Run specified tests
2031
shell: bash
21-
run: pytest -m "utils" --ignore=tests/
22-
- uses: actions/upload-artifact@v4
23-
if: ${{ !cancelled() }}
24-
with:
25-
name: result-output-utils
26-
path: test-results/
27-
retention-days: 3
28-
- name: Run example tests
29-
shell: bash
30-
run: pytest --ignore=tests_utils/
32+
run: pytest -m ${{ inputs.marker_to_use }} --base-url=$URL_TO_USE --ignore=tests_utils/
33+
env:
34+
BCSS_PASS: ${{ secrets.BCSS_PASS }}
35+
ORACLE_DB: ${ ${{ secrets.ORACLE_DB }}/<REPLACE>/${{ inputs.bcss_cloud_environment }} }
36+
ORACLE_USERNAME: ${{ secrets.ORACLE_USERNAME }}
37+
ORACLE_PASS: ${{ secrets.ORACLE_PASS }}
38+
URL_TO_USE: ${ ${{ vars.CLOUD_ENV_URL }}/<REPLACE>/${{ inputs.bcss_cloud_environment }} }
3139
- uses: actions/upload-artifact@v4
3240
if: ${{ !cancelled() }}
3341
with:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Test Runner"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bcss_cloud_environment:
7+
description: "The environment to run against in lower case (e.g. bcss-1234)"
8+
required: true
9+
type: string
10+
default: "bcss-18680"
11+
marker_to_use:
12+
description: "The test marker to use when running tests (e.g. smokescreen)"
13+
required: true
14+
type: string
15+
16+
jobs:
17+
run-tests:
18+
name: "Run Specified Tests"
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 3
21+
steps:
22+
- name: "Checkout code"
23+
uses: actions/checkout@v4
24+
- name: "Run Tests"
25+
uses: ./.github/actions/run-playwright-tests
26+
with:
27+
bcss_cloud_environment: "${{ inputs.bcss_cloud_environment }}"
28+
marker_to_use: "${{ inputs.marker_to_use }}"

pages/screening_subject_search/subject_screening_summary.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def __init__(self, page: Page):
4848
self.first_fobt_episode_link = page.get_by_role(
4949
"link", name="FOBT Screening"
5050
).first
51+
self.datasets_link = self.page.get_by_role("link", name="Datasets")
52+
self.advance_fobt_screening_episode_button = self.page.get_by_role(
53+
"button", name="Advance FOBT Screening Episode"
54+
)
5155

5256
def verify_result_contains_text(self, text) -> None:
5357
expect(self.display_rs).to_contain_text(text)
@@ -122,6 +126,12 @@ def expand_episodes_list(self) -> None:
122126
def click_first_fobt_episode_link(self) -> None:
123127
self.click(self.first_fobt_episode_link)
124128

129+
def click_datasets_link(self) -> None:
130+
self.click(self.datasets_link)
131+
132+
def click_advance_fobt_screening_episode_button(self) -> None:
133+
self.click(self.advance_fobt_screening_episode_button)
134+
125135

126136
class ChangeScreeningStatusOptions(Enum):
127137
SEEKING_FURTHER_DATA = "4007"

tests/smokescreen/test_compartment_5.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from pages.screening_subject_search.subject_screening_summary import (
99
SubjectScreeningSummary,
1010
)
11-
from pages.screening_practitioner_appointments.screening_practitioner_day_view import(
11+
from pages.screening_practitioner_appointments.screening_practitioner_day_view import (
1212
ScreeningPractitionerDayView,
13-
)
13+
)
1414
from utils.user_tools import UserTools
1515
from utils.load_properties_file import PropertiesFile
1616
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
@@ -72,13 +72,13 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
7272
# Repeat for x Abnormal patients
7373

7474
# Navigate to the 'Subject Screening Summary' screen for the 1st Abnormal patient
75-
nhs_no = "9543076472" # Test NHS NO for Scaliding Cod
75+
nhs_no = "9937265193" # Test NHS NO for Scaliding Cod
7676
verify_subject_event_status_by_nhs_no(
7777
page, nhs_no, "J10 - Attended Colonoscopy Assessment Appointment"
7878
)
7979

8080
# Click on 'Datasets' link
81-
page.get_by_role("link", name="Datasets").click()
81+
SubjectScreeningSummary(page).click_datasets_link()
8282

8383
# Click on 'Show Dataset' next to the Colonoscopy Assessment
8484

@@ -103,7 +103,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
103103

104104
# On the Subject Screening Summary click on the 'Advance FOBT Screening Episode' button and then click on the 'Suitable for Endoscopic Test' button
105105
# Click OK after message
106-
page.get_by_role("button", name="Advance FOBT Screening Episode").click()
106+
SubjectScreeningSummary(page).click_advance_fobt_screening_episode_button()
107107
page.once("dialog", lambda dialog: dialog.accept())
108108
page.get_by_role("button", name="Suitable for Endoscopic Test").click()
109109

@@ -139,7 +139,7 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None:
139139
verify_subject_event_status_by_nhs_no(
140140
page, nhs_no, "A259 - Attended Diagnostic Test"
141141
)
142-
page.get_by_role("button", name="Advance FOBT Screening Episode").click()
142+
SubjectScreeningSummary(page).click_advance_fobt_screening_episode_button()
143143

144144
# Click 'Other Post-investigation Contact Required' button
145145
# Click 'OK'

0 commit comments

Comments
 (0)