-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mohas22
authored and
mohas22
committed
Oct 30, 2023
1 parent
2ef4ad7
commit 185c1ff
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
80 changes: 80 additions & 0 deletions
80
packages/angular-sdk-components/tests/e2e/DigV2/SelfService/SelfServicePortal.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* eslint-disable no-template-curly-in-string */ | ||
/* eslint-disable no-undef */ | ||
|
||
const { test, expect } = require('@playwright/test'); | ||
const config = require('../../../config'); | ||
const common = require('../../../common'); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.setViewportSize({ width: 1920, height: 1080 }); | ||
await page.goto('http://localhost:3500/portal?portal=DigV2SelfService'); | ||
}); | ||
|
||
test.describe('E2E test', () => { | ||
test('should login and able to render self-service portal', async ({ | ||
page | ||
}) => { | ||
await common.Login( | ||
config.config.apps.digv2.user.username, | ||
config.config.apps.digv2.user.password, | ||
page | ||
); | ||
|
||
/** Testing app name presence */ | ||
const appName = page.locator('div[class="psdk-nav-portal-app"]:has-text("DigV2")'); | ||
await expect(appName).toBeVisible(); | ||
|
||
const navLinks = page.locator('mat-toolbar-row[class="mat-toolbar-row"]'); | ||
|
||
/** Testing the Home navigation link */ | ||
await expect(navLinks.locator('div[class="psdk-nav-button-span"]:has-text("Home")')).toBeVisible(); | ||
await navLinks.locator('div[class="psdk-nav-button-span"]:has-text("Home")').click(); | ||
|
||
const announcementBanner = page.locator('h2:has-text("Announcements")'); | ||
await expect(announcementBanner).toBeVisible(); | ||
|
||
const worklist = page.locator('div[id="worklist"]:has-text("My Worklist")'); | ||
await expect(worklist).toBeVisible(); | ||
|
||
/** Testing the My Work navigation link */ | ||
await expect(navLinks.locator('div[class="psdk-nav-button-span"]:has-text("My Work")')).toBeVisible(); | ||
|
||
await navLinks.locator('div[class="psdk-nav-button-span"]:has-text("My Work")').click(); | ||
|
||
// const myWork = await page.locator('h6:has-text("My Work")'); | ||
// await expect(myWork).toBeVisible(); | ||
|
||
/** Testing the Inline Dashboard navigation link */ | ||
await expect(navLinks.locator('div[class="psdk-nav-button-span"]:has-text("Inline Dashboard")')).toBeVisible(); | ||
|
||
await navLinks.locator('div[class="psdk-nav-button-span"]:has-text("Inline Dashboard")').click(); | ||
|
||
// const inlineDashboard = await page.locator('h4:has-text("Inline Dashboard")'); | ||
// await expect(inlineDashboard).toBeVisible(); | ||
|
||
// const worklist1 = await page.locator('h6:has-text("Complex Fields - List")'); | ||
// await expect(worklist1).toBeVisible(); | ||
|
||
await page.locator('div[class="psdk-nav-portal-app"]:has-text("DigV2")').click(); | ||
|
||
/** Testing Quick links heading presence */ | ||
const quickLinksHeading = page.locator('h1[class="quick-link-heading"]:has-text("Quick links")'); | ||
await expect(quickLinksHeading).toBeVisible(); | ||
|
||
/** Testing the case creation with Quick links */ | ||
const quickLinks = page.locator('ul[class="quick-link-ul-list"]'); | ||
await quickLinks.locator('button:has-text("Complex Fields")').click(); | ||
|
||
await page.locator('button:has-text("Submit")').click(); | ||
|
||
await page.locator('div[class="psdk-nav-portal-app"]:has-text("DigV2")').click(); | ||
|
||
await expect(page.locator('div[id="worklist"]:has-text("My Tasks")')).toBeVisible(); | ||
|
||
await page.close(); | ||
}, 10000); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await page.close(); | ||
}); |