@zohodesk/testinglibrary 3.2.10 → 3.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitlab-ci.yml CHANGED
@@ -188,4 +188,19 @@ uat-data_generator:
188
188
  paths:
189
189
  - examples/uat/playwright-report
190
190
 
191
+ uat-search_indexing:
192
+ stage: uat
193
+ script:
194
+ - cd examples
195
+ - npm install $(npm pack ../../testing-framework | tail -1)
196
+ - output=$(npm run uat-search_indexing)
197
+ - echo "$output"
198
+ - node ../ValidateUATReport.js examples
199
+
200
+ artifacts:
201
+ when: always
202
+ paths:
203
+ - examples/uat/playwright-report
204
+
205
+
191
206
 
package/README.md CHANGED
@@ -17,10 +17,28 @@
17
17
 
18
18
  - npm run report
19
19
 
20
- ## Version History
20
+ ### v3.2.11 - 13-10-2025
21
+
22
+ ### Feature
23
+
24
+ - New step a search entity using {string} provided for search indexing, This step will use run time data generation response as input for the indexing
25
+
26
+ ### Issue fix
27
+ - Custom teardown comment provided
28
+
29
+ ### v3.2.10 - 09-10-2025
30
+
31
+ #### Enhancement
32
+ - A teardown option has been introduced in the configuration to manage and clean up login sessions stored in the NFS environment.
33
+
34
+
35
+ ### v3.2.9 - 26-09-2025
36
+
37
+ ### Enhancement
38
+
39
+ - Authentication deatils for data generation can be configured in org level
40
+ - reference link : https://learn.zoho.in/portal/zohocorp/knowledge/manual/client-uat/article/data-generation#_Tocpd3n7yt9ngeg
21
41
 
22
- #### Feature
23
- - To store the login session in NFS, we have provided the teardown option in the configuration
24
42
 
25
43
  ### v3.2.8 - 18-09-2025
26
44
 
@@ -30,11 +30,22 @@ async function entityIdReConstructor(payload) {
30
30
  if (typeof payload !== 'object' || payload === null) {
31
31
  throw new Error('Invalid payload. It must be a non-null object.');
32
32
  }
33
- if (!payload.arguments || typeof payload.arguments.entityId !== 'string') {
34
- throw new Error('Invalid payload.arguments.entityId. It must be a non-empty string.');
33
+
34
+ if (!payload.arguments || (!payload.arguments.entityId)) {
35
+ throw new Error('Invalid payload.arguments.entityId. It must be a non-empty string or array of strings.');
36
+ }
37
+
38
+ const entityId = payload.arguments.entityId;
39
+
40
+ // If it's already an array, validate and clean it
41
+ if (Array.isArray(entityId)) {
42
+ payload.arguments.entityId = entityId.map(id => id.trim());
43
+ }
44
+ // If it's a string, split and convert to array
45
+ else if (typeof entityId === 'string') {
46
+ payload.arguments.entityId = entityId.split(',').map(id => id.trim());
35
47
  }
36
48
 
37
- payload.arguments.entityId = payload.arguments.entityId.split(',').map(id => id.trim());
38
49
  return payload;
39
50
  }
40
51
 
@@ -1,8 +1,14 @@
1
1
  import {createBdd } from '@zohodesk/testinglibrary';
2
2
  import { executeRpcRequest , entityIdReConstructor } from '../helpers/rpcRequestHelper';
3
+ import jp from 'jsonpath';
3
4
 
4
5
  const { Given } = createBdd();
5
6
 
7
+
8
+ // Given a search entity
9
+ // | moduleName | entityId | entityName | searchString |
10
+ // | contact | 122000006785675, 122000007141665, 122000006636472 | QA Team | testinguat |
11
+
6
12
  Given('a search entity', async ({page}, dataTable)=>{
7
13
  const data = dataTable.hashes();
8
14
 
@@ -22,5 +28,50 @@ Given('a search entity', async ({page}, dataTable)=>{
22
28
 
23
29
  await executeRpcRequest(page, payload);
24
30
  }
25
-
26
31
  });
32
+
33
+ // Given data generation step
34
+ // Given a search entity using "C1"
35
+ // | moduleName | searchString | searchEntity (response of the previous data generation step) |
36
+ // | contact | testinguat | $.id |
37
+ // | contact | testinguat | $.ids |
38
+ // | contact | testinguat |
39
+
40
+ Given('a search entity using {string}', async ({page,cacheLayer}, reference,dataTable)=>{
41
+ const data = dataTable.hashes();
42
+
43
+ const row = data[0];
44
+ if (!row || !row.moduleName || !row.searchString) {
45
+ throw new Error('Invalid or missing data in dataTable');
46
+ }
47
+
48
+ const { moduleName, searchEntity, searchString } = row;
49
+
50
+ const searchObj = cacheLayer.get(reference);
51
+ let entityIdValue;
52
+
53
+ if (typeof searchObj === 'string') {
54
+ entityIdValue = searchObj;
55
+ } else {
56
+ const jsonPath = searchEntity?.startsWith?.('$') ? searchEntity : `$.${searchEntity}`;
57
+ const result = jp.query(searchObj, jsonPath);
58
+
59
+ if (!result || result.length === 0) {
60
+ throw new Error(`JSONPath query '${jsonPath}' returned no results from cache object for reference: ${reference}`);
61
+ }
62
+
63
+ entityIdValue = result.length === 1 ? result[0] : result;
64
+ }
65
+
66
+ const payload = {
67
+ className: 'applicationDriver.rpc.desk.integrations.search.SearchFakeDataPopulator',
68
+ methodName: 'populateSearchData',
69
+ arguments: {
70
+ module: moduleName,
71
+ searchString: searchString,
72
+ entityId: entityIdValue
73
+ }
74
+ };
75
+ await entityIdReConstructor(payload);
76
+ await executeRpcRequest(page, payload);
77
+ });
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.CUSTOM_COMMANDS = void 0;
7
- const CUSTOM_COMMANDS = exports.CUSTOM_COMMANDS = ['mode', 'tags', 'edition', 'browsers', 'filePath', 'headless', 'modules'];
7
+ const CUSTOM_COMMANDS = exports.CUSTOM_COMMANDS = ['mode', 'tags', 'edition', 'browsers', 'filePath', 'headless', 'modules', 'isTearDown'];
@@ -14,7 +14,6 @@ var _readConfigFile = require("../readConfigFile");
14
14
  const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
15
15
  const {
16
16
  isAuthMode,
17
- isTearDown,
18
17
  isSmokeTest,
19
18
  bddMode,
20
19
  authFilePath,
@@ -27,6 +26,7 @@ function setupConfig() {
27
26
  const setupProject = new _Project.Project('setup');
28
27
  setupProject.setTestMatch(/.*\.setup\.js/);
29
28
  setupProject.setTestDir(_path.default.join(process.cwd(), 'uat'));
29
+ const isTearDown = JSON.parse(process.env.tearDown);
30
30
  setupProject.setTearDown(isTearDown ? 'cleanup' : '');
31
31
  const setupProjectConfig = [setupProject.getProperties()];
32
32
  return setupProjectConfig;
@@ -15,7 +15,6 @@ const {
15
15
  bddMode,
16
16
  browsers,
17
17
  isSmokeTest,
18
- isTearDown,
19
18
  isAuthMode,
20
19
  openReportOn,
21
20
  reportPath,
@@ -33,7 +32,6 @@ const projects = (0, _configUtils.getProjects)({
33
32
  browsers,
34
33
  isAuthMode,
35
34
  isSmokeTest,
36
- isTearDown,
37
35
  authFilePath,
38
36
  expectTimeout,
39
37
  testTimeout,
@@ -70,6 +68,7 @@ const testDir = (0, _configUtils.getTestDir)(bddMode, {
70
68
  function getPlaywrightConfig() {
71
69
  const smokeTestProject = isSmokeTest ? (0, _ProjectConfiguration.smokeTestConfig)() : [];
72
70
  const setupProject = isAuthMode ? (0, _ProjectConfiguration.setupConfig)() : [];
71
+ const isTearDown = JSON.parse(process.env.tearDown);
73
72
  const cleanupProject = isTearDown ? (0, _ProjectConfiguration.cleanupConfig)() : [];
74
73
  const playwrightConfig = {
75
74
  testDir,
@@ -90,9 +90,11 @@ function main() {
90
90
  // overriding the user config's from CLI
91
91
  uatConfig.addAll(userArgConfig);
92
92
  const modules = uatConfig.get('modules');
93
+ const tearDown = uatConfig.get('isTearDown');
93
94
 
94
95
  //We need to change this process.env variable to pass the module name in future.
95
96
  process.env.modules = modules;
97
+ process.env.tearDown = tearDown;
96
98
  const {
97
99
  isAuthMode,
98
100
  editionOrder,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "3.2.10",
3
+ "version": "3.2.11",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zohodesk/testinglibrary",
9
- "version": "3.2.10",
9
+ "version": "3.2.11",
10
10
  "hasInstallScript": true,
11
11
  "license": "ISC",
12
12
  "dependencies": {
@@ -23,6 +23,7 @@
23
23
  "fast-glob": "3.3.1",
24
24
  "jest": "29.6.2",
25
25
  "jest-environment-jsdom": "29.6.2",
26
+ "jsonpath": "1.1.1",
26
27
  "msw": "1.2.3",
27
28
  "playwright": "1.53.2",
28
29
  "playwright-bdd": "8.3.1",
@@ -5431,8 +5432,7 @@
5431
5432
  "version": "0.1.4",
5432
5433
  "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
5433
5434
  "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
5434
- "license": "MIT",
5435
- "peer": true
5435
+ "license": "MIT"
5436
5436
  },
5437
5437
  "node_modules/deepmerge": {
5438
5438
  "version": "4.3.1",
@@ -6199,8 +6199,7 @@
6199
6199
  "version": "2.0.6",
6200
6200
  "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
6201
6201
  "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
6202
- "license": "MIT",
6203
- "peer": true
6202
+ "license": "MIT"
6204
6203
  },
6205
6204
  "node_modules/fastq": {
6206
6205
  "version": "1.19.1",
@@ -9297,6 +9296,29 @@
9297
9296
  "node": ">=6"
9298
9297
  }
9299
9298
  },
9299
+ "node_modules/jsonpath": {
9300
+ "version": "1.1.1",
9301
+ "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz",
9302
+ "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==",
9303
+ "license": "MIT",
9304
+ "dependencies": {
9305
+ "esprima": "1.2.2",
9306
+ "static-eval": "2.0.2",
9307
+ "underscore": "1.12.1"
9308
+ }
9309
+ },
9310
+ "node_modules/jsonpath/node_modules/esprima": {
9311
+ "version": "1.2.2",
9312
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz",
9313
+ "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==",
9314
+ "bin": {
9315
+ "esparse": "bin/esparse.js",
9316
+ "esvalidate": "bin/esvalidate.js"
9317
+ },
9318
+ "engines": {
9319
+ "node": ">=0.4.0"
9320
+ }
9321
+ },
9300
9322
  "node_modules/keyv": {
9301
9323
  "version": "4.5.4",
9302
9324
  "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@@ -11476,6 +11498,96 @@
11476
11498
  "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==",
11477
11499
  "license": "MIT"
11478
11500
  },
11501
+ "node_modules/static-eval": {
11502
+ "version": "2.0.2",
11503
+ "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz",
11504
+ "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==",
11505
+ "license": "MIT",
11506
+ "dependencies": {
11507
+ "escodegen": "^1.8.1"
11508
+ }
11509
+ },
11510
+ "node_modules/static-eval/node_modules/escodegen": {
11511
+ "version": "1.14.3",
11512
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
11513
+ "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
11514
+ "license": "BSD-2-Clause",
11515
+ "dependencies": {
11516
+ "esprima": "^4.0.1",
11517
+ "estraverse": "^4.2.0",
11518
+ "esutils": "^2.0.2",
11519
+ "optionator": "^0.8.1"
11520
+ },
11521
+ "bin": {
11522
+ "escodegen": "bin/escodegen.js",
11523
+ "esgenerate": "bin/esgenerate.js"
11524
+ },
11525
+ "engines": {
11526
+ "node": ">=4.0"
11527
+ },
11528
+ "optionalDependencies": {
11529
+ "source-map": "~0.6.1"
11530
+ }
11531
+ },
11532
+ "node_modules/static-eval/node_modules/estraverse": {
11533
+ "version": "4.3.0",
11534
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
11535
+ "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
11536
+ "license": "BSD-2-Clause",
11537
+ "engines": {
11538
+ "node": ">=4.0"
11539
+ }
11540
+ },
11541
+ "node_modules/static-eval/node_modules/levn": {
11542
+ "version": "0.3.0",
11543
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
11544
+ "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
11545
+ "license": "MIT",
11546
+ "dependencies": {
11547
+ "prelude-ls": "~1.1.2",
11548
+ "type-check": "~0.3.2"
11549
+ },
11550
+ "engines": {
11551
+ "node": ">= 0.8.0"
11552
+ }
11553
+ },
11554
+ "node_modules/static-eval/node_modules/optionator": {
11555
+ "version": "0.8.3",
11556
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
11557
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
11558
+ "license": "MIT",
11559
+ "dependencies": {
11560
+ "deep-is": "~0.1.3",
11561
+ "fast-levenshtein": "~2.0.6",
11562
+ "levn": "~0.3.0",
11563
+ "prelude-ls": "~1.1.2",
11564
+ "type-check": "~0.3.2",
11565
+ "word-wrap": "~1.2.3"
11566
+ },
11567
+ "engines": {
11568
+ "node": ">= 0.8.0"
11569
+ }
11570
+ },
11571
+ "node_modules/static-eval/node_modules/prelude-ls": {
11572
+ "version": "1.1.2",
11573
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
11574
+ "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
11575
+ "engines": {
11576
+ "node": ">= 0.8.0"
11577
+ }
11578
+ },
11579
+ "node_modules/static-eval/node_modules/type-check": {
11580
+ "version": "0.3.2",
11581
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
11582
+ "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
11583
+ "license": "MIT",
11584
+ "dependencies": {
11585
+ "prelude-ls": "~1.1.2"
11586
+ },
11587
+ "engines": {
11588
+ "node": ">= 0.8.0"
11589
+ }
11590
+ },
11479
11591
  "node_modules/stop-iteration-iterator": {
11480
11592
  "version": "1.1.0",
11481
11593
  "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
@@ -11983,6 +12095,12 @@
11983
12095
  "url": "https://github.com/sponsors/ljharb"
11984
12096
  }
11985
12097
  },
12098
+ "node_modules/underscore": {
12099
+ "version": "1.12.1",
12100
+ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz",
12101
+ "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==",
12102
+ "license": "MIT"
12103
+ },
11986
12104
  "node_modules/undici-types": {
11987
12105
  "version": "7.12.0",
11988
12106
  "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
@@ -12405,7 +12523,6 @@
12405
12523
  "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
12406
12524
  "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
12407
12525
  "license": "MIT",
12408
- "peer": true,
12409
12526
  "engines": {
12410
12527
  "node": ">=0.10.0"
12411
12528
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "3.2.10",
3
+ "version": "3.2.11",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -35,6 +35,7 @@
35
35
  "fast-glob": "3.3.1",
36
36
  "jest": "29.6.2",
37
37
  "jest-environment-jsdom": "29.6.2",
38
+ "jsonpath": "1.1.1",
38
39
  "msw": "1.2.3",
39
40
  "playwright": "1.53.2",
40
41
  "supports-color": "8.1.1",