@@ -48,6 +48,11 @@ def test_user_views_clinic_show_page_with_special_appointments(self):
4848 self .when_i_click_on_the_special_appointment ()
4949 self .then_i_can_see_the_special_appointment_banner ()
5050
51+ def test_accessibility (self ):
52+ self .given_there_are_appointments ()
53+ self .and_i_am_on_the_clinic_show_page ()
54+ self .then_the_accessibility_baseline_is_met ()
55+
5156 def given_there_are_appointments (self ):
5257 self .confirmed_appointment = AppointmentFactory (
5358 clinic_slot__clinic = self .clinic ,
@@ -56,6 +61,13 @@ def given_there_are_appointments(self):
5661 screening_episode__participant__first_name = "Janet" ,
5762 screening_episode__participant__last_name = "Confirmed" ,
5863 )
64+ self .another_confirmed_appointment = AppointmentFactory (
65+ clinic_slot__clinic = self .clinic ,
66+ clinic_slot__starts_at = datetime .now (timezone .utc ).replace (hour = 9 , minute = 0 ),
67+ screening_episode__participant__first_name = "Also" ,
68+ screening_episode__participant__last_name = "Confirmed" ,
69+ current_status = AppointmentStatus .CONFIRMED ,
70+ )
5971 self .checked_in_appointment = AppointmentFactory (
6072 clinic_slot__clinic = self .clinic ,
6173 clinic_slot__starts_at = datetime .now (timezone .utc ).replace (
@@ -74,6 +86,12 @@ def given_there_are_appointments(self):
7486 def given_i_am_on_the_clinic_list (self ):
7587 self .page .goto (self .live_server_url + reverse ("clinics:index" ))
7688
89+ def and_i_am_on_the_clinic_show_page (self ):
90+ self .page .goto (
91+ self .live_server_url
92+ + reverse ("clinics:show" , kwargs = {"pk" : self .clinic .pk })
93+ )
94+
7795 def when_i_click_on_the_clinic (self ):
7896 self .page .get_by_role ("link" , name = "West London BSS" ).click ()
7997
@@ -86,10 +104,15 @@ def then_i_should_see_the_clinic_show_page(self):
86104 def and_i_can_see_remaining_appointments (self ):
87105 remaining_link = self .page .get_by_role ("link" , name = re .compile ("Remaining" ))
88106 count_span = remaining_link .locator (".app-count" )
89- expect (count_span ).to_contain_text ("2 " )
107+ expect (count_span ).to_contain_text ("3 " )
90108 rows = self .page .locator ("table.nhsuk-table tbody tr" ).all ()
91109 self ._expect_rows_to_match_appointments (
92- rows , [self .confirmed_appointment , self .checked_in_appointment ]
110+ rows ,
111+ [
112+ self .confirmed_appointment ,
113+ self .another_confirmed_appointment ,
114+ self .checked_in_appointment ,
115+ ],
93116 )
94117
95118 def when_i_click_on_checked_in (self ):
@@ -118,19 +141,22 @@ def when_i_click_on_all(self):
118141 def then_i_can_see_all_appointments (self ):
119142 all_link = self .page .get_by_role ("link" , name = re .compile ("All" ))
120143 count_span = all_link .locator (".app-count" )
121- expect (count_span ).to_contain_text ("3 " )
144+ expect (count_span ).to_contain_text ("4 " )
122145 rows = self .page .locator ("table.nhsuk-table tbody tr" ).all ()
123146 self ._expect_rows_to_match_appointments (
124147 rows ,
125148 [
126149 self .confirmed_appointment ,
150+ self .another_confirmed_appointment ,
127151 self .checked_in_appointment ,
128152 self .screened_appointment ,
129153 ],
130154 )
131155
132156 def when_i_check_in_an_appointment (self ):
133- self .page .get_by_role ("button" , name = re .compile ("Check in" )).click ()
157+ self .page .get_by_role (
158+ "button" , name = re .compile ("Check in Janet Confirmed" )
159+ ).click ()
134160
135161 def then_the_appointment_is_checked_in (self ):
136162 row = self .page .locator ("tr" ).filter (has_text = "Janet Confirmed" )
@@ -141,6 +167,7 @@ def and_the_appointments_remain_in_the_same_order(self):
141167 rows = self .page .locator ("table.nhsuk-table tbody tr" ).all ()
142168 expected_times = [
143169 format_time (self .confirmed_appointment .clinic_slot .starts_at ),
170+ format_time (self .another_confirmed_appointment .clinic_slot .starts_at ),
144171 format_time (self .checked_in_appointment .clinic_slot .starts_at ),
145172 format_time (self .screened_appointment .clinic_slot .starts_at ),
146173 ]
0 commit comments