Skip to content

Commit e7cc3a8

Browse files
vale fixes
1 parent a12da86 commit e7cc3a8

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

docs/utility-guides/CalendarPicker.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The Calendar Picker utility allows us to use the different calendar pickers available on BCSS to select a date.
44

55
## Table of Contents
6-
6+
<!-- vale off -->
77
- [Utility Guide: Calendar Picker](#utility-guide-calendar-picker)
88
- [Table of Contents](#table-of-contents)
99
- [Functions Overview](#functions-overview)
@@ -43,7 +43,7 @@ The Calendar Picker utility allows us to use the different calendar pickers avai
4343
- [Select Day](#select-day)
4444
- [Required Arguments](#required-arguments-10)
4545
- [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)
4747
- [Required Arguments](#required-arguments-11)
4848
- [How This Function Works](#how-this-function-works-11)
4949
- [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
5252
- [Check For Eligible Appointment Dates](#check-for-eligible-appointment-dates)
5353
- [Required Arguments](#required-arguments-13)
5454
- [How This Function Works](#how-this-function-works-13)
55-
55+
<!-- vale on -->
5656
## Functions Overview
5757

5858
For this utility we have the following methods:
59-
59+
<!-- vale off -->
6060
- `calendar_picker_ddmmyyyy`
6161
- `calendar_picker_ddmonyy`
6262
- `v1_calender_picker`
@@ -73,9 +73,9 @@ For this utility we have the following methods:
7373
- `check_for_eligible_appointment_dates`
7474

7575
### Calendar Picker ddmmyyyy
76-
76+
<!-- vale on -->
7777
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).
7979

8080
#### Required Arguments
8181

@@ -90,11 +90,11 @@ You provide a date and a playwright locator and it will enter the date in the fo
9090

9191
1. This calls the `format_date` method from DateTimeUtils to get the date in the correct format.
9292
2. Once the date is formatted correctly it enters it into the provided locator.
93-
93+
<!-- vale off -->
9494
### Calendar Picker ddmonyy
95-
95+
<!-- vale on -->
9696
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).
9898

9999
#### Required Arguments
100100

@@ -108,13 +108,13 @@ You provide a date and a playwright locator and it will enter the date in the fo
108108
#### How This Function Works
109109

110110
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.
112112
2. From here it calls the correct formatting option.
113113
2. Once the date is formatted correctly it enters it into the provided locator.
114114

115115
### V1 Calendar Picker
116116

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.
118118

119119
#### Required Arguments
120120

@@ -124,11 +124,11 @@ This is called to select a date from the V1 calender picker, which can be seen o
124124

125125
#### How This Function Works
126126

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`.
128128
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`.
129129
3. Once we know how many times each button needs to be clicked we call the method: `traverse_years_in_v1_calendar`.
130130
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.
132132

133133
### Calculate Years and Months to Traverse
134134

@@ -193,7 +193,7 @@ This is called to move the V1 calendar picker to the correct month.
193193

194194
### V2 Calendar Picker
195195

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.
197197

198198
#### Required Arguments
199199

@@ -206,7 +206,7 @@ This is called to select a date using the V2 calendar picker, which cna be seen
206206
1. Firstly it stores the current date in a variable: `current_date`.
207207
2. Then `current_date` and `date` are passed onto the `calculate_v2_calendar_variables` method to calculate the necessary variables to traverse this calendar.
208208
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.
210210
5. Finally we call the `select_day` method to select the correct day from the calendar picker.
211211

212212
### Calculate V2 Calendar Variables
@@ -235,10 +235,10 @@ This is called to calculate all, of the variables needed to traverse the V2 cale
235235
- This is the month we want to go to as a shorter string: *Jun* / *Apr*
236236
- `current_year`:
237237
- 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*
239239
- `year`:
240240
- 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*
242242
- `current_decade`:
243243
- Type: `int`
244244
- 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
263263
2. E.g. 2025 // 100 = 20
264264
3. 20 * 100 = 2000
265265
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`.
267267
2. E.g. 2025 - 2000 = 25
268268
3. 25 // 10 = 2
269269
4. 2 * 10 = 20
@@ -273,7 +273,7 @@ This is called to calculate all, of the variables needed to traverse the V2 cale
273273

274274
### V2 Calendar Picker Traverse Back
275275

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.
277277

278278
#### Required Arguments
279279

@@ -285,10 +285,10 @@ This is called to "go back" in the V2 calendar picker. It expands the scope of a
285285
- This is the month we want to select as a string: *June*
286286
- `current_year`:
287287
- 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*
289289
- `year`:
290290
- 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*
292292
- `current_decade`
293293
- Type: `int`
294294
- 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
377377

378378
### Select Day
379379

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.
381381

382382
#### Required Arguments
383383

@@ -400,7 +400,7 @@ This is called to select the day of the date we want othe calendar picker to go
400400
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`.
401401
3. Otherwise if `number_of_cells_with_day` is set to 1, we select that date.
402402

403-
### Book First Eligbile Appointment
403+
### Book First Eligible Appointment
404404

405405
This is called to select the first date with appointment slots available
406406

@@ -444,13 +444,13 @@ This is called to move the book appointments calendar to the month we desire.
444444

445445
#### How This Function Works
446446

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`.
448448
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.
449449
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.
450450

451451
### Check For Eligible Appointment Dates
452452

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.
454454

455455
#### Required Arguments
456456

@@ -459,13 +459,13 @@ This function loops through all of the appointment date cells to click on the fi
459459
- This is the locator for all of the appointment date cells
460460
- `bg_colours`:
461461
- 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
463463

464464
#### How This Function Works
465465

466466
1. Firstly it gets the number of total cells and stores them in the variable `locator_count`.
467467
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.
470470
1. If it is less than 5 characters long, it belongs to the first calendar on the screen and is clicked.
471471
2. Otherwise it is ignored.

0 commit comments

Comments
 (0)