@@ -18,6 +18,7 @@ class pg_sessions:
1818 LNK_TAB_TODAY = "Today"
1919 LNK_TAB_SCHEDULED = "Scheduled"
2020 LNK_TAB_UNSCHEDULED = "Unscheduled"
21+ LNK_TAB_NO_RESPONSE = "No response"
2122 LNK_TAB_ACTIVITY_LOG = "Activity log"
2223 LNK_IMPORT_CLASS_LIST = "Import class list"
2324 LBL_CHOOSE_COHORT_FILE_1 = f"{ LNK_SCHOOL_1 } Import class"
@@ -26,6 +27,7 @@ class pg_sessions:
2627 LNK_ADD_SESSION_DATES = "Add session dates"
2728 LNK_RECORD_VACCINATIONS = "Record vaccinations"
2829 LNK_CHILD_FULL_NAME = "CF"
30+ LNK_CHILD_NO_CONSENT = "NoConsent1 NoConsent1"
2931 LNK_UPDATE_TRIAGE_OUTCOME = "Update triage outcome"
3032 LNK_SCHEDULE_SESSIONS = "Schedule sessions"
3133 RDO_YES_SAFE_TO_VACCINATE = "Yes, it’s safe to vaccinate"
@@ -42,15 +44,15 @@ class pg_sessions:
4244 LNK_BACK = "Back"
4345 LNK_CONTINUE = "Continue"
4446 LNK_CONSENT_FORM = "View parental consent form (opens in new tab)"
45- BTN_CHECK_CONSENT_RESPONSES = "Check consent responses"
4647 LNK_ASSESS_GILLICK_COMPETENT = "Assess Gillick competence"
4748 RDO_YES_GILLICK_COMPETENT = "Yes, they are Gillick competent"
4849 RDO_NO_GILLICK_COMPETENT = "No"
4950 TXT_GILLICK_ASSESSMENT_DETAILS = "Assessment notes (optional)"
5051 BTN_SAVE_CHANGES = "Save changes"
5152 LBL_ACTIVITY_LOG_ENTRY_CONSENT_GIVEN = "Triaged decision: Safe to vaccinate"
5253 LBL_ACTIVITY_LOG_ENTRY_CONSENT_REFUSED = "Consent refused by Parent1 (Dad)"
53- BTN_GET_CONSENT_RESPONSES = "Get consent response"
54+ BTN_GET_CONSENT_RESPONSE = "Get consent response"
55+ LNK_CHECK_CONSENT_RESPONSES = "Check consent responses"
5456 BTN_COMPLETE_GILLICK_ASSESSMENT = "Complete your assessment"
5557 LBL_CHILD_COMPETENT = "Child assessed as Gillick competent"
5658 LBL_CHILD_NOT_COMPETENT = "Child assessed as not Gillick competent"
@@ -59,6 +61,9 @@ class pg_sessions:
5961 LNK_CONSENT_FORM = "View parental consent form ("
6062 LNK_COULD_NOT_VACCINATE = "Could not vaccinate"
6163 LNK_CONSENT_REFUSED = "Consent refused"
64+ LNK_MARK_AS_INVALID = "Mark as invalid"
65+ LNK_PARENT2 = "Parent2"
66+ TXT_NOTES = "Notes"
6267
6368 def __get_display_formatted_date (self , date_to_format : str ) -> str :
6469 _parsed_date = datetime .strptime (date_to_format , "%Y%m%d" )
@@ -86,6 +91,9 @@ def click_scheduled(self):
8691 def click_unscheduled (self ):
8792 self .po .perform_action (locator = self .LNK_TAB_UNSCHEDULED , action = actions .CLICK_LINK , exact = True )
8893
94+ def click_no_response (self ):
95+ self .po .perform_action (locator = self .LNK_TAB_NO_RESPONSE , action = actions .CLICK_LINK , exact = False )
96+
8997 def click_activity_log (self ):
9098 self .po .perform_action (locator = self .LNK_TAB_ACTIVITY_LOG , action = actions .CLICK_LINK , exact = True )
9199
@@ -114,6 +122,9 @@ def click_record_vaccinations(self):
114122 def click_child_full_name (self ):
115123 self .po .perform_action (locator = self .LNK_CHILD_FULL_NAME , action = actions .CLICK_WILDCARD )
116124
125+ def click_child_no_consent (self ):
126+ self .po .perform_action (locator = self .LNK_CHILD_NO_CONSENT , action = actions .CLICK_LINK )
127+
117128 def click_update_triage_outcome (self ):
118129 self .po .perform_action (locator = self .LNK_UPDATE_TRIAGE_OUTCOME , action = actions .CLICK_LINK )
119130
@@ -124,7 +135,7 @@ def click_save_triage(self):
124135 self .po .perform_action (locator = self .BTN_SAVE_TRIAGE , action = actions .CLICK_BUTTON )
125136
126137 def click_check_consent_responses (self ):
127- self .po .perform_action (locator = self .BTN_CHECK_CONSENT_RESPONSES , action = actions .CLICK_LINK )
138+ self .po .perform_action (locator = self .LNK_CHECK_CONSENT_RESPONSES , action = actions .CLICK_LINK )
128139
129140 def click_assess_gillick_competent (self ):
130141 self .po .perform_action (locator = self .LNK_ASSESS_GILLICK_COMPETENT , action = actions .CLICK_LINK )
@@ -280,12 +291,30 @@ def verify_activity_log_entry(self, consent_given: bool):
280291 exact = False ,
281292 )
282293
294+ def invalidate_parent2_refusal (self ):
295+ self .po .perform_action (locator = self .LNK_PARENT2 , action = actions .CLICK_LINK )
296+ self .po .perform_action (locator = self .LNK_MARK_AS_INVALID , action = actions .CLICK_LINK )
297+ self .po .perform_action (locator = self .TXT_NOTES , action = actions .FILL , value = "Invalidation notes." )
298+ self .po .perform_action (locator = self .LNK_MARK_AS_INVALID , action = actions .CLICK_BUTTON )
299+ self .po .verify (locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Consent refusedInvalid" )
300+ self .po .verify (locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Invalidation notes." )
301+ self .po .perform_action (locator = self .LNK_BACK , action = actions .CLICK_LINK )
302+ self .po .verify (locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Consent refusedInvalid" )
303+ self .po .verify (
304+ locator = self .LBL_MAIN ,
305+ property = object_properties .TEXT ,
306+ value = "No-one responded to our requests for consent." ,
307+ )
308+
283309 def verify_scheduled_date (self , message : str ):
284310 self .po .verify (locator = self .LBL_MAIN , property = object_properties .TEXT , value = message , exact = False )
285311 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_LINK )
286312
313+ def click_get_consent_response (self ):
314+ self .po .perform_action (locator = self .BTN_GET_CONSENT_RESPONSE , action = actions .CLICK_BUTTON )
315+
287316 def click_get_consent_responses (self ):
288- self .po .perform_action (locator = self .BTN_GET_CONSENT_RESPONSES , action = actions .CLICK_BUTTON )
317+ self .po .perform_action (locator = self .LNK_CHECK_CONSENT_RESPONSES , action = actions .CLICK_BUTTON )
289318
290319 def upload_valid_class_list (self , file_paths : str ):
291320 _input_file_path , _ = self .tdo .get_file_paths (file_paths = file_paths )
@@ -308,7 +337,7 @@ def update_triage_outcome_positive(self, file_paths):
308337 self .click_school1 ()
309338 self .click_check_consent_responses ()
310339 self .click_child_full_name ()
311- self .click_get_consent_responses ()
340+ self .click_get_consent_response ()
312341 self .consent_page .service_give_consent ()
313342 self .dashboard_page .go_to_dashboard ()
314343 self .dashboard_page .click_sessions ()
@@ -337,7 +366,7 @@ def update_triage_outcome_consent_refused(self, file_paths):
337366 self .click_school1 ()
338367 self .click_check_consent_responses ()
339368 self .click_child_full_name ()
340- self .click_get_consent_responses ()
369+ self .click_get_consent_response ()
341370 self .consent_page .service_refuse_consent ()
342371 self .click_consent_refused ()
343372 self .click_child_full_name ()
@@ -404,3 +433,28 @@ def set_gillick_competence_for_student(self):
404433
405434 def get_consent_url (self ) -> str :
406435 return self .po .get_object_property (locator = self .LNK_CONSENT_FORM , property = object_properties .HREF )
436+
437+ def disparate_consent_scenario (self ):
438+ self .click_no_response ()
439+ self .click_child_no_consent ()
440+ self .click_get_consent_response ()
441+ self .consent_page .parent_1_verbal_no_response ()
442+ self .click_no_response ()
443+ self .click_child_no_consent ()
444+ self .click_get_consent_response ()
445+ self .consent_page .parent_2_verbal_refuse_consent ()
446+ self .click_consent_refused ()
447+ self .click_child_no_consent ()
448+ self .invalidate_parent2_refusal ()
449+ self .click_activity_log ()
450+ wait (timeout = wait_time .MIN )
451+ # FIXME: Make the following generic
452+ self .po .verify (
453+ locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Consent from Parent2 invalidated"
454+ )
455+ self .po .verify (
456+ locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Consent refused by Parent2 (Mum)"
457+ )
458+ self .po .verify (
459+ locator = self .LBL_MAIN , property = object_properties .TEXT , value = "Consent not_provided by Parent1 (Dad)"
460+ )
0 commit comments