Skip to content

Commit 164a229

Browse files
author
Sumit JAGOTA
committed
Upgraded the PW v1.32
- New PW version 1.32 for ui mode - fixed the test for waiting condition - code cleanup
1 parent c5210b5 commit 164a229

File tree

4 files changed

+37
-14
lines changed

4 files changed

+37
-14
lines changed

package-lock.json

Lines changed: 32 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "",
1717
"license": "ISC",
1818
"devDependencies": {
19-
"@playwright/test": "^1.29",
19+
"@playwright/test": "^1.32",
2020
"allure-playwright": "^2.0.0-beta.20",
2121
"@axe-core/playwright": "4.6.0"
2222
}

pageObjects/DashBoardPage/DashBoardPage.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export class DashboardPage extends CommonPage {
77
constructor(public page: Page, readonly scenario: CommonScenario) {
88
super(page, scenario);
99
}
10-
11-
async searchProductAddCart(productName, testInfo) {
10+
11+
async searchProductAddCart(productName) {
1212
const product = await this.page.locator(locators.products, { hasText: productName });
13+
await product.waitFor({ state: "visible" });
1314
const addCartButton = await product.locator("button", { hasText: " Add To Cart" });
1415
const cartButtonVisible = await addCartButton.isVisible();
1516
expect(addCartButton, "Add cart button is visible").toBeTruthy();

tests/productCheckout.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test.describe('E2E test flows', () => {
77
await loginPage.goTo();
88
await loginPage.validLogin(testData.username, testData.password);
99

10-
await dashboardPage.searchProductAddCart("Zara Coat 3", testinfo);
10+
await dashboardPage.searchProductAddCart("Zara Coat 3");
1111
await dashboardPage.navigateToCart();
1212

1313
await cartPage.verifyProductIsDisplayed("Zara Coat 3");

0 commit comments

Comments
 (0)