Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions tests/e2e/DigV2/ComplexFields/CaseReference.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ test.describe('E2E test', () => {
await expect(page.getByRole('row', { name: ' Product Name ' })).toBeVisible();
// /** Storing case-id of the newly created Query case-type(s), will be used later */
const caseID = [];
const caseIdLocator = page.locator('div[id="caseId"]:visible');

caseID.push(await page.locator('div[id="caseId"]').textContent());
await expect(caseIdLocator).toHaveCount(1);
await expect(caseIdLocator).toHaveText(/\S/);
caseID.push((await caseIdLocator.innerText()).trim());

/** Creating another Query case-type which will be used for ListOfRecords mode */
await common.createCase('Query', page);
Expand All @@ -41,7 +44,9 @@ test.describe('E2E test', () => {
await modal.locator('button:has-text("submit")').click();
await expect(modal).not.toBeVisible();

caseID.push(await page.locator('div[id="caseId"]').textContent());
await expect(caseIdLocator).not.toHaveText(caseID[0]);
await expect(caseIdLocator).toHaveText(/\S/);
caseID.push((await caseIdLocator.innerText()).trim());

/** Creating a Complex Fields case-type */
/** opening all case types */
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/DigV2/FormFields/RichText.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ test.describe('E2E test', () => {
expect(await requiredRichTextLabel.innerText()).toEqual('RichText Required');
await page.locator('button:has-text("submit")').click();
let canNotBeBlankMsg = await requiredRichTextContainer.locator('p:has-text("Cannot be blank")');
expect(canNotBeBlankMsg).toBeVisible();
await expect(canNotBeBlankMsg).toBeVisible();

const notRequiredRichTextContainer = page.locator('div[data-test-id="913fcb2ea3513d1f0dd357aa1766757f"]');
const notRequiredRichTextLabel = notRequiredRichTextContainer.locator('label');
expect(await notRequiredRichTextLabel.innerText()).toEqual('RichText Not Required');
await page.locator('button:has-text("submit")').click();
canNotBeBlankMsg = await notRequiredRichTextContainer.locator('p:has-text("Cannot be blank")');
expect(canNotBeBlankMsg).not.toBeVisible();
await expect(canNotBeBlankMsg).not.toBeVisible();

/** Selecting Disable from the Sub Category dropdown */
await common.selectSubCategory('Disable', page);
Expand Down Expand Up @@ -84,13 +84,13 @@ test.describe('E2E test', () => {
const readOnlyRichTextLabel = readOnlyRichTextContainer.locator('label');
expect(await readOnlyRichTextLabel.innerText()).toEqual('RichText ReadOnly');
const readOnlyRTEDiv = readOnlyRichTextContainer.locator('div[class="readonly-richtext-editor"]');
expect(readOnlyRTEDiv).toBeVisible();
await expect(readOnlyRTEDiv).toBeVisible();

const editableRichTextContainer = page.locator('div[data-test-id="c5f3892e688f607040637162ef2d61e2"]');
const editableRichTextLabel = editableRichTextContainer.locator('label');
expect(await editableRichTextLabel.innerText()).toEqual('RichText Editable');
const editableRichTextDiv = editableRichTextContainer.locator('div[role="application"]');
expect(editableRichTextDiv).toBeVisible();
await expect(editableRichTextDiv).toBeVisible();

/** Selecting Visibility from the Sub Category dropdown */
await common.selectSubCategory('Visibility', page);
Expand Down
Loading