Skip to content

Commit daf068c

Browse files
committed
Functional Test Cases
1 parent b0a3db6 commit daf068c

19 files changed

+175
-25
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,19 @@ npm run test:report
163163
npx playwright show-trace trace.zip
164164
```
165165

166+
## Reports
167+
168+
- <b>Overall Report</b>
169+
![Overall Report Screenshot][overall-report-screenshot]
170+
171+
- <b>Detailed Report</b>
172+
![Detailed Report Screenshot][detailed-report-screenshot]
173+
174+
- <b>Failure Report</b>
175+
![Failure Report Screenshot][failure-report-screenshot]
176+
177+
<!-- MARKDOWN LINKS & IMAGES -->
178+
179+
[overall-report-screenshot]: ReadMeImages/OverallReport.PNG
180+
[detailed-report-screenshot]: ReadMeImages/DetailedReport.PNG
181+
[failure-report-screenshot]: ReadMeImages/FailureReport.PNG

ReadMeImages/DetailedReport.PNG

32.9 KB
Loading

ReadMeImages/FailureReport.PNG

78 KB
Loading

ReadMeImages/OverallReport.PNG

48.4 KB
Loading

lib/BasePages.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
import { LoginPage } from '../pageFactory/pageRepository/LoginPage';
21
import { test as baseTest } from '@playwright/test';
2+
import { LoginPage } from '../pageFactory/pageRepository/LoginPage';
3+
import { MyAccountPage } from '../pageFactory/pageRepository/MyAccountPage';
4+
import { MyAddressesPage } from '../pageFactory/pageRepository/MyAddressesPage'
5+
import { MyPersonalInformationPage } from '../pageFactory/pageRepository/MyPersonalInformationPage';
36

47
const test = baseTest.extend<{
58
loginPage: LoginPage;
9+
myAccountPage: MyAccountPage;
10+
myAddressesPage: MyAddressesPage;
11+
myPersonalInformationPage: MyPersonalInformationPage;
612

713
}>({
814
loginPage: async ({ page }, use) => {
915
await use(new LoginPage(page));
16+
},
17+
myAccountPage: async ({ page }, use) => {
18+
await use(new MyAccountPage(page));
19+
},
20+
myAddressesPage: async ({ page }, use) => {
21+
await use(new MyAddressesPage(page));
22+
},
23+
myPersonalInformationPage: async ({ page }, use) => {
24+
await use(new MyPersonalInformationPage(page));
1025
}
1126
});
1227

lib/WebActions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ export class WebActions {
1515
this.page = page;
1616
}
1717

18+
async navigateToURL(url: string) {
19+
this.page.goto(url);
20+
}
21+
1822
async decipherPassword(): Promise<string> {
1923
const key = `SECRET`;
2024
//ENCRYPT
21-
// const cipher = CryptoJS.AES.encrypt('password',key);
25+
// const cipher = CryptoJS.AES.encrypt('demouat',key);
2226
// console.log(cipher.toString());
2327
return CryptoJS.AES.decrypt(loginData.password, key).toString(CryptoJS.enc.Utf8);
2428
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"main": "index.js",
66
"scripts": {
77
"test": "npx playwright test",
8-
"test:single": "npx playwright test Login.test.ts --project=Chrome",
9-
"test:parallel": "npx playwright test --grep @Regression --project=Chrome",
10-
"test:serial": "npx playwright test --grep @Regression --workers=1 --project=Chrome",
8+
"test:single": "npx playwright test MyAddress.test.ts --project=Chrome",
9+
"test:parallel": "npx playwright test --grep @Smoke --project=Chrome",
10+
"test:serial": "npx playwright test --grep @Smoke --workers=1 --project=Chrome",
1111
"test:api": "npx playwright test --grep @api --workers=1 --project=Chrome",
1212
"test:db": "npx playwright test DB.test.ts",
1313
"test:record": "npx playwright codegen",
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
export class LoginPageObjects {
2-
EMAIL_EDITBOX_XPATH = `//input[@name=' Femail']`;
3-
PASSWORD_EDITBOX_XPATH = `//input[@name='password']`;
4-
LOGIN_BUTTON_XPATH = `//span[text()='Login']`;
5-
6-
2+
EMAIL_EDITBOX_ID = `#email`;
3+
PASSWORD_EDITBOX_ID = `#passwd`;
4+
SIGN_IN_BUTTON_ID = `#SubmitLogin`;
75
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export class MyAccountPageObjects {
2+
MY_ACCOUNT_HDR_XPATH = `//h1[contains(text(),'My account')]`;
3+
MY_ACCOUNT_LINKS_XPATH = `//span[contains(text(),'linkName')]`;
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export class MyAddressesPageObjects {
2+
MY_ADDRESSES_HDR_XPATH = `//h1[contains(text(),'My addresses')]`;
3+
ADDRESS_DETAILS_XPATH = `//h3[contains(text(),'qwert')]`;
4+
}

0 commit comments

Comments
 (0)