WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 668b68f

Browse files
Merge pull request #25 from auto-qa-hub/standart_user_tests
Update standardUser.spec.ts
2 parents 0bc912d + b65f70a commit 668b68f

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tests/standardUser.spec.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ test.describe("Standard user tests", () => {
1919

2020
await page.waitForURL('/inventory.html');
2121

22+
//add to cart all items
23+
await page.waitForSelector('button:has-text("Add to cart")');
24+
while (await page.locator('button:has-text("Add to cart")').count() > 0) {
25+
await page.locator('button:has-text("Add to cart")').first().click();
26+
}
27+
28+
//remove from cart all items
29+
await page.waitForSelector('button:has-text("Remove")');
30+
while (await page.locator('button:has-text("Remove")').count() > 0) {
31+
await page.locator('button:has-text("Remove")').first().click();
32+
}
33+
34+
await page.locator('button:has-text("Add to cart")').first().click();
35+
await page.click('.shopping_cart_link');
36+
await poManager.cartPage.clickCheckout();
37+
38+
await poManager.checkoutStepOnePage.enterCheckoutDetails('John', 'Doe', '12345');
39+
await poManager.checkoutStepOnePage.submitCheckout();
40+
await poManager.checkoutStepTwoPage.completeCheckout();
41+
42+
await poManager.userMenuPage.UserMenuIcon();
43+
await poManager.userMenuPage.Logout();
2244
});
23-
24-
});
45+
});

0 commit comments

Comments
 (0)