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
@@ -43,7 +43,7 @@ The Calendar Picker utility allows us to use the different calendar pickers avai
43
43
-[Select Day](#select-day)
44
44
-[Required Arguments](#required-arguments-10)
45
45
-[How This Function Works](#how-this-function-works-10)
46
-
-[Book First Eligbile Appointment](#book-first-eligbile-appointment)
46
+
-[Book First Eligible Appointment](#book-first-eligible-appointment)
47
47
-[Required Arguments](#required-arguments-11)
48
48
-[How This Function Works](#how-this-function-works-11)
49
49
-[Book Appointments Go To Month](#book-appointments-go-to-month)
@@ -52,11 +52,11 @@ The Calendar Picker utility allows us to use the different calendar pickers avai
52
52
-[Check For Eligible Appointment Dates](#check-for-eligible-appointment-dates)
53
53
-[Required Arguments](#required-arguments-13)
54
54
-[How This Function Works](#how-this-function-works-13)
55
-
55
+
<!-- vale on -->
56
56
## Functions Overview
57
57
58
58
For this utility we have the following methods:
59
-
59
+
<!-- vale off -->
60
60
-`calendar_picker_ddmmyyyy`
61
61
-`calendar_picker_ddmonyy`
62
62
-`v1_calender_picker`
@@ -73,9 +73,9 @@ For this utility we have the following methods:
73
73
-`check_for_eligible_appointment_dates`
74
74
75
75
### Calendar Picker ddmmyyyy
76
-
76
+
<!-- vale on -->
77
77
This is called to enter a date in the correct format for the V1 calendar picker.
78
-
You provide a date and a playwright locator and it will enter the date in the format dd/mm/yyyy (e.g. 16/01/2025).
78
+
You provide a date and a playwright locator and it will enter the date in the format `dd/mm/yyyy` (e.g. 16/01/2025).
79
79
80
80
#### Required Arguments
81
81
@@ -90,11 +90,11 @@ You provide a date and a playwright locator and it will enter the date in the fo
90
90
91
91
1. This calls the `format_date` method from DateTimeUtils to get the date in the correct format.
92
92
2. Once the date is formatted correctly it enters it into the provided locator.
93
-
93
+
<!-- vale off -->
94
94
### Calendar Picker ddmonyy
95
-
95
+
<!-- vale on -->
96
96
This is called to enter a date in the correct format for the V2 calendar picker.
97
-
You provide a date and a playwright locator and it will enter the date in the format dd month yy (e.g. 16 Jan 25).
97
+
You provide a date and a playwright locator and it will enter the date in the format `dd month yy` (e.g. 16 Jan 25).
98
98
99
99
#### Required Arguments
100
100
@@ -108,13 +108,13 @@ You provide a date and a playwright locator and it will enter the date in the fo
108
108
#### How This Function Works
109
109
110
110
1. This calls the `format_date` method from DateTimeUtils to get the date in the correct format.
111
-
1. As the formatting for the python datetime function differes between operating systems, there is a check first to see what OS is in use.
111
+
1. As the formatting for the datetime function differes between operating systems, there is a check first to see what OS is in use.
112
112
2. From here it calls the correct formatting option.
113
113
2. Once the date is formatted correctly it enters it into the provided locator.
114
114
115
115
### V1 Calendar Picker
116
116
117
-
This is called to select a date from the V1 calender picker, which can be seen on the Subject Screening Search page.
117
+
This is called to select a date from the V1 calendar picker, which can be seen on the Subject Screening Search page.
118
118
119
119
#### Required Arguments
120
120
@@ -124,11 +124,11 @@ This is called to select a date from the V1 calender picker, which can be seen o
124
124
125
125
#### How This Function Works
126
126
127
-
1. This starts of by getting the current date the the calendar picker is on and storing it in a variable: `current_date`.
127
+
1. This starts of by getting the current date that the calendar picker is on and storing it in a variable: `current_date`.
128
128
2. Once that is done it calls the `calculate_years_and_months_to_traverse` method to know how many times to click each button to increase/decrease the years or months, and stores them in: `years_to_traverse` and `months_to_traverse`.
129
129
3. Once we know how many times each button needs to be clicked we call the method: `traverse_years_in_v1_calendar`.
130
130
4. After the correct year is selected we call the `traverse_months_in_v1_calendar` method to get to the correct month.
131
-
5. Finally, after the correcft year and month is displayed we call the `select_day` method.
131
+
5. Finally, after the correct year and month is displayed we call the `select_day` method.
132
132
133
133
### Calculate Years and Months to Traverse
134
134
@@ -193,7 +193,7 @@ This is called to move the V1 calendar picker to the correct month.
193
193
194
194
### V2 Calendar Picker
195
195
196
-
This is called to select a date using the V2 calendar picker, which cna be seen on the Active Batch List page.
196
+
This is called to select a date using the V2 calendar picker, which can be seen on the Active Batch List page.
197
197
198
198
#### Required Arguments
199
199
@@ -206,7 +206,7 @@ This is called to select a date using the V2 calendar picker, which cna be seen
206
206
1. Firstly it stores the current date in a variable: `current_date`.
207
207
2. Then `current_date` and `date` are passed onto the `calculate_v2_calendar_variables` method to calculate the necessary variables to traverse this calendar.
208
208
3. Once these variable have been calculated we call the `v2_calendar_picker_traverse_back` method to "go back in time" an expand the view of available years.
209
-
4. After we have traversed far back enough to be able to select the years we want, we call the `v2_calendar_picker_traverse_forward` methos which will take us the the year and month we want to go to.
209
+
4. After we have traversed far back enough to be able to select the years we want, we call the `v2_calendar_picker_traverse_forward` methos which will take us to the year and month we want to go to.
210
210
5. Finally we call the `select_day` method to select the correct day from the calendar picker.
211
211
212
212
### Calculate V2 Calendar Variables
@@ -235,10 +235,10 @@ This is called to calculate all, of the variables needed to traverse the V2 cale
235
235
- This is the month we want to go to as a shorter string: *Jun* / *Apr*
236
236
-`current_year`:
237
237
- Type: `int`
238
-
- This is the current year as an integer in yyyy format: *2025*
238
+
- This is the current year as an integer in `yyyy` format: *2025*
239
239
-`year`:
240
240
- Type: `int`
241
-
- This is the year we want to go to as an integer in yyyy format: *1996*
241
+
- This is the year we want to go to as an integer in `yyyy` format: *1996*
242
242
-`current_decade`:
243
243
- Type: `int`
244
244
- This is the current decade we are in: *2020*
@@ -263,7 +263,7 @@ This is called to calculate all, of the variables needed to traverse the V2 cale
263
263
2. E.g. 2025 // 100 = 20
264
264
3. 20 * 100 = 2000
265
265
4. After we calculate `current_decade`.
266
-
1. This is achieved by subtrracting`current_century` from `current_year`, then dividing the result by 10 and multiplying that by 10. Finally we add this result back to `current_century`.
266
+
1. This is achieved by subtracting`current_century` from `current_year`, then dividing the result by 10 and multiplying that by 10. Finally we add this result back to `current_century`.
267
267
2. E.g. 2025 - 2000 = 25
268
268
3. 25 // 10 = 2
269
269
4. 2 * 10 = 20
@@ -273,7 +273,7 @@ This is called to calculate all, of the variables needed to traverse the V2 cale
273
273
274
274
### V2 Calendar Picker Traverse Back
275
275
276
-
This is called to "go back" in the V2 calendar picker. It expands the scope of avaialbe years to select which makes traversing this calendar quicker if we need to select a date manyh years in the future or past.
276
+
This is called to "go back" in the V2 calendar picker. It expands the scope of available years to select which makes traversing this calendar quicker if we need to select a date many years in the future or past.
277
277
278
278
#### Required Arguments
279
279
@@ -285,10 +285,10 @@ This is called to "go back" in the V2 calendar picker. It expands the scope of a
285
285
- This is the month we want to select as a string: *June*
286
286
-`current_year`:
287
287
- Type: `int`
288
-
- This is the current year as an integer in yyyy format: *2025*
288
+
- This is the current year as an integer in `yyyy` format: *2025*
289
289
-`year`:
290
290
- Type: `int`
291
-
- This is the year of the date we want to select as an integer in yyyy format: *1996*
291
+
- This is the year of the date we want to select as an integer in `yyyy` format: *1996*
292
292
-`current_decade`
293
293
- Type: `int`
294
294
- This is the current decade we are in: *2020*
@@ -377,7 +377,7 @@ This is called to narrow down the scope of available years on the V2 calendar pi
377
377
378
378
### Select Day
379
379
380
-
This is called to select the day of the date we want othe calendar picker to go to.
380
+
This is called to select the day of the date we want the calendar picker to go to.
381
381
382
382
#### Required Arguments
383
383
@@ -400,7 +400,7 @@ This is called to select the day of the date we want othe calendar picker to go
400
400
2. If the date we want to select is greater than 15 and `number_of_cells_with_day` is greater than 1, we select the last option in `all_days`.
401
401
3. Otherwise if `number_of_cells_with_day` is set to 1, we select that date.
402
402
403
-
### Book First Eligbile Appointment
403
+
### Book First Eligible Appointment
404
404
405
405
This is called to select the first date with appointment slots available
406
406
@@ -444,13 +444,13 @@ This is called to move the book appointments calendar to the month we desire.
444
444
445
445
#### How This Function Works
446
446
447
-
1. Firstly it caclulates the difference between `current_displayed_month` and `wanted_month`anmd stores the result in `month_difference`.
447
+
1. Firstly it caclulates the difference between `current_displayed_month` and `wanted_month`and stores the result in `month_difference`.
448
448
2. Then if `month_difference` is greater than 0, it runs a for loop for the value of `month_difference` clicking on the previous month button once per loop.
449
449
3. If `month_difference` is less than 0, it runs a for loop for the value of `month_difference` clicking on the next month button once per loop.
450
450
451
451
### Check For Eligible Appointment Dates
452
452
453
-
This function loops through all of the appointment date cells to click on the first avaiable date.
453
+
This function loops through all of the appointment date cells to click on the first available date.
454
454
455
455
#### Required Arguments
456
456
@@ -459,13 +459,13 @@ This function loops through all of the appointment date cells to click on the fi
459
459
- This is the locator for all of the appointment date cells
460
460
-`bg_colours`:
461
461
- Type: `list`
462
-
- This is a list contaning all of the background colours we want to click on
462
+
- This is a list containing all of the background colours we want to click on
463
463
464
464
#### How This Function Works
465
465
466
466
1. Firstly it gets the number of total cells and stores them in the variable `locator_count`.
467
467
2. Then it runs a `FOR` loop for the value stored in `locator_count`.
468
-
3. Here it loops through each locator checking if the background colout matches any provided in `bg_colours`.
469
-
4. If it find a match then it checks the length on the "name" attribure of that cell.
468
+
3. Here it loops through each locator checking if the background colour matches any provided in `bg_colours`.
469
+
4. If it find a match then it checks the length on the "name" attribute of that cell.
470
470
1. If it is less than 5 characters long, it belongs to the first calendar on the screen and is clicked.
0 commit comments