Skip to content

Commit aa35c63

Browse files
committed
refactor: cleanup the item details page
1 parent 6bbdcda commit aa35c63

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed
+15-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
import { expect, Locator, Page } from '@playwright/test';
1+
import { Locator, Page } from '@playwright/test';
22

33
export class DanubeItemDetailsPage {
4-
readonly page: Page;
5-
readonly addToCartButton: Locator;
6-
readonly detailsContainer: Locator;
4+
readonly page: Page;
5+
readonly addToCartButton: Locator;
6+
readonly detailsContainer: Locator;
77

8-
constructor(page: Page) {
9-
this.page = page;
10-
this.addToCartButton = page.locator('text="add to cart"');
11-
this.detailsContainer = page.locator('.detail')
12-
}
8+
constructor(page: Page) {
9+
this.page = page;
10+
this.addToCartButton = page.locator('text="add to cart"');
11+
this.detailsContainer = page.locator('.detail')
12+
}
1313

14-
async addToCart() {
15-
await this.addToCartButton.click();
16-
}
17-
18-
async isActive() {
19-
return this.detailsContainer.isVisible();
20-
}
14+
async addToCart() {
15+
await this.addToCartButton.click();
16+
}
2117

18+
async isActive() {
19+
return this.detailsContainer.isVisible();
20+
}
2221
}

0 commit comments

Comments
 (0)