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 locators for listing price to existing page objects #304

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions src/page-objects/storefront/Home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ export class Home implements PageObject {
const productAddToShoppingCart = listingItem.getByRole('button', {
name: 'Add to shopping cart',
});
const productListingPrice = listingItem.locator('.list-price-price');
const productListingPricePercentage = listingItem.locator('.list-price-percentage');
const productListingPriceBadge = listingItem.locator('.badge-discount');

return {
productImage: productImage,
Expand All @@ -110,6 +113,9 @@ export class Home implements PageObject {
productPrice: productPrice,
productName: productName,
productAddToShoppingCart: productAddToShoppingCart,
productListingPrice: productListingPrice,
productListingPricePercentage: productListingPricePercentage,
productListingPriceBadge: productListingPriceBadge,
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/page-objects/storefront/ProductDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export class ProductDetail implements PageObject {
public readonly productSingleImage: Locator;
public readonly productSinglePrice: Locator;
public readonly productPriceRangesRow: Locator;
public readonly productListingPriceBadge: Locator;
public readonly productListingPrice: Locator;
public readonly productListingPricePercentage: Locator;

public readonly offCanvasCartTitle: Locator;
public readonly offCanvasCart: Locator;
Expand All @@ -24,6 +27,9 @@ export class ProductDetail implements PageObject {
this.productSingleImage = page.locator('.gallery-slider-single-image');
this.productSinglePrice = page.locator('.product-detail-price');
this.productPriceRangesRow = page.locator('.product-block-prices-row');
this.productListingPriceBadge = page.locator('.list-price-badge');
this.productListingPrice = page.locator('.list-price-price');
this.productListingPricePercentage = page.locator('.list-price-percentage');

this.offCanvas = page.locator('offcanvas-body');
this.offCanvasCartTitle = page.getByText('Shopping cart', { exact: true });
Expand Down
Loading