Skip to content

Commit

Permalink
refactor: cleanup the item details page
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-osch committed Jan 27, 2025
1 parent 6bbdcda commit aa35c63
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions __checks__/key-user-flows/pages/itemDetails.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { expect, Locator, Page } from '@playwright/test';
import { Locator, Page } from '@playwright/test';

export class DanubeItemDetailsPage {
readonly page: Page;
readonly addToCartButton: Locator;
readonly detailsContainer: Locator;
readonly page: Page;
readonly addToCartButton: Locator;
readonly detailsContainer: Locator;

constructor(page: Page) {
this.page = page;
this.addToCartButton = page.locator('text="add to cart"');
this.detailsContainer = page.locator('.detail')
}
constructor(page: Page) {
this.page = page;
this.addToCartButton = page.locator('text="add to cart"');
this.detailsContainer = page.locator('.detail')
}

async addToCart() {
await this.addToCartButton.click();
}

async isActive() {
return this.detailsContainer.isVisible();
}
async addToCart() {
await this.addToCartButton.click();
}

async isActive() {
return this.detailsContainer.isVisible();
}
}

0 comments on commit aa35c63

Please sign in to comment.