-
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
1 parent
63aa2aa
commit 18018f5
Showing
4 changed files
with
99 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
51 changes: 51 additions & 0 deletions
51
projects/angular-test-app/tests/e2e/DigV2/Process/ApproveReject.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,51 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
const config = require('../../../config'); | ||
const common = require('../../../common'); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.setViewportSize({ width: 1720, height: 1080 }); | ||
await page.goto(config.config.baseUrl, { waitUntil: 'networkidle' }); | ||
}); | ||
|
||
test.describe('E2E test', () => { | ||
test('should login, create case and run different test cases for Approve and Reject actions', async ({ page }) => { | ||
await common.login(config.config.apps.digv2.user.username, config.config.apps.digv2.user.password, page); | ||
|
||
/** Testing announcement banner presence */ | ||
const announcementBanner = await page.locator('h2:has-text("Announcements")'); | ||
await expect(announcementBanner).toBeVisible(); | ||
|
||
/** Testing worklist presence */ | ||
const worklist = page.locator('div[id="worklist"]:has-text("My Worklist")'); | ||
await expect(worklist).toBeVisible(); | ||
|
||
/** Click on the Create Case button */ | ||
const createCase = page.locator('mat-list-item[id="create-case-button"]'); | ||
await createCase.click(); | ||
|
||
/** Creating a Process case-type */ | ||
const processCase = page.locator('mat-list-item[id="case-list-item"] > span:has-text("Process")'); | ||
await processCase.click(); | ||
|
||
await page.locator('button:has-text("Approve")').click(); | ||
|
||
let caseView = await page.locator('div[id="case-view"]'); | ||
|
||
await expect(caseView.locator('span >> text="Resolved-Completed"')).toBeVisible(); | ||
|
||
await createCase.click(); | ||
|
||
/** Creating another Process case-type */ | ||
await processCase.click(); | ||
|
||
await page.locator('button:has-text("Reject")').click(); | ||
|
||
caseView = await page.locator('div[id="case-view"]'); | ||
|
||
await expect(caseView.locator('span >> text="Resolved-Rejected"')).toBeVisible(); | ||
}, 10000); | ||
}); | ||
|
||
test.afterEach(async ({ page }) => { | ||
await page.close(); | ||
}); |