Skip to content

Commit b1fc5c4

Browse files
author
manasa
committed
fixed the failed playwrights
1 parent 2d54485 commit b1fc5c4

File tree

5 files changed

+49
-42
lines changed

5 files changed

+49
-42
lines changed

packages/react-sdk-components/tests/e2e/Digv2/ComplexFields/CaseReference.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ test.describe('E2E test', () => {
125125
await page.locator('button:has-text("Next")').click();
126126

127127
const assignment = page.locator('div[id="Assignment"]');
128-
await expect(assignment.locator(`div >> span >> text="${caseID[0]}"`)).toBeVisible();
128+
await expect(assignment.locator(`button:has-text("${caseID[0]}")`)).toBeVisible();
129129

130130
await page.locator('button:has-text("Previous")').click();
131131

packages/react-sdk-components/tests/e2e/Digv2/ComplexFields/DataReference.spec.js

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,49 @@ test.describe('E2E test', () => {
2828

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

31+
/** Testing Advanced Search */
32+
let selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
33+
await selectedSubCategory.click();
34+
await page.locator('li:has-text("DataPatterns")').click();
35+
36+
let selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
37+
await selectedTestName.click();
38+
await page.locator('li:has-text("Advanced search")').click();
39+
40+
await page.locator('button:has-text("Search")').click();
41+
42+
const productName = page.locator('input[data-test-id="85c72bcef3da32c2abc605764537c6a1"]');
43+
await productName.fill('item');
44+
45+
await page.locator('button:has-text("Search")').click();
46+
47+
let table = page.locator('div[id="list-view"] >> nth = 0');
48+
let tableCell = table.locator('tbody >> tr >> td >> nth=1');
49+
50+
const selectedRow = await table.locator('tbody >> tr >> td >> span >> input[type="radio"] >> nth=0');
51+
await selectedRow.click();
52+
53+
await expect(await tableCell.textContent()).toContain('Item');
54+
55+
const radiobutton = await page.locator('div[role="radiogroup"]');
56+
const requiredDateInput = await radiobutton.locator('label >> span >> input >> nth=1');
57+
await requiredDateInput.click();
58+
59+
await page.locator('button:has-text("Discard")').click();
60+
61+
const price = await page.locator('input[data-test-id="3601146c4e948c32b6424d2c0a7f0118"]');
62+
await price.fill('12');
63+
64+
await page.locator('button:has-text("Search")').click();
65+
3166
/** Display subcategory tests */
3267

3368
/** Autocomplete display type test */
34-
let selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
69+
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
3570
await selectedSubCategory.click();
3671
await page.locator('li:has-text("Display")').click();
3772

38-
let selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
73+
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
3974
await selectedTestName.click();
4075
await page.locator('li:has-text("Autocomplete")').click();
4176

@@ -88,7 +123,8 @@ test.describe('E2E test', () => {
88123

89124
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
90125
await selectedTestName.click();
91-
await page.locator('li:has-text("Table")').click();
126+
127+
await page.getByRole('option', { name: 'Table', exact: true }).click();
92128

93129
selectedProduct = page.locator('tr:has-text("Basic Product")');
94130
const selectedProductRow = selectedProduct.locator('input[type="radio"]');
@@ -267,7 +303,7 @@ test.describe('E2E test', () => {
267303
await selectedTestName.click();
268304
await page.locator('li:has-text("Readonly")').click();
269305

270-
selectedProduct = page.locator('div[id="semantic-link-grid"] >> span >> text="Basic Product"');
306+
selectedProduct = page.locator('button:has-text("Basic Product")');
271307
await expect(selectedProduct).toBeVisible();
272308

273309
await page.locator('button:has-text("Next")').click();
@@ -292,8 +328,8 @@ test.describe('E2E test', () => {
292328

293329
await page.locator('span:has-text("Product Name")').click();
294330

295-
let table = page.locator('div[id="list-view"]');
296-
let tableCell = table.locator('tbody >> tr >> td >> nth=1');
331+
table = page.locator('div[id="list-view"]');
332+
tableCell = table.locator('tbody >> tr >> td >> nth=1');
297333
// "---" should come at the top in the ascending order, since it's a Falsy value
298334
await expect(await tableCell.textContent()).toBe('---');
299335

@@ -313,38 +349,6 @@ test.describe('E2E test', () => {
313349

314350
await page.locator('button:has-text("Previous")').click();
315351

316-
/** Testing Advanced Search */
317-
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
318-
await selectedSubCategory.click();
319-
await page.locator('li:has-text("DataPatterns")').click();
320-
321-
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
322-
await selectedTestName.click();
323-
await page.locator('li:has-text("Advanced search")').click();
324-
325-
await page.locator('button:has-text("Search")').click();
326-
327-
const productName = page.locator('input[data-test-id="85c72bcef3da32c2abc605764537c6a1"]');
328-
await productName.fill('item');
329-
330-
await page.locator('button:has-text("Search")').click();
331-
332-
table = page.locator('div[id="list-view"] >> nth = 0');
333-
tableCell = table.locator('tbody >> tr >> td >> nth=1');
334-
335-
await expect(await tableCell.textContent()).toContain('Item');
336-
337-
const radiobutton = page.locator('div[role="radiogroup"]');
338-
const requiredDateInput = radiobutton.locator('label >> span >> input >> nth=1');
339-
await requiredDateInput.click();
340-
341-
await page.locator('button:has-text("Discard")').click();
342-
343-
const price = page.locator('input[data-test-id="3601146c4e948c32b6424d2c0a7f0118"]');
344-
await price.fill('12');
345-
346-
await page.locator('button:has-text("Search")').click();
347-
348352
/** Submitting the case */
349353
await page.locator('button:has-text("Next")').click();
350354
}, 10000);

packages/react-sdk-components/tests/e2e/Digv2/ComplexFields/EmbeddedData.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ test.describe('E2E test', () => {
216216

217217
await page.locator('button[id="delete-button"] >> nth=0').click();
218218

219+
await page.locator('button:has-text("Next")').click();
220+
await page.locator('button:has-text("Previous")').click();
221+
219222
/** Table Edit Modal tests */
220223
selectEditMode = page.locator('div[data-test-id="80c1db3a7b228760228004b1a532c71e"]');
221224
await selectEditMode.click();

packages/react-sdk-components/tests/e2e/Digv2/FormFields/Email.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ test.describe('E2E test', () => {
9898
const editableEmail = page.locator('input[data-test-id="c75f8a926bb5e08fd8342f7fe45dc344"]');
9999
await editableEmail.fill('Johndoe.com');
100100
await editableEmail.blur();
101-
await expect(page.locator('p:has-text("Invalid")')).toBeVisible();
101+
await expect(page.locator('p:has-text("Enter a valid email address")')).toBeVisible();
102102
editableEmail.fill('[email protected]');
103103
await editableEmail.blur();
104-
await expect(page.locator('p:has-text("Invalid")')).toBeHidden();
104+
await expect(page.locator('p:has-text("Enter a valid email address")')).toBeHidden();
105105

106106
attributes = await common.getAttributes(editableEmail);
107107
await expect(attributes.includes('readonly')).toBeFalsy();

packages/react-sdk-components/tests/e2e/Digv2/FormFields/URL.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test.describe('E2E test', () => {
8383
await expect(attributes.includes('readonly')).toBeFalsy();
8484

8585
/** Validation tests */
86-
const validationMsg = 'Please enter a valid URL including the protocol (http://, https://, ftp://, etc.)';
86+
const validationMsg = 'Enter a valid url';
8787
await editableURL.fill('InvalidUrl');
8888
await editableURL.blur();
8989
await expect(page.locator(`p:has-text("${validationMsg}")`)).toBeVisible();

0 commit comments

Comments
 (0)