Skip to content

Commit f87a688

Browse files
victor-soares-ibmadrianoaru-nhsmepr1
authored
Feature/bcss 20440 playwright utils markdown screening subject page searcher (#64)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Documenting the subject searcher page utility. ## Context <!-- Why is this change required? What problem does it solve? --> Following the coding guidelines, making it obvious how said utility works. ## 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) - [ ] 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. --------- Co-authored-by: adrianoaru-nhs <[email protected]> Co-authored-by: mepr1 <[email protected]>
1 parent 62ddfc5 commit f87a688

File tree

2 files changed

+314
-10
lines changed

2 files changed

+314
-10
lines changed
Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
# Utility Guide: Screening Subject Page Searcher
2+
3+
The Screening Subject Search utility allows for
4+
5+
- searching for relevant subjects using their NHS Number, forename, last name, DOB, postcode, episode closed date, status or latest event status
6+
- verifying the subject's event status using their NHS number
7+
8+
## Table of Contents
9+
10+
- [Utility Guide: Screening Subject Page Searcher](#utility-guide-screening-subject-page-searcher)
11+
- [Table of Contents](#table-of-contents)
12+
- [Functions Overview](#functions-overview)
13+
- [The page object parameter](#the-page-object-parameter)
14+
- [Verify subject event status by NHS no](#verify-subject-event-status-by-nhs-no)
15+
- [Arguments](#arguments)
16+
- [How This Function Works](#how-this-function-works)
17+
- [Search subject by NHS number](#search-subject-by-nhs-number)
18+
- [Arguments](#arguments-1)
19+
- [How This Function Works](#how-this-function-works-1)
20+
- [Search subject by surname](#search-subject-by-surname)
21+
- [Arguments](#arguments-2)
22+
- [How This Function Works](#how-this-function-works-2)
23+
- [Search subject by forename](#search-subject-by-forename)
24+
- [Arguments](#arguments-3)
25+
- [How This Function Works](#how-this-function-works-3)
26+
- [Search subject by date of birth](#search-subject-by-date-of-birth)
27+
- [Arguments](#arguments-4)
28+
- [How This Function Works](#how-this-function-works-4)
29+
- [Search subject by postcode](#search-subject-by-postcode)
30+
- [Arguments](#arguments-5)
31+
- [How This Function Works](#how-this-function-works-5)
32+
- [Search subject by episode closed date](#search-subject-by-episode-closed-date)
33+
- [Arguments](#arguments-6)
34+
- [How This Function Works](#how-this-function-works-6)
35+
- [Search subject by status](#search-subject-by-status)
36+
- [Arguments](#arguments-7)
37+
- [How This Function Works](#how-this-function-works-7)
38+
- [Search subject by latest event status](#search-subject-by-latest-event-status)
39+
- [Arguments](#arguments-8)
40+
- [How This Function Works](#how-this-function-works-8)
41+
- [Search subject by search area](#search-subject-by-search-area)
42+
- [Required Arguments](#required-arguments)
43+
- [Optional Arguments](#optional-arguments)
44+
- [How This Function Works](#how-this-function-works-9)
45+
- [Check clear filters button works](#check-clear-filters-button-works)
46+
- [Arguments](#arguments-9)
47+
- [How This Function Works](#how-this-function-works-10)
48+
49+
## Functions Overview
50+
51+
For this utility we have the following functions:
52+
53+
- `verify_subject_event_status_by_nhs_no`
54+
- `search_subject_by_nhs_number`
55+
- `search_subject_by_surname`
56+
- `search_subject_by_forename`
57+
- `search_subject_by_dob`
58+
- `search_subject_by_postcode`
59+
- `search_subject_by_episode_closed_date`
60+
- `search_subject_by_status`
61+
- `search_subject_by_latest_event_status`
62+
- `search_subject_by_search_area`
63+
- `check_clear_filters_button_works`
64+
65+
### The page object parameter
66+
67+
- Is required for all the listed functions above.
68+
- It is listed as an argument just once to avoid repetition.
69+
70+
### Verify subject event status by NHS no
71+
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.
74+
75+
#### Arguments
76+
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
86+
87+
#### How This Function Works
88+
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
94+
95+
### Search subject by NHS number
96+
97+
This searches for a subject by their NHS Number
98+
99+
#### Arguments
100+
101+
- `nhs_no`:
102+
- Type: `str`
103+
- This is the subject's NHS number. For example: 123 456 7890
104+
105+
#### How This Function Works
106+
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
109+
110+
### Search subject by surname
111+
112+
This searches for a subject by their surname
113+
114+
#### Arguments
115+
116+
- `surname`:
117+
- Type: `str`
118+
- This is the subject's surname
119+
120+
#### How This Function Works
121+
122+
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
124+
125+
### Search subject by forename
126+
127+
This searches for a subject by their forename
128+
129+
#### Arguments
130+
131+
- `forename`:
132+
- Type: `str`
133+
- This is the subject's forename
134+
135+
#### How This Function Works
136+
137+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
138+
2. It then fills in the forename filter field with the supplied forename and clicks the search button
139+
140+
### Search subject by date of birth
141+
142+
This searches for a subject by their date of birth
143+
144+
#### Arguments
145+
146+
- `dob`:
147+
- Type: `str`
148+
- This is the subject's date of birth
149+
150+
#### How This Function Works
151+
152+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
153+
2. It then fills in the date of birth filter field with the supplied DOB and clicks the search button
154+
155+
### Search subject by postcode
156+
157+
This searches for a subject by their postcode
158+
159+
#### Arguments
160+
161+
- `postcode`:
162+
- Type: `str`
163+
- This is the subject's postcode
164+
165+
#### How This Function Works
166+
167+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
168+
2. It then fills in the postcode filter field with the supplied postcode and clicks the search button
169+
170+
### Search subject by episode closed date
171+
172+
This searches for a subject by their episode closed date
173+
174+
#### Arguments
175+
176+
- `episode_closed_date`:
177+
- Type: `str`
178+
- This is the subject's episode closed date
179+
180+
#### How This Function Works
181+
182+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
183+
2. It then fills in the episode closed date filter field with the supplied date and clicks the search button
184+
185+
### Search subject by status
186+
187+
This searches for a subject by their screening status
188+
189+
#### Arguments
190+
191+
- `status`:
192+
- Type: `str`
193+
- This is the subject's screening status
194+
195+
#### How This Function Works
196+
197+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
198+
2. It then selects the screening status option that matches the supplied status and clicks the search button
199+
200+
### Search subject by latest event status
201+
202+
This searches for a subject by their latest event status
203+
204+
#### Arguments
205+
206+
- `status`:
207+
- Type: `str`
208+
- This is the subject's latest event status
209+
210+
#### How This Function Works
211+
212+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
213+
2. It then selects the episode status option that matches the supplied status and clicks the search button
214+
215+
### Search subject by search area
216+
217+
This searches for a subject by search area
218+
219+
#### Required Arguments
220+
221+
- `status`:
222+
- Type: `str`
223+
- This is the subject's screening status
224+
- `search_area`:
225+
- Type: `str`
226+
- This is the search area option to use
227+
228+
#### Optional Arguments
229+
230+
- `code`:
231+
- Type: `str`
232+
- `gp_practice_code`:
233+
- Type: `str`
234+
235+
#### How This Function Works
236+
237+
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
238+
2. It then selects the screening status option that matches the supplied status
239+
3. If provided, the code parameter is used to fill the appropriate code filter field
240+
4. If provided, the GP practice code parameter is used to fill the GP Practice in CCG filter field
241+
5. It then clicks the search button
242+
243+
### Check clear filters button works
244+
245+
This checks that the "clear filter" button works as intended
246+
247+
#### Arguments
248+
249+
- `nhs_no`:
250+
- Type: `str`
251+
- This is the subject's NHS number. For example: 123 456 7890
252+
253+
#### How This Function Works
254+
255+
1. It fills in the NHS number filter field with the supplied NHS number and verifies that the NHS number filter field contains the entered value
256+
2. It then clicks the clear filters button and verifies that the NHS number filter field is now empty

0 commit comments

Comments
 (0)