Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add additional page objects properties to storefront home #199

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading