@@ -41,7 +41,7 @@ class pg_parental_consent:
4141 TXT_ADDRESS_POSTCODE = "Postcode"
4242 RDO_YES = "Yes"
4343 RDO_NO = "No"
44- TXT_DETAILS = "Give details"
44+ TXT_GIVE_DETAILS = "Give details"
4545 BTN_CONFIRM = "Confirm"
4646 LBL_SCHOOL_NAME = "school-name"
4747 RDO_VACCINE_ALREADY_RECEIVED = "Vaccine already received"
@@ -54,6 +54,8 @@ class pg_parental_consent:
5454 RDO_NO_THEY_DO_NOT_AGREE = "No, they do not agree"
5555 RDO_NO_RESPONSE = "No response"
5656 RDO_YES_SAFE_TO_VACCINATE = "Yes, it’s safe to vaccinate"
57+ LBL_CONSENT_RECORDED = "Consent recorded for CF"
58+ LBL_MAIN = "main"
5759
5860 def click_start_now (self ):
5961 self .po .perform_action (locator = self .BTN_START_NOW , action = actions .CLICK_BUTTON )
@@ -132,31 +134,31 @@ def select_severe_allergies(self, allergy_details: str = data_values.EMPTY) -> N
132134 self .po .perform_action (locator = self .RDO_NO , action = actions .RADIO_BUTTON_SELECT )
133135 else :
134136 self .po .perform_action (locator = self .RDO_YES , action = actions .RADIO_BUTTON_SELECT )
135- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = allergy_details )
137+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = allergy_details )
136138 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
137139
138140 def select_medical_condition (self , medical_condition_details : str = data_values .EMPTY ) -> None :
139141 if medical_condition_details == data_values .EMPTY :
140142 self .po .perform_action (locator = self .RDO_NO , action = actions .RADIO_BUTTON_SELECT )
141143 else :
142144 self .po .perform_action (locator = self .RDO_YES , action = actions .RADIO_BUTTON_SELECT )
143- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = medical_condition_details )
145+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = medical_condition_details )
144146 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
145147
146148 def select_severe_reaction (self , reaction_details : str = data_values .EMPTY ) -> None :
147149 if reaction_details == data_values .EMPTY :
148150 self .po .perform_action (locator = self .RDO_NO , action = actions .RADIO_BUTTON_SELECT )
149151 else :
150152 self .po .perform_action (locator = self .RDO_YES , action = actions .RADIO_BUTTON_SELECT )
151- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = reaction_details )
153+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = reaction_details )
152154 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
153155
154156 def select_extra_support (self , extra_support_details : str = data_values .EMPTY ) -> None :
155157 if extra_support_details == data_values .EMPTY :
156158 self .po .perform_action (locator = self .RDO_NO , action = actions .RADIO_BUTTON_SELECT )
157159 else :
158160 self .po .perform_action (locator = self .RDO_YES , action = actions .RADIO_BUTTON_SELECT )
159- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = extra_support_details )
161+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = extra_support_details )
160162 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
161163
162164 def click_confirm_details (self ) -> None :
@@ -170,23 +172,23 @@ def select_consent_not_given_reason(self, reason: str, reason_details: str) -> N
170172 case "vaccine already received" :
171173 self .po .perform_action (locator = self .RDO_VACCINE_ALREADY_RECEIVED , action = actions .RADIO_BUTTON_SELECT )
172174 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
173- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = reason_details )
175+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = reason_details )
174176 case "vaccine will be given elsewhere" :
175177 self .po .perform_action (
176178 locator = self .RDO_VACCINE_WILL_BE_GIVEN_ELSEWHERE , action = actions .RADIO_BUTTON_SELECT
177179 )
178180 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
179- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = reason_details )
181+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = reason_details )
180182 case "medical reasons" :
181183 self .po .perform_action (locator = self .RDO_VACCINE_MEDICAL_REASONS , action = actions .RADIO_BUTTON_SELECT )
182184 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
183- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = reason_details )
185+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = reason_details )
184186 case "personal choice" :
185187 self .po .perform_action (locator = self .RDO_PERSONAL_CHOICE , action = actions .RADIO_BUTTON_SELECT )
186188 case _: # Other
187189 self .po .perform_action (locator = self .RDO_OTHER , action = actions .RADIO_BUTTON_SELECT )
188190 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
189- self .po .perform_action (locator = self .TXT_DETAILS , action = actions .FILL , value = reason_details )
191+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = reason_details )
190192 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
191193
192194 def service_give_consent (self ):
@@ -222,3 +224,21 @@ def service_give_consent(self):
222224 self .po .perform_action (locator = self .RDO_YES_SAFE_TO_VACCINATE , action = actions .RADIO_BUTTON_SELECT )
223225 self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
224226 self .po .perform_action (locator = self .BTN_CONFIRM , action = actions .CLICK_BUTTON )
227+
228+ def service_refuse_consent (self ):
229+ self .po .perform_action (locator = "Parent1 (Dad)" , action = actions .RADIO_BUTTON_SELECT )
230+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
231+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON ) # Parent contact details page
232+ self .po .perform_action (locator = self .RDO_ONLINE , action = actions .RADIO_BUTTON_SELECT )
233+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
234+ self .po .perform_action (locator = self .RDO_NO_THEY_DO_NOT_AGREE , action = actions .RADIO_BUTTON_SELECT )
235+ # self.po.perform_action(locator=self.RDO_NO_RESPONSE , action=actions.RADIO_BUTTON_SELECT)
236+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
237+ self .po .perform_action (locator = self .RDO_VACCINE_ALREADY_RECEIVED , action = actions .RADIO_BUTTON_SELECT )
238+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
239+ self .po .perform_action (locator = self .TXT_GIVE_DETAILS , action = actions .FILL , value = "Given elsewhere" )
240+ self .po .perform_action (locator = self .BTN_CONTINUE , action = actions .CLICK_BUTTON )
241+ self .po .perform_action (locator = self .BTN_CONFIRM , action = actions .CLICK_BUTTON )
242+ self .po .verify (
243+ locator = self .LBL_MAIN , property = object_properties .TEXT , value = self .LBL_CONSENT_RECORDED , exact = False
244+ )
0 commit comments