diff --git a/src/page-objects/storefront/Home.ts b/src/page-objects/storefront/Home.ts index aa8eee1..783ccbc 100644 --- a/src/page-objects/storefront/Home.ts +++ b/src/page-objects/storefront/Home.ts @@ -7,12 +7,33 @@ export class Home implements PageObject { public readonly productListItems: Locator; public readonly languagesDropdown: Locator; public readonly currenciesDropdown: Locator; + public readonly consentOnlyTechnicallyRequiredButton: Locator; + public readonly consentConfigureButton: Locator; + public readonly consentAcceptAllCookiesButton: Locator; + public readonly consentCookiePreferences: Locator; + public readonly consentCookiePermissionContent: Locator; + public readonly consentDialog: Locator; + public readonly consentDialogTechnicallyRequiredCheckbox: Locator; + public readonly consentDialogAcceptAllCookiesButton: Locator; + public readonly consentDialogSaveButton: Locator; + public readonly consentCookieBannerContainer: Locator; constructor(public readonly page: Page) { this.productImages = page.locator('.product-image-link'); this.productListItems = page.getByRole('listitem'); this.languagesDropdown = page.getByLabel('Shop settings').locator('.languages-menu'); this.currenciesDropdown = page.getByLabel('Shop settings').locator('.currencies-menu'); + this.consentCookieBannerContainer = page.locator('.cookie-permission-container'); + this.consentOnlyTechnicallyRequiredButton = page.getByRole('button', { name: 'Only technically required' }); + this.consentConfigureButton = page.getByRole('button', { name: 'Configure' }); + this.consentAcceptAllCookiesButton = page.getByRole('button', { name: 'Accept all cookies' }); + this.consentCookiePreferences = page.getByLabel('Cookie preferences'); + this.consentCookiePermissionContent = page.locator('.cookie-permission-content'); + this.consentDialog = page.getByRole('dialog').filter( { hasText: 'Cookie preferences' }); + this.consentDialogTechnicallyRequiredCheckbox = this.consentDialog.getByRole('checkbox', { name: 'Technically required' }); + this.consentDialogSaveButton = this.consentDialog.getByRole('button', { name: 'Save' }); + this.consentDialogAcceptAllCookiesButton = this.consentDialog.getByRole('button', { name: 'Accept all cookies' }); + } async getListingItemByProductId(productId: string): Promise> {