Skip to content

Commit 539c2a6

Browse files
committed
refactor: cleanup the checkout page
1 parent aa35c63 commit 539c2a6

File tree

1 file changed

+23
-23
lines changed

1 file changed

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

33
export class DanubeCheckoutPage {
4-
readonly page: Page;
5-
readonly buyButton: Locator;
4+
readonly page: Page;
5+
readonly buyButton: Locator;
66

7-
constructor(page: Page) {
8-
this.page = page;
9-
this.buyButton = page.locator('.call-to-action').last();
10-
}
7+
constructor(page: Page) {
8+
this.page = page;
9+
this.buyButton = page.locator('.call-to-action').last();
10+
}
1111

12-
async completeOrderForm(user) {
13-
await this.page.locator('#s-name').type(user.name);
14-
await this.page.locator('#s-surname').type(user.surname);
15-
await this.page.locator('#s-address').type(user.address.streetAndNumber);
16-
await this.page.locator('#s-zipcode').type(user.address.zipcode);
17-
await this.page.locator('#s-city').type(user.address.city);
18-
await this.page.locator('#s-company').type(user.address.company);
19-
await this.page.locator('.checkout > form').click();
20-
await this.page.locator('#asap').click();
21-
}
12+
async completeOrderForm(user) {
13+
await this.page.locator('#s-name').type(user.name);
14+
await this.page.locator('#s-surname').type(user.surname);
15+
await this.page.locator('#s-address').type(user.address.streetAndNumber);
16+
await this.page.locator('#s-zipcode').type(user.address.zipcode);
17+
await this.page.locator('#s-city').type(user.address.city);
18+
await this.page.locator('#s-company').type(user.address.company);
19+
await this.page.locator('.checkout > form').click();
20+
await this.page.locator('#asap').click();
21+
}
2222

23-
async finalizeOrder() {
24-
await this.buyButton.click();
25-
}
23+
async finalizeOrder() {
24+
await this.buyButton.click();
25+
}
2626

27-
async successMessageIsShown() {
28-
return this.page.getByText('order is on the way').isVisible();
29-
}
27+
async successMessageIsShown() {
28+
return this.page.getByText('order is on the way').isVisible();
29+
}
3030
}

0 commit comments

Comments
 (0)