@zohodesk/testinglibrary 2.9.3 → 2.9.4

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.
Files changed (27) hide show
  1. package/build/bdd-framework/cucumber/formatter/EventDataCollector.js +1 -1
  2. package/build/bdd-framework/reporter/cucumber/json.js +1 -1
  3. package/build/bdd-framework/reporter/cucumber/messagesBuilder/Meta.js +1 -1
  4. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +1 -1
  5. package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +1 -1
  6. package/build/core/playwright/helpers/fileMutex.js +10 -12
  7. package/build/core/playwright/tagProcessor.js +18 -28
  8. package/package.json +1 -1
  9. package/nobdd/README.md +0 -1
  10. package/nobdd/package.json +0 -17
  11. package/nobdd/src/App.js +0 -7
  12. package/nobdd/uat/conf/default/actors/editions/enterprise.json +0 -24
  13. package/nobdd/uat/conf/default/actors/editions/index.js +0 -4
  14. package/nobdd/uat/conf/default/actors/index.js +0 -2
  15. package/nobdd/uat/conf/default/settings.json +0 -6
  16. package/nobdd/uat/conf/nobdd/uat.config.js +0 -36
  17. package/nobdd/uat/env-config.json +0 -20
  18. package/nobdd/uat/fixtures/auth.setup.js +0 -44
  19. package/nobdd/uat/fixtures/setup.teardown.js +0 -33
  20. package/nobdd/uat/modules/nobdd/steps/VerifyNoBDD.feature.spec.js +0 -16
  21. package/nobdd/uat/shared/commands/_index-custom-fixtures.js +0 -9
  22. package/nobdd/uat/shared/commands/i18n.js +0 -25
  23. package/nobdd/uat/shared/commands/unauthenticatedPage.js +0 -8
  24. package/nobdd/uat/shared/index.js +0 -7
  25. package/nobdd/uat/shared/onboardings/onboardingUpdate.js +0 -44
  26. package/nobdd/uat/shared/url-helpers/getUrlOrigin.js +0 -6
  27. package/nobdd/uat.config.js +0 -37
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var messages = _interopRequireWildcard(require("@cucumber/messages"));
8
8
  var _valueChecker = require("../valueChecker");
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
11
  /**
12
12
  * Groups Cucumber messages for easier access.
13
13
  * Based on Cucumber, with some changes due to strictNullChecks errors.
@@ -16,7 +16,7 @@ var _locationHelpers = require("../../cucumber/formatter/locationHelpers");
16
16
  var _GherkinDocument = require("./messagesBuilder/GherkinDocument");
17
17
  var _Projects = require("./messagesBuilder/Projects");
18
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
20
  /**
21
21
  * Cucumber json reporter.
22
22
  * Based on: https://github.com/cucumber/cucumber-js/blob/main/src/formatter/json_formatter.ts
@@ -9,7 +9,7 @@ var _os = _interopRequireDefault(require("os"));
9
9
  var messages = _interopRequireWildcard(require("@cucumber/messages"));
10
10
  var _utils = require("../../../utils");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  /**
14
14
  * Builds meta message.
15
15
  * See: https://github.com/cucumber/cucumber-js/blob/main/src/cli/helpers.ts#L100
@@ -9,7 +9,7 @@ var _fs = _interopRequireDefault(require("fs"));
9
9
  var messages = _interopRequireWildcard(require("@cucumber/messages"));
10
10
  var _path = _interopRequireDefault(require("path"));
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  /**
14
14
  * Class for getting attachment messages for a particular step.
15
15
  */
@@ -9,7 +9,7 @@ var _stripAnsiEscapes = require("../../../utils/stripAnsiEscapes");
9
9
  var _timing = require("./timing");
10
10
  var _TestStepAttachments = require("./TestStepAttachments");
11
11
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  class TestStepRun {
14
14
  testCaseRun;
15
15
  testStep;
@@ -8,44 +8,42 @@ exports.default = void 0;
8
8
  var _path = _interopRequireDefault(require("path"));
9
9
  var _properLockfile = _interopRequireDefault(require("proper-lockfile"));
10
10
  var _fs = require("fs");
11
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
12
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
13
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
14
- var _getLockFilePath = /*#__PURE__*/new WeakSet();
15
- var _createDirectoryIfNotExist = /*#__PURE__*/new WeakSet();
11
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
12
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
13
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
14
+ var _FileMutex_brand = /*#__PURE__*/new WeakSet();
16
15
  class FileMutex {
17
16
  constructor(directory, lockFileName, options = {}) {
18
- _classPrivateMethodInitSpec(this, _createDirectoryIfNotExist);
19
- _classPrivateMethodInitSpec(this, _getLockFilePath);
17
+ _classPrivateMethodInitSpec(this, _FileMutex_brand);
20
18
  this.directory = directory;
21
19
  this.lockFileName = lockFileName + ".lock";
22
20
  this.options = options;
23
21
  }
24
22
  async acquire() {
25
- _classPrivateMethodGet(this, _createDirectoryIfNotExist, _createDirectoryIfNotExist2).call(this);
23
+ _assertClassBrand(_FileMutex_brand, this, _createDirectoryIfNotExist).call(this);
26
24
  const lockFilePath = _path.default.resolve(this.directory, this.lockFileName);
27
25
  try {
28
26
  if (!(0, _fs.existsSync)(lockFilePath)) {
29
27
  console.log(`[DEBUG] Creating missing lock file:`, this.lockFileName);
30
28
  (0, _fs.writeFileSync)(lockFilePath, 'locked');
31
29
  }
32
- await _properLockfile.default.lock(_classPrivateMethodGet(this, _getLockFilePath, _getLockFilePath2).call(this), this.options);
30
+ await _properLockfile.default.lock(_assertClassBrand(_FileMutex_brand, this, _getLockFilePath).call(this), this.options);
33
31
  } catch (err) {
34
32
  throw new Error(`Failed to acquire lock after ${this.options.retries.retries} attempts: ${err.message}`);
35
33
  }
36
34
  }
37
35
  async release() {
38
36
  try {
39
- await _properLockfile.default.unlock(_classPrivateMethodGet(this, _getLockFilePath, _getLockFilePath2).call(this));
37
+ await _properLockfile.default.unlock(_assertClassBrand(_FileMutex_brand, this, _getLockFilePath).call(this));
40
38
  } catch (err) {
41
39
  throw new Error(`Failed to release lock: ${err.message}`);
42
40
  }
43
41
  }
44
42
  }
45
- function _getLockFilePath2() {
43
+ function _getLockFilePath() {
46
44
  return _path.default.resolve(_path.default.join(this.directory, this.lockFileName));
47
45
  }
48
- function _createDirectoryIfNotExist2() {
46
+ function _createDirectoryIfNotExist() {
49
47
  if (!(0, _fs.existsSync)(this.directory)) {
50
48
  (0, _fs.mkdirSync)(this.directory, {
51
49
  recursive: true
@@ -1,23 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  var _logger = require("../../utils/logger");
4
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
5
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
7
- var _buildTagsString = /*#__PURE__*/new WeakSet();
8
- var _parseEdition = /*#__PURE__*/new WeakSet();
9
- var _processSingleEdition = /*#__PURE__*/new WeakSet();
10
- var _processMultipleEditions = /*#__PURE__*/new WeakSet();
11
- var _getEditionArgs = /*#__PURE__*/new WeakSet();
12
- var _buildEditionTags = /*#__PURE__*/new WeakSet();
4
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
5
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
6
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
7
+ var _TagProcessor_brand = /*#__PURE__*/new WeakSet();
13
8
  class TagProcessor {
14
9
  constructor(editionOrder) {
15
- _classPrivateMethodInitSpec(this, _buildEditionTags);
16
- _classPrivateMethodInitSpec(this, _getEditionArgs);
17
- _classPrivateMethodInitSpec(this, _processMultipleEditions);
18
- _classPrivateMethodInitSpec(this, _processSingleEdition);
19
- _classPrivateMethodInitSpec(this, _parseEdition);
20
- _classPrivateMethodInitSpec(this, _buildTagsString);
10
+ _classPrivateMethodInitSpec(this, _TagProcessor_brand);
21
11
  this.editionOrder = editionOrder;
22
12
  }
23
13
  processTags(userArgs) {
@@ -25,36 +15,36 @@ class TagProcessor {
25
15
  const edition = userArgs['edition'] || null;
26
16
  if (!edition) return tagArgs;
27
17
  const editionsArray = edition.split(',');
28
- const editionTags = editionsArray.length === 1 ? _classPrivateMethodGet(this, _processSingleEdition, _processSingleEdition2).call(this, editionsArray[0], tagArgs) : _classPrivateMethodGet(this, _processMultipleEditions, _processMultipleEditions2).call(this, editionsArray, tagArgs);
18
+ const editionTags = editionsArray.length === 1 ? _assertClassBrand(_TagProcessor_brand, this, _processSingleEdition).call(this, editionsArray[0], tagArgs) : _assertClassBrand(_TagProcessor_brand, this, _processMultipleEditions).call(this, editionsArray, tagArgs);
29
19
  return editionTags;
30
20
  }
31
21
  }
32
- function _buildTagsString2(tags, editionTags) {
22
+ function _buildTagsString(tags, editionTags) {
33
23
  return tags && tags !== '' ? `${tags} and not (${editionTags})` : `not (${editionTags})`;
34
24
  }
35
- function _parseEdition2(edition) {
25
+ function _parseEdition(edition) {
36
26
  if (edition.startsWith('<=')) return ['<=', edition.slice(2)];
37
27
  if (edition.startsWith('>=')) return ['>=', edition.slice(2)];
38
28
  if (edition.startsWith('<')) return ['<', edition.slice(1)];
39
29
  if (edition.startsWith('>')) return ['>', edition.slice(1)];
40
30
  return [null, edition];
41
31
  }
42
- function _processSingleEdition2(selectedEdition, tagArgs) {
43
- const editionArgs = _classPrivateMethodGet(this, _getEditionArgs, _getEditionArgs2).call(this, selectedEdition);
32
+ function _processSingleEdition(selectedEdition, tagArgs) {
33
+ const editionArgs = _assertClassBrand(_TagProcessor_brand, this, _getEditionArgs).call(this, selectedEdition);
44
34
  if (editionArgs && editionArgs.length > 0) {
45
- const editionTags = _classPrivateMethodGet(this, _buildEditionTags, _buildEditionTags2).call(this, editionArgs, 'or');
46
- return _classPrivateMethodGet(this, _buildTagsString, _buildTagsString2).call(this, tagArgs, editionTags);
35
+ const editionTags = _assertClassBrand(_TagProcessor_brand, this, _buildEditionTags).call(this, editionArgs, 'or');
36
+ return _assertClassBrand(_TagProcessor_brand, this, _buildTagsString).call(this, tagArgs, editionTags);
47
37
  }
48
38
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions for ${selectedEdition} found. Running with default edition`);
49
39
  return tagArgs;
50
40
  }
51
- function _processMultipleEditions2(editionsArray, tagArgs) {
41
+ function _processMultipleEditions(editionsArray, tagArgs) {
52
42
  const filteredEditions = this.editionOrder.filter(edition => !editionsArray.includes(edition));
53
- const editionTags = _classPrivateMethodGet(this, _buildEditionTags, _buildEditionTags2).call(this, filteredEditions, 'or');
54
- return _classPrivateMethodGet(this, _buildTagsString, _buildTagsString2).call(this, tagArgs, editionTags);
43
+ const editionTags = _assertClassBrand(_TagProcessor_brand, this, _buildEditionTags).call(this, filteredEditions, 'or');
44
+ return _assertClassBrand(_TagProcessor_brand, this, _buildTagsString).call(this, tagArgs, editionTags);
55
45
  }
56
- function _getEditionArgs2(selectedEdition) {
57
- const [operator, editionValue] = _classPrivateMethodGet(this, _parseEdition, _parseEdition2).call(this, selectedEdition.toLowerCase());
46
+ function _getEditionArgs(selectedEdition) {
47
+ const [operator, editionValue] = _assertClassBrand(_TagProcessor_brand, this, _parseEdition).call(this, selectedEdition.toLowerCase());
58
48
  const index = this.editionOrder.findIndex(edition => edition.toLowerCase() === editionValue);
59
49
  if (index === -1) {
60
50
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `No matching editions for ${selectedEdition} found. Running with default edition`);
@@ -73,7 +63,7 @@ function _getEditionArgs2(selectedEdition) {
73
63
  return this.editionOrder.filter((_, i) => i !== index);
74
64
  }
75
65
  }
76
- function _buildEditionTags2(editionArgs, operator = 'or') {
66
+ function _buildEditionTags(editionArgs, operator = 'or') {
77
67
  return editionArgs.map(edition => `@edition_${edition}`).join(` ${operator} `);
78
68
  }
79
69
  module.exports = TagProcessor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "2.9.3",
3
+ "version": "2.9.4",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
package/nobdd/README.md DELETED
@@ -1 +0,0 @@
1
- npm install $(npm pack ../ | tail -1)
@@ -1,17 +0,0 @@
1
- {
2
- "name": "testingframeworknobdd",
3
- "version": "1.0.0",
4
- "description": "collection of examples that we can use for testing",
5
- "keywords": [],
6
- "author": "",
7
- "license": "ISC",
8
- "scripts": {
9
- "uat": "ZDTestingFramework test --mode=dev --headed",
10
- "uatnobdd": "ZDTestingFramework test --mode=nobdd",
11
- "uat-ci": "ZDTestingFramework test --mode=ci --headed",
12
- "uat-clean": "ZDTestingFramework clearCaches",
13
- "uat-debug": "ZDTestingFramework test --mode=dev --debug",
14
- "uat-report": "ZDTestingFramework report --port=9009",
15
- "codegen": "ZDTestingFramework codegen deskclientapp.localzoho.com/agent"
16
- }
17
- }
package/nobdd/src/App.js DELETED
@@ -1,7 +0,0 @@
1
- export function add(a, b) {
2
- return a + b;
3
- }
4
-
5
- export function greet(name) {
6
- return `Hello, ${name}!`;
7
- }
@@ -1,24 +0,0 @@
1
- [
2
- {
3
- "id": "1",
4
- "edition": "enterprise",
5
- "orgName": "zohodeskteam",
6
- "profiles": [
7
- {
8
- "profile": "admin",
9
- "email": "solairaj.m+26jun2023@zohotest.com",
10
- "password": "Demo@1201"
11
- },
12
- {
13
- "profile": "agent",
14
- "email": "anitha.m+agentat@zohotest.com",
15
- "password": "Desk@1234"
16
- },
17
- {
18
- "profile": "lightagent",
19
- "email": "anitha.m+admin@zohotest.com",
20
- "password": "Moon@2018"
21
- }
22
- ]
23
- }
24
- ]
@@ -1,4 +0,0 @@
1
- const enterprise = require('./enterprise.json');
2
- const editions = {enterprise};
3
-
4
- module.exports = editions;
@@ -1,2 +0,0 @@
1
- const editions = require('./editions/index');
2
- module.exports = { editions }
@@ -1,6 +0,0 @@
1
- {
2
- "environment": "ci",
3
- "edition": "enterprise",
4
- "profile": "admin",
5
- "domain": "https://zdesk-devops16.csez.zohocorpin.com:31025/agent"
6
- }
@@ -1,36 +0,0 @@
1
- const customFixtures = require('../../shared/commands/_index-custom-fixtures');
2
-
3
- const { getDefaultActor } = require('@zohodesk/testinglibrary/helpers');
4
-
5
- function getPrimaryCookiePath() {
6
- const { email } = getDefaultActor();
7
- return `uat/playwright/.auth/${email}-cookies.json`;
8
- }
9
-
10
- /**
11
- * Represents the user configuration object.
12
- * @typedef {import('@zohodesk/testinglibrary').UserConfig} UserConfig
13
- */
14
- module.exports = {
15
- headless: false,
16
- retries:1,
17
- openReportOn: 'never',
18
- browsers: ['Chrome'],
19
- isAuthMode: true,
20
- authFilePath: getPrimaryCookiePath(),
21
- trace: 'retain-on-failure',
22
- video: 'retain-on-failure',
23
- retries:1,
24
- bddMode: false,
25
- expectTimeout: 10 * 1000,
26
- testTimeout: 60 * 1000,
27
- globalTimeout: 2 * 60 * 60 * 1000,
28
- featureFilesFolder: 'feature-files',
29
- stepDefinitionsFolder: 'steps',
30
- viewport: { width: 1280, height: 720 },
31
- testIdAttribute: 'data-id',
32
- editionOrder: ['Free', 'Express', 'Standard', 'Professional', 'Enterprise'],
33
- additionalPages: {
34
- ...customFixtures
35
- }
36
- };
@@ -1,20 +0,0 @@
1
- {
2
- "dev": {
3
- "domain": "https://zdesk-devops16.csez.zohocorpin.com:31025/agent",
4
- "orgName": "org-name",
5
- "deptName": "dept-name",
6
- "moduleName": "module-name"
7
- },
8
- "prod": {
9
- "domain": "https://zdesk-devops16.csez.zohocorpin.com:31025/agent",
10
- "orgName": "sangeetha.t@zohocorp.com",
11
- "deptName": "sangeethat",
12
- "moduleName": "sangeethat"
13
- },
14
- "ci": {
15
- "domain": "https://zdesk-devops16.csez.zohocorpin.com:31025/agent",
16
- "orgName": "clientcicdk8",
17
- "deptName": "clientcicdk8",
18
- "moduleName": "tickets"
19
- }
20
- }
@@ -1,44 +0,0 @@
1
- /* eslint-disable no-console */
2
- import {
3
- test as setup,
4
- expect
5
- } from '@zohodesk/testinglibrary';
6
- import {
7
- getDefaultActor,
8
- getUserForSelectedEditionAndProfile,
9
- performLoginSteps
10
- } from '@zohodesk/testinglibrary/helpers'
11
- import { SETUP_HOME_PAGE_SELECTORS } from '../modules/Setup/dom-selectors/SetupSelectors';
12
- import getUrlOrigin from '../shared/url-helpers/getUrlOrigin';
13
-
14
- const { edition, profile } = getDefaultActor();
15
-
16
- const user = getUserForSelectedEditionAndProfile(edition, profile);
17
-
18
- async function verifyPageIsLoaded(page) {
19
- const urlOrigin = getUrlOrigin(page.url());
20
- const domainOrigin = getUrlOrigin(process.env.domain);
21
- if (urlOrigin === domainOrigin) {
22
- await expect(
23
- page
24
- .locator('header')
25
- .getByLabel(SETUP_HOME_PAGE_SELECTORS.SETUP_ICON_LABEL)
26
- ).toBeVisible();
27
- return true;
28
- }
29
- return false;
30
- }
31
-
32
- setup(`${user.edition} - Authentication`, async ({ page }) => {
33
- const { email, password } = user;
34
- await performLoginSteps(
35
- {
36
- page,
37
- authFilePrefix: email,
38
- useremail: email,
39
- password: password
40
- },
41
- verifyPageIsLoaded
42
- );
43
- //await completeOnboardings({ page });
44
- });
@@ -1,33 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import {
4
- test as teardown,
5
- expect
6
- } from '@zohodesk/testinglibrary';
7
- import { isDevelopmentSetup, loadCookiesIfPresent } from '@zohodesk/testinglibrary/helpers'
8
- import getUrlOrigin from '../shared/url-helpers/getUrlOrigin';
9
-
10
- // We are adding teardown logic only in CI mode
11
- if (!isDevelopmentSetup()) {
12
- teardown(`Log out scenarios`, async ({ page }) => {
13
- const authDirectory = path.resolve(
14
- process.cwd(),
15
- 'uat',
16
- 'playwright',
17
- '.auth'
18
- );
19
- const files = fs.readdirSync(authDirectory);
20
- const promises = files.map(async file => {
21
- const authFilePath = path.join(authDirectory, file);
22
- await loadCookiesIfPresent(page, authFilePath);
23
- const domainOrigin = getUrlOrigin(process.env.domain);
24
- const logoutURL = `${domainOrigin}/support/logout.sas`;
25
- await page.goto(logoutURL);
26
- await page.waitForNavigation();
27
- await expect(page.locator('[id="signin_flow"]')).toBeVisible();
28
- await fs.rmSync(authFilePath);
29
- });
30
-
31
- await Promise.all(promises);
32
- });
33
- }
@@ -1,16 +0,0 @@
1
- import { test, expect } from "@zohodesk/testinglibrary";
2
-
3
- test.describe("Verify no authentication required @nobdd", () => {
4
-
5
- test("Verify the page is not logged in", async ({ page }) => {
6
-
7
- await page.goto(process.env.domain);
8
-
9
- await page.waitForSelector('#login');
10
-
11
- const isLoggedIn = await page.isVisible('#login');
12
- expect(isLoggedIn).toBe(true);
13
-
14
- });
15
-
16
- });
@@ -1,9 +0,0 @@
1
- const i18n = require('./i18n');
2
- const unAuthenticatedPage = require('./unauthenticatedPage');
3
-
4
- const customFixtures = {
5
- ...i18n,
6
- ...unAuthenticatedPage
7
- };
8
-
9
- module.exports = customFixtures;
@@ -1,25 +0,0 @@
1
- /* eslint-disable no-param-reassign */
2
-
3
- // Note: We are duplicating below method from @zohodesk/i18n. We are not importing it as react package not yet availble in test environment.
4
- function replaceI18NValuesWithRegex(i18nStr, values) {
5
- if (typeof values !== 'undefined') {
6
- if (Array.isArray(values)) {
7
- for (let i = 0; i < values.length; i++) {
8
- i18nStr = i18nStr.replace(new RegExp(`\\{${i}\\}`, 'g'), values[i]);
9
- }
10
- } else {
11
- i18nStr = i18nStr.replace(new RegExp('\\{0\\}', 'g'), values);
12
- }
13
- }
14
- return i18nStr;
15
- }
16
-
17
- module.exports = {
18
- i18N: async ({ page }, use) => {
19
- await use(async (key, values) => {
20
- const i18nValue = await page.evaluate((i18nKey) => window.i18n[i18nKey], key);
21
- const i18nStr = replaceI18NValuesWithRegex(i18nValue, values)
22
- return i18nStr;
23
- })
24
- }
25
- }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- unauthenticatedPage: async ({ browser }, use) => {
3
- const context = await browser.newContext({ storageState: null });
4
- const unauthenticatedPage = await context.newPage();
5
- await use(unauthenticatedPage);
6
- await context.close();
7
- }
8
- }
@@ -1,7 +0,0 @@
1
- const completeOnboardings = require("./onboardings/onboardingUpdate")
2
-
3
-
4
-
5
- module.exports = {
6
- completeOnboardings
7
- }
@@ -1,44 +0,0 @@
1
- async function get_cookie(page) {
2
- return page.evaluate(async () => {
3
- const results = document.cookie.match(`crmcsr=(.*?)(;|$)`);
4
- if (results) {
5
- return unescape(results[1]);
6
- }
7
- return null;
8
- });
9
- }
10
-
11
- async function getOnboardings({ page, cookieVal }) {
12
- return page.evaluate(
13
- async (cookieVal) =>
14
- fetch('/api/v1/onboardingStatus', {
15
- method: 'GET',
16
- headers: {
17
- orgId: window.currentOrg.id,
18
- 'X-ZCSRF-TOKEN': `crmcsrfparam=${cookieVal}`
19
- }
20
- }).then((r) => (r.ok ? r.json() : Promise.reject(r))),
21
- cookieVal
22
- );
23
- }
24
-
25
- async function completeOnboardings({ page }) {
26
- const cookieVal = await get_cookie(page);
27
- const onboardings = await getOnboardings({ page });
28
- if (onboardings.pending.length) {
29
- await page.evaluate(
30
- async ({ cookieVal, onboardings }) =>
31
- fetch('/api/v1/onboardingStatus/markComplete', {
32
- method: 'POST',
33
- headers: {
34
- orgId: window.currentOrg.id,
35
- 'X-ZCSRF-TOKEN': `crmcsrfparam=${cookieVal}`
36
- },
37
- body: JSON.stringify({ items: onboardings.pending })
38
- }),
39
- { cookieVal, onboardings }
40
- );
41
- }
42
- }
43
-
44
- module.exports = completeOnboardings;
@@ -1,6 +0,0 @@
1
- function getUrlOrigin(url) {
2
- const { origin } = new URL(url);
3
- return origin;
4
- }
5
-
6
- module.exports = getUrlOrigin;
@@ -1,37 +0,0 @@
1
- const customFixtures = require('./uat/shared/commands/_index-custom-fixtures');
2
-
3
- const { getDefaultActor } = require('@zohodesk/testinglibrary/helpers');
4
-
5
- function getPrimaryCookiePath() {
6
- const { email } = getDefaultActor();
7
- return `uat/playwright/.auth/${email}-cookies.json`;
8
- }
9
-
10
- /**
11
- * Represents the user configuration object.
12
- * @typedef {import('@zohodesk/testinglibrary').UserConfig} UserConfig
13
- */
14
- module.exports = {
15
- headless: false,
16
- retries:1,
17
- openReportOn: 'never',
18
- browsers: ['Chrome'],
19
- isAuthMode: true,
20
- authFilePath: getPrimaryCookiePath(),
21
- trace: 'retain-on-failure',
22
- video: 'retain-on-failure',
23
- retries:1,
24
- bddMode: false,
25
- expectTimeout: 10 * 1000,
26
- testTimeout: 60 * 1000,
27
- globalTimeout: 2 * 60 * 60 * 1000,
28
- featureFilesFolder: 'feature-files',
29
- stepDefinitionsFolder: 'steps',
30
- viewport: { width: 1280, height: 720 },
31
- testIdAttribute: 'data-id',
32
- editionOrder: ['Free', 'Express', 'Standard', 'Professional', 'Enterprise'],
33
- additionalPages: {
34
- ...customFixtures
35
- },
36
- url:""
37
- };