Skip to content

Commit 01bd025

Browse files
mepr1Andyg79adrianoaru-nhs
authored
Feature/bcss 20550 c6 logging (#78)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description Adding logging to compartment 6 ## Context Logging helps with debugging, monitoring browser activity, tracking test steps, during test execution. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [ x] Refactoring (non-breaking change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ x] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [x ] I have followed the code style of the project - [ ] I have added tests to cover my changes (where appropriate) - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes. --------- Co-authored-by: AndyG <[email protected]> Co-authored-by: adrianoaru-nhs <[email protected]> Co-authored-by: Adriano Aru <[email protected]>
1 parent 95a942d commit 01bd025

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

tests/smokescreen/test_compartment_6.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,58 +41,97 @@ def test_compartment_6(page: Page, smokescreen_properties: dict) -> None:
4141
smokescreen_properties["c6_eng_number_of_subjects_to_record"],
4242
smokescreen_properties["c6_eng_org_id"],
4343
)
44+
logging.info("Fetched subjects for investigation dataset updates.")
4445
nhs_no = subjects_df["subject_nhs_number"].iloc[0]
46+
logging.info(f"Selected NHS number for older subject: {nhs_no}")
4547
SubjectDemographicUtil(page).update_subject_dob(nhs_no, False)
48+
logging.info(
49+
f"Updated date of birth for NHS number {nhs_no} to indicate an older subject."
50+
)
4651
InvestigationDatasetCompletion(page).complete_with_result(
4752
nhs_no, InvestigationDatasetResults.HIGH_RISK
4853
)
54+
logging.info(
55+
f"Completed investigation dataset for NHS number {nhs_no} with result: HIGH_RISK."
56+
)
4957
AfterInvestigationDatasetComplete(page).progress_episode_based_on_result(
5058
InvestigationDatasetResults.HIGH_RISK, False
5159
)
60+
logging.info(
61+
f"Progressed episode for NHS number {nhs_no} based on result: HIGH_RISK."
62+
)
5263

5364
# Younger patient - High Risk Result
5465
logging.info("High-risk result for a younger subject")
5566
nhs_no = subjects_df["subject_nhs_number"].iloc[1]
67+
logging.info(f"Selected NHS number for younger subject: {nhs_no}")
5668
SubjectDemographicUtil(page).update_subject_dob(nhs_no, True)
69+
logging.info(
70+
f"Updated date of birth for NHS number {nhs_no} to indicate a younger subject."
71+
)
5772
InvestigationDatasetCompletion(page).complete_with_result(
5873
nhs_no, InvestigationDatasetResults.HIGH_RISK
5974
)
75+
logging.info(
76+
f"Completed investigation dataset for NHS number {nhs_no} with result: HIGH_RISK."
77+
)
6078
AfterInvestigationDatasetComplete(page).progress_episode_based_on_result(
6179
InvestigationDatasetResults.HIGH_RISK, True
6280
)
81+
logging.info(
82+
f"Progressed episode for NHS number {nhs_no} based on result: HIGH_RISK."
83+
)
6384

6485
# Older patient - LNPCP Result
6586
logging.info("LNPCP result for an older subject")
6687
nhs_no = subjects_df["subject_nhs_number"].iloc[2]
88+
logging.info(f"Selected NHS number for older subject: {nhs_no}")
6789
SubjectDemographicUtil(page).update_subject_dob(nhs_no, False)
90+
logging.info(
91+
f"Updated date of birth for NHS number {nhs_no} to indicate an older subject."
92+
)
6893
InvestigationDatasetCompletion(page).complete_with_result(
6994
nhs_no, InvestigationDatasetResults.LNPCP
7095
)
96+
logging.info(
97+
f"Completed investigation dataset for NHS number {nhs_no} with result: LNPCP."
98+
)
7199
AfterInvestigationDatasetComplete(page).progress_episode_based_on_result(
72100
InvestigationDatasetResults.LNPCP, False
73101
)
102+
logging.info(f"Progressed episode for NHS number {nhs_no} based on result: LNPCP.")
74103

75104
# Younger patient - LNPCP Result
76105
logging.info("LNPCP result for a younger subject")
77106
nhs_no = subjects_df["subject_nhs_number"].iloc[3]
107+
logging.info(f"Selected NHS number for younger subject: {nhs_no}")
78108
SubjectDemographicUtil(page).update_subject_dob(nhs_no, True)
109+
logging.info(f"Updated date of birth for NHS number {nhs_no} to indicate a younger subject.")
79110
InvestigationDatasetCompletion(page).complete_with_result(
80111
nhs_no, InvestigationDatasetResults.LNPCP
81112
)
113+
logging.info(f"Completed investigation dataset for NHS number {nhs_no} with result: LNPCP.")
82114
AfterInvestigationDatasetComplete(page).progress_episode_based_on_result(
83115
InvestigationDatasetResults.LNPCP, True
84116
)
117+
logging.info(f"Progressed episode for NHS number {nhs_no} based on result: LNPCP.")
85118

86119
# Any patient - Normal Result
87120
logging.info("Normal result for any age subject")
88121
nhs_no_normal = subjects_df["subject_nhs_number"].iloc[4]
122+
logging.info(f"Selected NHS number for normal result: {nhs_no_normal}")
89123
InvestigationDatasetCompletion(page).complete_with_result(
90124
nhs_no_normal, InvestigationDatasetResults.NORMAL
91125
)
126+
logging.info(
127+
f"Completed investigation dataset for NHS number {nhs_no_normal} with result: NORMAL."
128+
)
92129
AfterInvestigationDatasetComplete(page).progress_episode_based_on_result(
93130
InvestigationDatasetResults.NORMAL, True
94131
)
95-
132+
logging.info(f"Progressed episode for NHS number {nhs_no_normal} based on result: NORMAL.")
133+
# Batch processing for result letters
134+
logging.info("Starting batch processing for result letters.")
96135
batch_processing(
97136
page,
98137
"A318",

0 commit comments

Comments
 (0)