You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- markdownlint-disable-next-line first-line-heading -->
## Description
<!-- Describe your changes in detail. -->
Altering the utility markdown document to address comments found in
reviews.
## Context
<!-- Why is this change required? What problem does it solve? -->
Makes the utility easier to understand
## 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)
- [x] 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.
@@ -64,193 +34,78 @@ For this utility we have the following functions:
64
34
65
35
### The page object parameter
66
36
67
-
- Is required for all the listed functions above.
68
-
- It is listed as an argument just once to avoid repetition.
37
+
All functions require the Playwright `page` object as their first argument.
69
38
70
-
### Verify subject event status by NHS no
39
+
---
71
40
72
-
This is used to check that the latest event status of a subject has been updated to what is expected.
73
-
The provided NHS no is used to search the whole database and then verifies the latest event status is as expected.
41
+
### Function Summaries & Example Usage
74
42
75
-
#### Arguments
43
+
#### verify_subject_event_status_by_nhs_no
76
44
77
-
-`page`:
78
-
- Type: `Page`
79
-
- This is the playwright page object which is used to tell playwright what page the test is currently on
80
-
-`nhs_no`:
81
-
- Type: `str`
82
-
- This is the subject's NHS number. For example: 123 456 7890
83
-
-`latest_event_status`:
84
-
- Type: `str`
85
-
- This is the expected status of the subject that is being verified
45
+
Navigates to the subject screening search page and searches for the provided NHS Number. Then this checks that the latest event status of the subject matches the expected value(s).
86
46
87
-
#### How This Function Works
47
+
**Arguments:**
88
48
89
-
1. It starts off by navigating to the main menu if not already on this page. This is done to ensure that this can be called from any page
90
-
2. Once on the main menu it navigates to the screening subject search page
91
-
3. From here it fills in the NHS number filter field with the supplied NHS number and chooses the whole area database as the search area option
92
-
4. It then clicks the search button
93
-
5. Once the subject is returned, it then verifies that the latest event status matches the supplied event status
49
+
-`page`: Playwright page object
50
+
-`nhs_no`: `str` — The subject's NHS number
51
+
-`latest_event_status`: `str | list[str]` — The expected status or list of statuses to verify
94
52
95
-
### Search subject by NHS number
53
+
**Example:**
96
54
97
-
This searches for a subject by their NHS Number
55
+
```python
56
+
verify_subject_event_status_by_nhs_no(page, "1234567890", "S61 - Normal (No Abnormalities Found)")
57
+
verify_subject_event_status_by_nhs_no(page, "1234567890", ["S61 - Normal (No Abnormalities Found)", "A158 - High-risk findings"])
58
+
```
98
59
99
-
#### Arguments
60
+
---
100
61
101
-
-`nhs_no`:
102
-
- Type: `str`
103
-
- This is the subject's NHS number. For example: 123 456 7890
62
+
#### Search Functions
104
63
105
-
#### How This Function Works
64
+
All search functions follow a similar pattern: they clear filters, fill in the relevant field, and perform a search.
106
65
107
-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
108
-
2. It then fills in the NHS number filter field with the supplied NHS number and clicks the search button
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
123
-
2. It then fills in the surname filter field with the supplied surname and clicks the search button
96
+
Checks that the "clear filters" button works as intended. It enters the provided NHS number, clicks the clear filters button, and then verifies that the filters are cleared.
0 commit comments