Skip to content

Commit 39af338

Browse files
author
manasa
committed
Updated the playwright tests
1 parent 2cf313f commit 39af338

File tree

8 files changed

+19
-40
lines changed

8 files changed

+19
-40
lines changed

tests/e2e/DigV2/ComplexFields/EmbeddedData.spec.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,12 @@ test.describe('E2E test', () => {
5353
await selectedEditMode.click();
5454
await page.locator('mat-option > span:has-text("Editable")').click();
5555

56-
const PCoreVersion = await page.evaluate(() => window.PCore.getPCoreVersion());
57-
let editModeType;
58-
if (!PCoreVersion.includes('8.8')) {
59-
editModeType = await page.locator('mat-select[data-test-id="80c1db3a7b228760228004b1a532c71e"]');
60-
await editModeType.click();
61-
await page.locator('mat-option > span:has-text("Table rows")').click();
62-
}
56+
let editModeType = await page.locator('mat-select[data-test-id="80c1db3a7b228760228004b1a532c71e"]');
57+
await editModeType.click();
58+
await page.locator('mat-option > span:has-text("Table rows")').click();
6359

64-
const noRecordsMsg = page.locator('div[id="no-records"]');
65-
await expect(noRecordsMsg.locator('text="No Records Found."')).toBeVisible();
60+
const noRecordsMsg = page.locator('td[id="no-records"]');
61+
await expect(noRecordsMsg.locator('text="No records found."')).toBeVisible();
6662

6763
/** Creating row by clicking on `+Add` button */
6864
await page.locator('button:has-text("+ Add")').click();
@@ -206,7 +202,7 @@ test.describe('E2E test', () => {
206202
editMenu = await page.locator('div[role="menu"]');
207203
await editMenu.locator('button:has-text("Delete")').click();
208204

209-
await expect(page.locator('div[id="no-records"]:has-text("No Records Found.")')).toBeVisible();
205+
await expect(page.locator('td[id="no-records"]:has-text("No Records Found.")')).toBeVisible();
210206

211207
await page.locator('button:has-text("Next")').click();
212208

tests/e2e/DigV2/FormFields/Date.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ test.describe('E2E test', () => {
5454
await requiredDate.click();
5555
const futureDate = common.getFutureDate();
5656
await requiredDate.fill(futureDate);
57+
requiredDate.blur();
5758

5859
await expect(page.locator('mat-error')).toBeHidden();
5960

tests/e2e/DigV2/FormFields/DateTime.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ test.describe('E2E test', () => {
6060
.padStart(2, '0')} AM`;
6161
await requiredDateTime.click();
6262
await requiredDateTime.pressSequentially(formattedDate);
63+
requiredDateTime.blur();
6364

6465
await expect(page.locator('mat-error')).toBeHidden();
6566

tests/e2e/DigV2/FormFields/Email.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ test.describe('E2E test', () => {
5151
/** Required tests */
5252
const requiredEmail = page.locator('input[data-test-id="96fa7548c363cdd5adb29c2c2749e436"]');
5353

54-
requiredEmail.fill('[email protected]');
54+
await requiredEmail.fill('[email protected]');
55+
requiredEmail.blur();
5556
await expect(page.locator('mat-error')).toBeHidden();
5657

5758
attributes = await common.getAttributes(requiredEmail);
@@ -98,7 +99,6 @@ test.describe('E2E test', () => {
9899
const editableEmail = page.locator('input[data-test-id="c75f8a926bb5e08fd8342f7fe45dc344"]');
99100
await editableEmail.fill('Johndoe.com');
100101
await editableEmail.blur();
101-
await page.waitForResponse('**/actions/SelectTest/refresh');
102102
const validMsg = "Invalid value specified for EmailEditable. Value doesn\\'t adhere to the Validate: ValidEmailAddress";
103103
await expect(page.locator(`mat-error:has-text("${validMsg}")`)).toBeVisible();
104104
editableEmail.fill('[email protected]');

tests/e2e/DigV2/FormFields/Integer.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ test.describe('E2E test', () => {
5050

5151
/** Required tests */
5252
const requiredInteger = page.locator('input[data-test-id="0658481a174254dded4a0c1ffe6b8380"]');
53-
requiredInteger.fill('10000');
53+
await requiredInteger.fill('10000');
54+
requiredInteger.blur();
5455
await expect(page.locator('mat-error')).toBeHidden();
5556

5657
attributes = await common.getAttributes(requiredInteger);

tests/e2e/DigV2/FormFields/Phone.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ test.describe('E2E test', () => {
5959
await expect(page.locator('mat-error')).toBeVisible();
6060

6161
const requiredPhone = page.locator('ngx-mat-intl-tel-input[data-test-id="af983eaa1b85b015a7654702abd0b249"] >> input');
62-
requiredPhone.fill('6175551212');
62+
await requiredPhone.fill('6175551212');
63+
requiredPhone.blur();
6364
await expect(page.locator('mat-error')).toBeHidden();
6465

6566
/** Selecting Disable from the Sub Category dropdown */

tests/e2e/DigV2/FormFields/attachment.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ test.beforeEach(async ({ page }) => {
1313
await page.goto(config.config.baseUrl, { waitUntil: 'networkidle' });
1414
});
1515

16-
const endpoints = require('../../../../sdk-config.json');
17-
1816
test.describe('E2E test', () => {
1917
let attributes;
2018

@@ -104,14 +102,6 @@ test.describe('E2E test', () => {
104102
await expect(singleAttachment.locator('button:has-text("Choose files")')).toBeVisible();
105103
await page.setInputFiles(`#AttachmentList`, [cableChatFilePath, cableInfoFilePath]);
106104

107-
await Promise.all([
108-
page.waitForResponse(
109-
`${endpoints.serverConfig.infinityRestServerUrl}${
110-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
111-
}/api/application/v2/attachments/upload`
112-
)
113-
]);
114-
115105
await expect(page.locator('div >> text="cableinfo.jpg"')).toBeVisible();
116106
await expect(page.locator('div >> text="cablechat.jpg"')).toBeVisible();
117107

tests/e2e/MediaCo/portal.spec.js

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const path = require('path');
22
const { test, expect } = require('@playwright/test');
33
const config = require('../../config');
44
const common = require('../../common');
5-
const endpoints = require('../../../sdk-config.json');
65

76
test.beforeEach(async ({ page }) => {
87
await page.setViewportSize({ width: 1920, height: 1080 });
@@ -110,25 +109,15 @@ test.describe('E2E test', () => {
110109
const filePath = path.join(__dirname, '../../../src/assets/cableinfo.jpg');
111110
const attachInputId = await page.locator('div[id="attachment-container"] >> input').getAttribute('id');
112111
await page.setInputFiles(`#${attachInputId}`, filePath);
113-
114-
await Promise.all([
115-
page.waitForResponse(
116-
`${endpoints.serverConfig.infinityRestServerUrl}${
117-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
118-
}/api/application/v2/attachments/upload`
119-
)
120-
]);
112+
await page.waitForTimeout(5000);
113+
await expect(page.locator('mat-spinner')).not.toBeVisible();
121114

122115
await page.locator('button:has-text("submit")').click();
123116

124-
await Promise.all([
125-
page.waitForResponse(
126-
`${endpoints.serverConfig.infinityRestServerUrl}${
127-
endpoints.serverConfig.appAlias ? `/app/${endpoints.serverConfig.appAlias}` : ''
128-
}/api/application/v2/cases/${currentCaseID}/attachments?includeThumbnail=false`
129-
)
130-
]);
117+
const todo = page.locator('div[id="worklist"]');
118+
await expect(todo.getByText('To do')).toBeVisible();
131119

120+
await page.waitForTimeout(5000);
132121
const attachmentCount = await page.locator('div[id="attachments-count"]').textContent();
133122
await expect(Number(attachmentCount)).toBeGreaterThan(0);
134123
}, 10000);

0 commit comments

Comments
 (0)