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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions tests/standardUser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ test.describe("Standard user tests", () => {

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

//add to cart all items
await page.waitForSelector('button:has-text("Add to cart")');
while (await page.locator('button:has-text("Add to cart")').count() > 0) {
await page.locator('button:has-text("Add to cart")').first().click();
}

//remove from cart all items
await page.waitForSelector('button:has-text("Remove")');
while (await page.locator('button:has-text("Remove")').count() > 0) {
await page.locator('button:has-text("Remove")').first().click();
}

await page.locator('button:has-text("Add to cart")').first().click();
await page.click('.shopping_cart_link');
await poManager.cartPage.clickCheckout();

await poManager.checkoutStepOnePage.enterCheckoutDetails('John', 'Doe', '12345');
await poManager.checkoutStepOnePage.submitCheckout();
await poManager.checkoutStepTwoPage.completeCheckout();

await poManager.userMenuPage.UserMenuIcon();
await poManager.userMenuPage.Logout();
});

});
});