-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCheckoutConfirm.ts
More file actions
64 lines (53 loc) · 3.36 KB
/
Copy pathCheckoutConfirm.ts
File metadata and controls
64 lines (53 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { Page, Locator } from "playwright-core";
import type { PageObject } from "../../types/PageObject";
import { translate } from "../../services/LanguageHelper";
export class CheckoutConfirm implements PageObject {
public readonly headline: Locator;
public readonly termsAndConditionsCheckbox: Locator;
public readonly immediateAccessToDigitalProductCheckbox: Locator;
public readonly grandTotalPrice: Locator;
public readonly taxPrice: Locator;
public readonly submitOrderButton: Locator;
public readonly termsAutoConfirmedText: Locator;
/**
* Payment and Shipping options
*/
public readonly paymentMethodRadioGroup: Locator;
public readonly shippingMethodRadioGroup: Locator;
/** @deprecated - Use 'paymentMethodRadioGroup' with selectsRadioButton() instead. */
public readonly paymentCashOnDelivery: Locator;
/** @deprecated - Use 'paymentMethodRadioGroup' with selectsRadioButton() instead. */
public readonly paymentPaidInAdvance: Locator;
/** @deprecated - Use 'paymentMethodRadioGroup' with selectsRadioButton() instead. */
public readonly paymentInvoice: Locator;
/** @deprecated - Use 'shippingMethodRadioGroup' with selectsRadioButton() instead. */
public readonly shippingStandard: Locator;
/** @deprecated - Use 'shippingMethodRadioGroup' with selectsRadioButton() instead. */
public readonly shippingExpress: Locator;
/**
* Product details
*/
public readonly cartLineItemImages: Locator;
public readonly page: Page;
constructor(page: Page) {
this.page = page;
this.headline = page.getByRole("heading", { name: translate("storefront:checkout:confirm.completeOrder") });
this.termsAndConditionsCheckbox = page.getByLabel(translate("storefront:checkout:confirm.termsAndConditions"));
this.immediateAccessToDigitalProductCheckbox = page.getByLabel(translate("storefront:checkout:confirm.immediateAccessToDigitalProduct"));
this.grandTotalPrice = page.locator(`dt:has-text('${translate("storefront:checkout:common.grandTotal")}') + dd`);
this.taxPrice = page.locator(`dt:text-matches("${translate("storefront:checkout:common.plusVat")} [0-9]\\+\\?${translate("storefront:checkout:common.vatSuffix")}") + dd`);
this.submitOrderButton = page.getByRole("button", { name: translate("storefront:checkout:confirm.submitOrder") });
this.paymentMethodRadioGroup = page.locator(".checkout-card", { hasText: translate("storefront:checkout:common.paymentMethod") });
this.shippingMethodRadioGroup = page.locator(".checkout-card", { hasText: translate("storefront:checkout:common.shippingMethod") });
this.paymentCashOnDelivery = page.getByLabel(translate("storefront:checkout:common.cashOnDelivery"));
this.paymentPaidInAdvance = page.getByLabel(translate("storefront:checkout:common.paidInAdvance"));
this.paymentInvoice = page.getByLabel(translate("storefront:checkout:common.invoice"));
this.shippingStandard = page.getByLabel(translate("storefront:checkout:common.standard"));
this.shippingExpress = page.getByLabel(translate("storefront:checkout:common.express"));
this.cartLineItemImages = page.locator(".line-item-img-link");
this.termsAutoConfirmedText = page.locator(".checkout-confirm-tos-information");
}
url() {
return "checkout/confirm";
}
}