Skip to content

Commit c70bce0

Browse files
authored
Packages version updated to 24 and DigV2 playwright tests updated (#486)
1 parent c09749f commit c70bce0

File tree

16 files changed

+368
-37
lines changed

16 files changed

+368
-37
lines changed

package-lock.json

Lines changed: 35 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-sdk",
3-
"version": "23.1.10",
3+
"version": "24.1.10",
44
"private": true,
55
"scripts": {
66
"_comment_SDK_install_build_run_commands": "The following are public commands to clean, install, build, and run the SDK",
@@ -57,11 +57,11 @@
5757
"@material-ui/icons": "^4.11.2",
5858
"@material-ui/lab": "^4.0.0-alpha.60",
5959
"@material-ui/pickers": "^3.3.10",
60-
"@pega/auth": "^0.2.9",
60+
"@pega/auth": "^0.2.10",
6161
"@pega/cosmos-react-condition-builder": "^4.2.0",
6262
"@pega/cosmos-react-core": "^4.2.0",
6363
"@pega/cosmos-react-work": "^4.2.0",
64-
"@pega/react-sdk-components": "~23.1.11",
64+
"@pega/react-sdk-components": "~0.24.1",
6565
"@storybook/react-webpack5": "^7.6.7",
6666
"@tinymce/tinymce-react": "^4.3.2",
6767
"@types/styled-components": "^5.1.34",
@@ -76,6 +76,7 @@
7676
"react": "^17.0.2",
7777
"react-datepicker": "^4.25.0",
7878
"react-dom": "^17.0.2",
79+
"react-number-format": "^5.4.0",
7980
"react-redux": "^7.2.4",
8081
"react-router-dom": "^5.3.4",
8182
"styled-components": "^6.1.8",
@@ -88,13 +89,13 @@
8889
"@kooneko/livereload-webpack-plugin": "^1.2.1",
8990
"@loadable/component": "^5.16.3",
9091
"@pega/configs": "^0.6.0",
91-
"@pega/constellationjs": "~23.1.1",
92+
"@pega/constellationjs": "24.1.0-test-20240610",
9293
"@pega/cspell-config": "^0.7.1",
93-
"@pega/dx-component-builder-sdk": "~23.1.14",
94+
"@pega/dx-component-builder-sdk": "~0.24.1",
9495
"@pega/eslint-config": "^0.7.1",
9596
"@pega/pcore-pconnect-typedefs": "~2.1.1",
9697
"@pega/prettier-config": "^0.6.0",
97-
"@pega/react-sdk-overrides": "~23.1.11",
98+
"@pega/react-sdk-overrides": "~0.24.1",
9899
"@pega/stylelint-config": "^0.7.1",
99100
"@pega/tsconfig": "^0.7.1",
100101
"@playwright/test": "^1.40.1",

tests/config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const config = {
2121
user: {
2222
username: 'user.digv2',
2323
password: 'pega'
24+
},
25+
localizedUser: {
26+
username: 'localization@DigV2',
27+
password: 'pega'
2428
}
2529
}
2630
},

tests/e2e/Digv2/ComplexFields/DataReference.spec.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,65 @@ test.describe('E2E test', () => {
199199

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

202+
/** MultiSelect mode type test */
203+
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
204+
await selectedSubCategory.click();
205+
await page.locator('li:has-text("Mode")').click();
206+
207+
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
208+
await selectedTestName.click();
209+
await page.locator('li:has-text("MultiSelect")').click();
210+
211+
/** Combo-Box mode type test */
212+
let displayAs = page.locator('div[data-test-id="4aa668349e0970901aa6b11528f95223"]');
213+
await displayAs.click();
214+
await page.locator('li:has-text("Combo-Box")').click();
215+
216+
const selectProducts = page.locator('div[role="combobox"]');
217+
await selectProducts.click();
218+
await page.locator('li:has-text("Mobile")').click();
219+
await page.locator('li:has-text("Telivision")').click();
220+
await expect(selectProducts).toBeVisible();
221+
222+
await page.locator('button:has-text("Next")').click();
223+
224+
assignment = page.locator('div[id="Assignment"]');
225+
226+
await expect(assignment.locator('td >> text="Mobile"')).toBeVisible();
227+
await expect(assignment.locator('td >> text="Telivision"')).toBeVisible();
228+
229+
await page.locator('button:has-text("Previous")').click();
230+
231+
await expect(selectProducts.locator('div[role="button"]:has-text("Mobile")')).toBeVisible();
232+
await expect(selectProducts.locator('div[role="button"]:has-text("Telivision")')).toBeVisible();
233+
234+
let deleteProduct = await selectProducts.locator('div[role="button"]:has-text("Mobile")');
235+
await deleteProduct.locator('svg[focusable="false"]').click();
236+
237+
await page.locator('button:has-text("Next")').click();
238+
239+
await expect(selectProducts.locator('div[role="button"]:has-text("Mobile")')).not.toBeVisible();
240+
241+
await page.locator('button:has-text("Previous")').click();
242+
243+
deleteProduct = await selectProducts.locator('div[role="button"]:has-text("Telivision")');
244+
await deleteProduct.locator('svg[focusable="false"]').click();
245+
246+
/** Checkbox group mode type test */
247+
displayAs = page.locator('div[data-test-id="4aa668349e0970901aa6b11528f95223"]');
248+
await displayAs.click();
249+
await page.locator('li:has-text("Checkbox group")').click();
250+
251+
await page.locator('label:has-text("Washing Machine")').click();
252+
await page.locator('label:has-text("Mobile")').click();
253+
254+
await page.locator('button:has-text("Next")').click();
255+
256+
await expect(assignment.locator('td >> text="Washing Machine"')).toBeVisible();
257+
await expect(assignment.locator('td >> text="Mobile"')).toBeVisible();
258+
259+
await page.locator('button:has-text("Previous")').click();
260+
202261
/** Readonly mode type test */
203262
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
204263
await selectedSubCategory.click();
@@ -220,6 +279,37 @@ test.describe('E2E test', () => {
220279
// await expect(assignment.locator('input[value="75"]')).toBeVisible();
221280
await expect(assignment.locator('input[value="9f2584c2-5cb4-4abe-a261-d68050ee0f66"]')).toBeVisible();
222281

282+
await page.locator('button:has-text("Previous")').click();
283+
284+
/** Testing Sorting(both ascending and descending) */
285+
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
286+
await selectedSubCategory.click();
287+
await page.locator('li:has-text("Options")').click();
288+
289+
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
290+
await selectedTestName.click();
291+
await page.locator('li:has-text("ListOfRecords")').click();
292+
293+
await page.locator('span:has-text("Product Name")').click();
294+
295+
const table = page.locator('div[id="list-view"]');
296+
let tableCell = table.locator('tbody >> tr >> td >> nth=1');
297+
// "---" should come at the top in the ascending order, since it's a Falsy value
298+
await expect(await tableCell.textContent()).toBe('---');
299+
300+
await page.locator('span:has-text("Product Name")').click();
301+
302+
tableCell = table.locator('tbody >> tr >> td >> nth=1');
303+
// "Luxury Product" should be at the top in the descending order
304+
await expect(await tableCell.textContent()).toBe('Luxury Product');
305+
306+
const lastRow = table.locator('tbody >> tr >> nth=3');
307+
tableCell = lastRow.locator('td >> nth=1');
308+
// "---" should be at the bottom in the descending order
309+
await expect(await tableCell.textContent()).toBe('---');
310+
311+
await page.locator('button:has-text("Next")').click();
312+
223313
/** Submitting the case */
224314
await page.locator('button:has-text("submit")').click();
225315
}, 10000);

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,55 @@ test.describe('E2E test', () => {
401401
await expect(assignment.locator('span >> text="02142"')).toBeVisible();
402402
await expect(assignment.locator('span >> text="+16175551212"')).toBeVisible();
403403

404+
/** Testing Sorting(both ascending and descending) */
405+
selectedOption = page.locator('div[data-test-id="c6be2b6191e6660291b6b0c92bd2f0df"]');
406+
await selectedOption.click();
407+
await page.locator('li:has-text("ListOfRecords")').click();
408+
409+
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
410+
await selectedSubCategory.click();
411+
await page.locator('li:has-text("Table")').click();
412+
413+
/** Editable mode type tests */
414+
selectedTestName = page.locator('div[data-test-id="6f64b45d01d11d8efd1693dfcb63b735"]');
415+
await selectedTestName.click();
416+
await page.locator('li:has-text("Editable")').click();
417+
418+
selectEditMode = page.locator('div[data-test-id="80c1db3a7b228760228004b1a532c71e"]');
419+
await selectEditMode.click();
420+
await page.locator('li:has-text("Table rows")').click();
421+
422+
/** Creating row by clicking on `+Add` button */
423+
await page.locator('a:has-text("+ Add")').click();
424+
425+
/** Entering values in the second Row */
426+
await page.locator('input[data-test-id="202003240938510823869"] >> nth=1').fill('Global St');
427+
await page.locator('input[data-test-id="202003240938510831291"] >> nth=1').fill('Cambridge');
428+
await page.locator('input[data-test-id="202003240938510831411"] >> nth=1').fill('MA');
429+
await page.locator('input[data-test-id="202003240938510832734"] >> nth=1').fill('02142');
430+
431+
/** Creating row by clicking on `+Add` button */
432+
await page.locator('a:has-text("+ Add")').click();
433+
434+
/** Entering values in the third Row */
435+
await page.locator('input[data-test-id="202003240938510823869"] >> nth=2').fill('');
436+
await page.locator('input[data-test-id="202003240938510831291"] >> nth=2').fill('Cambridge');
437+
await page.locator('input[data-test-id="202003240938510831411"] >> nth=2').fill('MA');
438+
await page.locator('input[data-test-id="202003240938510832734"] >> nth=2').fill('02142');
439+
404440
await page.locator('button:has-text("Next")').click();
405441

442+
await page.locator('span:has-text("Street")').click();
443+
444+
const table = page.locator('div[id="simple-table-manual"]');
445+
let tableCell = table.locator('tbody >> tr >> td >> nth=0');
446+
await expect(await tableCell.textContent()).toBe('---');
447+
448+
await page.locator('span:has-text("Street")').click();
449+
450+
tableCell = table.locator('tbody >> tr >> td >> nth=0');
451+
await expect(await tableCell.textContent()).toBe('Main St');
452+
406453
/** Submitting the case */
407454
await page.locator('button:has-text("submit")').click();
408455
}, 10000);

tests/e2e/Digv2/FormFields/Boolean.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ test.describe('E2E test', () => {
3838
await page.getByRole('option', { name: 'Required' }).click();
3939

4040
// Checking required boolean field
41+
await expect(page.locator('div >> legend:has-text("Required Boolean")')).toBeVisible();
42+
await expect(page.locator('div >> p:has-text("Required field")')).toBeVisible();
4143
const requiredBooleanLabel = page.locator('label[data-test-id="325f4eb20dc7c90a4fb697cd6c6bf0ea"]');
44+
await expect(await requiredBooleanLabel.locator('span').getByText('BooleanRequired')).toBeVisible();
4245
requiredBooleanLabel.click(); // check required field
4346
requiredBooleanLabel.click(); // uncheck required field
4447
await expect(page.locator('p.Mui-error.Mui-required')).toBeVisible();

tests/e2e/Digv2/FormFields/Currency.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ test.describe('E2E test', () => {
4242
attributes = await common.getAttributes(notRequiredCurrency);
4343
await expect(attributes.includes('required')).toBeFalsy();
4444

45+
await expect(page.locator('div >> label').filter({ hasText: 'Required Currency *' })).toBeVisible();
4546
const requiredCurrency = page.locator('input[data-test-id="77af0bd660f2e0276e23a7db7d48235a"]');
47+
await requiredCurrency.pressSequentially('20');
48+
await notRequiredCurrency.click();
4649
attributes = await common.getAttributes(requiredCurrency);
4750
await expect(attributes.includes('required')).toBeTruthy();
51+
await expect(await requiredCurrency.inputValue()).toBe('$20.00');
4852

4953
/** Selecting Disable from the Sub Category dropdown */
5054
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
@@ -77,6 +81,7 @@ test.describe('E2E test', () => {
7781
const readonlyCurrency = page.locator('input[data-test-id="32bc05c9bac42b8d76ea72511afa89d0"]');
7882
attributes = await common.getAttributes(readonlyCurrency);
7983
await expect(attributes.includes('readonly')).toBeTruthy();
84+
await expect(await readonlyCurrency.inputValue()).toBe('$20.00');
8085

8186
const editableCurrency = page.locator('input[data-test-id="837e53069fc48e63debdee7fa61fbc1a"]');
8287

@@ -85,6 +90,13 @@ test.describe('E2E test', () => {
8590
attributes = await common.getAttributes(editableCurrency);
8691
await expect(attributes.includes('readonly')).toBeFalsy();
8792

93+
const currencyAsDecimal = page.locator('input[data-test-id="a792300f2080cdbcf7a496220fa7a44e"]');
94+
attributes = await common.getAttributes(currencyAsDecimal);
95+
await expect(attributes.includes('readonly')).toBeTruthy();
96+
await expect(await currencyAsDecimal.inputValue()).toBe('$20.00');
97+
const symbol = page.locator('div:has-text("currencyAsDecimal")');
98+
await expect(symbol.locator('p:has-text("$")')).toBeTruthy();
99+
88100
/** Selecting Visibility from the Sub Category dropdown */
89101
selectedSubCategory = page.locator('div[data-test-id="9463d5f18a8924b3200b56efaad63bda"]');
90102
await selectedSubCategory.click();

0 commit comments

Comments
 (0)