Skip to content

Commit

Permalink
fix: add additional page objects properties to storefront home (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
frobel authored Dec 4, 2024
1 parent abf091f commit 99b74a9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/page-objects/storefront/Home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, Locator>> {
Expand Down

0 comments on commit 99b74a9

Please sign in to comment.