@@ -19,6 +19,8 @@ import type {Page} from 'playwright';
19
19
class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
20
20
public readonly deleteAddressSuccessMessage : string ;
21
21
22
+ public readonly noCarriersMessage : string ;
23
+
22
24
private readonly successAlert : string ;
23
25
24
26
private readonly checkoutPageBody : string ;
@@ -187,6 +189,8 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
187
189
188
190
private readonly deliveryStepCarriersList : string ;
189
191
192
+ private readonly deliveryStepCarriersListError : string ;
193
+
190
194
protected deliveryOptions : string ;
191
195
192
196
private readonly deliveryOptionsRadioButton : string ;
@@ -251,6 +255,7 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
251
255
super ( theme ) ;
252
256
this . cartRuleAlertMessageText = 'You cannot use this voucher with this carrier' ;
253
257
this . deleteAddressSuccessMessage = 'Address successfully deleted.' ;
258
+ this . noCarriersMessage = 'Unfortunately, there are no carriers available for your delivery address.' ;
254
259
this . noPaymentNeededText = 'No payment needed for this order' ;
255
260
this . messageIfYouSignOut = 'If you sign out now, your cart will be emptied.' ;
256
261
this . authenticationErrorMessage = 'Authentication failed.' ;
@@ -328,6 +333,7 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
328
333
this . deliveryStepSection = '#checkout-delivery-step' ;
329
334
this . deliveryStepEditButton = `${ this . deliveryStepSection } span.step-edit` ;
330
335
this . deliveryStepCarriersList = `${ this . deliveryStepSection } .delivery-options-list` ;
336
+ this . deliveryStepCarriersListError = `${ this . deliveryStepCarriersList } .alert-danger` ;
331
337
this . deliveryOptions = '#js-delivery div.delivery-options' ;
332
338
this . deliveryOptionsRadioButton = 'input[id*=\'delivery_option_\']' ;
333
339
this . deliveryOptionLabel = ( id : number ) => `${ this . deliveryStepSection } label[for='delivery_option_${ id } ']` ;
@@ -564,7 +570,7 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
564
570
* @param page {Page} Browser tab
565
571
* @returns {Promise<string> }
566
572
*/
567
- getActiveLinkFromPersonalInformationBlock ( page : Page ) : Promise < string > {
573
+ async getActiveLinkFromPersonalInformationBlock ( page : Page ) : Promise < string > {
568
574
return this . getTextContent ( page , this . activeLink ) ;
569
575
}
570
576
@@ -573,7 +579,7 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
573
579
* @param page {Page} Browser tab
574
580
* @returns {Promise<boolean> }
575
581
*/
576
- isPasswordRequired ( page : Page ) : Promise < boolean > {
582
+ async isPasswordRequired ( page : Page ) : Promise < boolean > {
577
583
return this . elementVisible ( page , `${ this . checkoutGuestPasswordInput } :required` , 1000 ) ;
578
584
}
579
585
@@ -974,6 +980,15 @@ class CheckoutPage extends FOBasePage implements FoCheckoutPageInterface {
974
980
return this . getTextContent ( page , this . shippingValueSpan ) ;
975
981
}
976
982
983
+ /**
984
+ * Get errror carrier
985
+ * @param page {Page} Browser tab
986
+ * @returns {Promise<string|null> }
987
+ */
988
+ async getCarrierErrorMessage ( page : Page ) : Promise < string | null > {
989
+ return page . locator ( this . deliveryStepCarriersListError ) . textContent ( ) ;
990
+ }
991
+
977
992
/**
978
993
* Get all carriers names
979
994
* @param page {Page} Browser tab
0 commit comments