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 0bc912d

Browse files
Merge pull request #24 from auto-qa-hub/performance_glitch_user_tests
Create performanceGlitchUser.spec.ts
2 parents 1077589 + a597a7a commit 0bc912d

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { test, expect } from '@playwright/test';
2+
import usersData from '../fixtures/usersData.json';
3+
import { POManager } from '../page_objects_ts/POManager';
4+
5+
test.describe("Performance glitch user tests", () => {
6+
test('User path', async ({ page }) => {
7+
const poManager = new POManager(page);
8+
const username = usersData.users[3];
9+
const password = usersData.password;
10+
11+
await poManager.mainPage.visitMainPage();
12+
await poManager.mainPage.fillUsername(username);
13+
await poManager.mainPage.fillPassword(password);
14+
15+
await expect(page.locator('input[name="user-name"]')).toHaveValue(username);
16+
await expect(page.locator('input[name="password"]')).toHaveValue(password);
17+
await poManager.mainPage.loginButton();
18+
await page.waitForURL('/inventory.html');
19+
20+
//add to cart all items
21+
await page.waitForSelector('button:has-text("Add to cart")');
22+
while (await page.locator('button:has-text("Add to cart")').count() > 0) {
23+
await page.locator('button:has-text("Add to cart")').first().click();
24+
}
25+
26+
//remove from cart all items
27+
await page.waitForSelector('button:has-text("Remove")');
28+
while (await page.locator('button:has-text("Remove")').count() > 0) {
29+
await page.locator('button:has-text("Remove")').first().click();
30+
}
31+
32+
await page.locator('button:has-text("Add to cart")').first().click();
33+
await page.click('.shopping_cart_link');
34+
await poManager.cartPage.clickCheckout();
35+
36+
await poManager.checkoutStepOnePage.enterCheckoutDetails('John', 'Doe', '12345');
37+
await poManager.checkoutStepOnePage.submitCheckout();
38+
await poManager.checkoutStepTwoPage.completeCheckout();
39+
40+
await poManager.userMenuPage.UserMenuIcon();
41+
await poManager.userMenuPage.Logout();
42+
});
43+
});

0 commit comments

Comments
 (0)