@zohodesk/testinglibrary 3.2.16 → 3.2.17

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/README.md CHANGED
@@ -17,17 +17,11 @@
17
17
 
18
18
  - npm run report
19
19
 
20
- ### v4.0.0 - 04-12-2025
21
20
 
22
- #### Features
23
-
24
- - Supported node 20 for the testing-framework
21
+ ### v3.2.17 - 09-12-2025
25
22
 
26
- - Below package versions are updated in this release.
27
- - playwright - 1.56.1,
28
- - playwright-bdd - 8.4.2,
29
- - @playwright/test - 1.56.1,
30
- - @cucumber/cucumber - 12.2.0
23
+ #### Enhancement
24
+ - Cookie storage prefix support is provided in this version.
31
25
 
32
26
  ### v3.2.15 - 14-11-2025
33
27
 
@@ -52,6 +46,14 @@
52
46
 
53
47
  - 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
54
48
 
49
+ ### Issue fix
50
+ - Custom teardown comment provided
51
+
52
+ ### v3.2.10 - 09-10-2025
53
+
54
+ #### Enhancement
55
+ - A teardown option has been introduced in the configuration to manage and clean up login sessions stored in the NFS environment.
56
+
55
57
 
56
58
  ### v3.2.9 - 26-09-2025
57
59
 
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.combineConfiguration = combineConfiguration;
7
8
  exports.getApplicationConfig = getApplicationConfig;
8
- exports.getRunStage = getRunStage;
9
+ var _path = _interopRequireDefault(require("path"));
9
10
  var _logger = require("../../../utils/logger");
10
11
  var _configFileNameProvider = require("../helpers/configFileNameProvider");
11
12
  var _mergeObjects = require("../helpers/mergeObjects");
12
13
  var _fs = require("fs");
14
+ const Configuration = require("./Configuration");
13
15
  function combineConfiguration(defaultConfig, userConfiguration) {
14
16
  let configurationObj = {};
15
17
  Object.keys(userConfiguration).forEach(configKey => {
@@ -24,10 +26,10 @@ function combineConfiguration(defaultConfig, userConfiguration) {
24
26
  });
25
27
  return (0, _mergeObjects.mergeObjects)(defaultConfig, configurationObj);
26
28
  }
27
- function getApplicationConfig(stage, mode) {
29
+ function getApplicationConfig(mode) {
28
30
  let filePath = "";
29
31
  try {
30
- filePath = (0, _configFileNameProvider.getUATFileName)(stage, mode);
32
+ filePath = _path.default.resolve(process.cwd(), (0, _configFileNameProvider.getUATFileName)(mode));
31
33
  if (!(0, _fs.existsSync)(filePath)) {
32
34
  throw new Error("Exception while getting the uat file from the application - " + filePath);
33
35
  }
@@ -38,8 +40,4 @@ function getApplicationConfig(stage, mode) {
38
40
  _logger.Logger.error(err);
39
41
  return {};
40
42
  }
41
- }
42
- function getRunStage() {
43
- const stage = process.env.stage;
44
- return stage || 'uat';
45
43
  }
@@ -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 = ['stage', 'mode', 'tags', 'edition', 'browsers', 'filePath', 'headless', 'modules', 'isTearDown'];
7
+ const CUSTOM_COMMANDS = exports.CUSTOM_COMMANDS = ['mode', 'tags', 'edition', 'browsers', 'filePath', 'headless', 'modules', 'isTearDown'];
@@ -17,20 +17,19 @@ function setEnvironmentVariables(configJSON) {
17
17
  }
18
18
  function addHelperLogsForEnvInitialization() {
19
19
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `Mode under which test cases should run has not been specified in args.`);
20
- _logger.Logger.log(_logger.Logger.INFO_TYPE, `Please specify --mode='dev/ci/cd/devautomation' while running ZDTestingFramework test`);
20
+ _logger.Logger.log(_logger.Logger.INFO_TYPE, `Please specify --mode='dev/prod' while running ZDTestingFramework test`);
21
21
  _logger.Logger.log(_logger.Logger.INFO_TYPE, `Going to use default mode as dev`);
22
22
  }
23
- function initializeEnvConfig(stage, mode, isAuthMode) {
24
- if (!mode) {
25
- addHelperLogsForEnvInitialization();
26
- mode = 'dev';
27
- }
28
- const configFilePath = (0, _fs.readFileSync)(_path.default.resolve(process.cwd(), `./${(0, _configFileNameProvider.getEnvConfigFilePath)(stage, mode)}`));
23
+ function initializeEnvConfig(mode, isAuthMode) {
29
24
  try {
30
- const configJSON = JSON.parse(configFilePath);
25
+ if (!mode) {
26
+ addHelperLogsForEnvInitialization();
27
+ mode = 'dev';
28
+ }
29
+ const configFile = (0, _fs.readFileSync)(_path.default.resolve(process.cwd(), `./${(0, _configFileNameProvider.getEnvConfigFilePath)(mode)}`));
30
+ const configJSON = JSON.parse(configFile);
31
31
  setEnvironmentVariables({
32
32
  ...configJSON,
33
- stage,
34
33
  mode
35
34
  });
36
35
  if (isAuthMode) {
@@ -39,6 +38,6 @@ function initializeEnvConfig(stage, mode, isAuthMode) {
39
38
  }
40
39
  } catch (err) {
41
40
  _logger.Logger.error(err);
42
- throw new Error(`Config File Not Exists. Please provide a ${configFilePath} to initialize the environment variables`);
41
+ throw new Error(`Config File Not Exists. Please provide a config file ${(0, _configFileNameProvider.getEnvConfigFilePath)(mode)} to intiailize the environment variables `);
43
42
  }
44
43
  }
@@ -13,9 +13,7 @@ exports.isCI = isCI;
13
13
  exports.isDevelopmentSetup = isDevelopmentSetup;
14
14
  var _path = _interopRequireDefault(require("path"));
15
15
  var _fs = require("fs");
16
- var _configPathResolver = require("../configPathResolver");
17
- var _ConfigurationHelper = require("./../../configuration/ConfigurationHelper");
18
- var _configConstants = _interopRequireDefault(require("../../constants/configConstants"));
16
+ var _readConfigFile = require("../../readConfigFile");
19
17
  /* eslint-disable global-require */
20
18
  function getRunMode() {
21
19
  let {
@@ -32,18 +30,19 @@ function isDevelopmentSetup() {
32
30
  return mode === 'DEV' || mode === 'dev';
33
31
  }
34
32
  function getDefaultActorConf() {
35
- const stage = (0, _ConfigurationHelper.getRunStage)();
36
- const stagePath = (0, _configPathResolver.getConfigPath)(stage);
37
- const modeSettingsFile = `${stagePath}/${getRunMode()}/${_configConstants.default.SETTINGS_FILE}`;
38
- const filePath = _path.default.join(_path.default.resolve(process.cwd(), modeSettingsFile));
33
+ const {
34
+ uatDirectory
35
+ } = (0, _readConfigFile.generateConfigFromFile)();
36
+ const modeSettingsFile = `conf/${getRunMode()}/settings.json`;
37
+ const filePath = _path.default.join(uatDirectory, modeSettingsFile);
39
38
  try {
40
39
  if (!(0, _fs.existsSync)(filePath)) {
41
- const defaultSettingsFile = _path.default.join(_path.default.resolve(process.cwd(), `${stagePath}/${_configConstants.default.DEFAULT_CONFIG_DIR}/${_configConstants.default.SETTINGS_FILE}`));
40
+ const defaultSettingsFile = _path.default.join(uatDirectory, `conf/default/settings.json`);
42
41
  return require(defaultSettingsFile);
43
42
  }
44
43
  return require(filePath);
45
44
  } catch (error) {
46
- throw new Error(`${filePath} file missing.`);
45
+ throw new Error(`${defaultSettingFile} ${filePath} both files are missing.`);
47
46
  }
48
47
  }
49
48
  function getDefaultActor() {
@@ -54,17 +53,18 @@ function getDefaultActor() {
54
53
  return getUserForSelectedEditionAndProfile(edition, profile);
55
54
  }
56
55
  function getListOfActors(betaFeature) {
56
+ const {
57
+ uatDirectory
58
+ } = (0, _readConfigFile.generateConfigFromFile)();
57
59
  const mode = getRunMode();
58
- const stage = (0, _ConfigurationHelper.getRunStage)();
59
- const stagePath = (0, _configPathResolver.getConfigPath)(stage);
60
- let configFile = _path.default.join(_path.default.resolve(process.cwd(), `${stagePath}/${mode}/${_configConstants.default.ACTOR_DIR}/${_configConstants.default.INDEX_FILE}`));
60
+ let configFile = _path.default.join(uatDirectory, `conf/${mode}/actors/index.js`);
61
61
  let betaReference = mode;
62
62
  if (!(0, _fs.existsSync)(configFile)) {
63
- configFile = _path.default.join(_path.default.resolve(process.cwd(), `${stagePath}/${_configConstants.default.DEFAULT_CONFIG_DIR}/${_configConstants.default.ACTOR_DIR}/${_configConstants.default.INDEX_FILE}`));
63
+ configFile = _path.default.join(uatDirectory, `conf/default/actors/index.js`);
64
64
  betaReference = "default";
65
65
  }
66
66
  if (betaFeature) {
67
- configFile = _path.default.join(_path.default.resolve(process.cwd(), `${stagePath}/${betaReference}/${_configConstants.default.ACTOR_DIR}/${_configConstants.default.BETA_DIR}/${betaFeature}/${_configConstants.default.INDEX_FILE}`));
67
+ configFile = _path.default.join(uatDirectory, `conf/${betaReference}/actors/beta/${betaFeature}/index.js`);
68
68
  if (!(0, _fs.existsSync)(configFile)) {
69
69
  throw new Error(`There is no beta feature configured with the name "${betaFeature}"`);
70
70
  }
@@ -41,6 +41,8 @@ async function executeDefaultLoginSteps(context, testInfo, testDetails, testPort
41
41
  }
42
42
  try {
43
43
  const projectName = testInfo.project.name;
44
+ const authFileName = process.env.authFileName;
45
+ testDetails.authFilePrefix = authFileName;
44
46
  if (testPortalDetails && projectName !== 'setup' && projectName !== 'cleanup') {
45
47
  await context.clearCookies();
46
48
  await (0, _auth.performLoginSteps)(testDetails, async testInfo => {
@@ -18,14 +18,22 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
18
18
  authFilePrefix,
19
19
  email
20
20
  } = testInfo;
21
- authFilePrefix = authFilePrefix || email;
22
- const authFile = _path.default.resolve(_path.default.join((0, _checkAuthCookies.getAuthFileDirectory)(), `${authFilePrefix}-cookies.json`));
23
- const lockFileName = email.replace(/[@.]/g, '_');
21
+ let authFileName;
22
+ if (!authFilePrefix) {
23
+ authFileName = email;
24
+ } else if (authFilePrefix.includes(email)) {
25
+ authFileName = authFilePrefix;
26
+ } else {
27
+ authFileName = authFilePrefix + email;
28
+ }
29
+ process.env.authFileName = authFileName;
30
+ const authFile = _path.default.resolve(_path.default.join((0, _checkAuthCookies.getAuthFileDirectory)(), `${authFileName}-cookies.json`));
31
+ const lockFileName = authFileName.replace(/[@.]/g, '_');
24
32
  const fileMutex = new _fileMutex.default((0, _checkAuthDirectory.getLockDirectoryPath)(), lockFileName, _fileMutexConfig.fileDeletionTimeoutConfig);
25
33
  let loginUsingCookie = false;
26
34
  try {
27
35
  if ((0, _checkAuthCookies.verifyIfCookieFileExists)(authFile)) {
28
- console.log(`${email} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
36
+ console.log(`${authFileName} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
29
37
  loginUsingCookie = true;
30
38
  } else {
31
39
  await fileMutex.acquire();
@@ -40,7 +48,7 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
40
48
  });
41
49
  }
42
50
  } catch (error) {
43
- console.error(`Error during login for ${email}:`, error);
51
+ console.error(`Error during login for ${authFileName}:`, error);
44
52
  } finally {
45
53
  if (!loginUsingCookie) {
46
54
  await fileMutex.release();
@@ -10,29 +10,22 @@ exports.getUATFileName = getUATFileName;
10
10
  var _path = _interopRequireDefault(require("path"));
11
11
  var _fs = _interopRequireDefault(require("fs"));
12
12
  var _auth = require("./auth");
13
- var _ConfigurationHelper = require("./../configuration/ConfigurationHelper");
14
- var _configPathResolver = require("./configPathResolver");
15
- var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
16
- function getUATFileName(stage, mode) {
17
- stage = stage || (0, _ConfigurationHelper.getRunStage)();
13
+ function getUATFileName(mode) {
18
14
  mode = mode || (0, _auth.getRunMode)();
19
- const stagePath = (0, _configPathResolver.getConfigPath)(stage);
20
- const uatConfFilePath = _path.default.resolve(process.cwd(), `${stagePath}/${mode}/${_configConstants.default.UAT_CONFIG_FILE}`);
15
+ const uatConfFilePath = _path.default.resolve(process.cwd(), `uat/conf/${mode}/uat.config.js`);
21
16
  if (_fs.default.existsSync(uatConfFilePath)) {
22
17
  return uatConfFilePath;
23
18
  }
24
- ;
25
- return _path.default.resolve(process.cwd(), `${stagePath}/${_configConstants.default.DEFAULT_CONFIG_DIR}/${_configConstants.default.UAT_CONFIG_FILE}`);
19
+ return _path.default.resolve(process.cwd(), `uat/conf/default/uat.config.js`);
26
20
  }
27
- function getEnvConfigFilePath(stage, mode) {
28
- const stagePath = (0, _configPathResolver.getConfigPath)(stage);
29
- const confFilePath = `${stagePath}/${mode}/${_configConstants.default.SETTINGS_FILE}`;
21
+ function getEnvConfigFilePath(mode) {
22
+ const confFilePath = _path.default.resolve(process.cwd(), `uat/conf/${mode}/settings.json`);
30
23
  // TODO: Actors Mode as config
31
24
  if (_fs.default.existsSync(confFilePath)) {
32
- return confFilePath;
25
+ return `uat/conf/${mode}/settings.json`;
33
26
  }
34
- return `${stagePath}/${_configConstants.default.DEFAULT_CONFIG_DIR}/${_configConstants.default.SETTINGS_FILE}`;
27
+ return `uat/conf/default/settings.json`;
35
28
  }
36
29
  function getReportFileName() {
37
- return `${_configConstants.default.TEST_SUMMARY_FILE}`;
30
+ return `test-summary.json`;
38
31
  }
@@ -17,6 +17,10 @@ var _Configuration = _interopRequireDefault(require("./configuration/Configurati
17
17
  var _UserArgs = _interopRequireDefault(require("./configuration/UserArgs"));
18
18
  var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
19
19
  let cachedConfig = null;
20
+ function getPrimaryCookiePath() {
21
+ const authFileName = process.env.authFileName;
22
+ return `uat/playwright/.auth/${authFileName}-cookies.json`;
23
+ }
20
24
  function getDefaultConfig() {
21
25
  return {
22
26
  isTearDown: true,
@@ -33,7 +37,7 @@ function getDefaultConfig() {
33
37
  bddMode: false,
34
38
  expectTimeout: 5 * 1000,
35
39
  testTimeout: 60 * 1000,
36
- authFilePath: 'uat/playwright/.auth/user.json',
40
+ authFilePath: getPrimaryCookiePath(),
37
41
  viewport: {
38
42
  width: 1280,
39
43
  height: 720
@@ -111,16 +115,15 @@ function combineDefaultConfigWithUserConfig(userConfiguration) {
111
115
  */
112
116
 
113
117
  function getConfigFilePath() {
114
- return (0, _configFileNameProvider.getUATFileName)();
118
+ return _path.default.resolve(process.cwd(), (0, _configFileNameProvider.getUATFileName)());
115
119
  }
116
120
  function generateConfigFromFile() {
117
121
  if (cachedConfig === null) {
118
122
  // Getting the default config's from framework
119
123
  const uatConfig = new _Configuration.default(getDefaultConfig());
120
124
  // overriding the application config's from project
125
+ const appConfig = new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)());
121
126
  const userArgConfig = new _Configuration.default(_UserArgs.default.parseToObject(process.argv.slice(2)));
122
- const stage = userArgConfig.get("stage");
123
- const appConfig = new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)(stage));
124
127
  // overriding the user config's from CLI
125
128
  uatConfig.addAll(appConfig);
126
129
  uatConfig.addAll(userArgConfig);
@@ -86,8 +86,7 @@ function main() {
86
86
  // overriding the application config's from project
87
87
  const userArgConfig = new _Configuration.default(_UserArgs.default.parseToObject(process.argv.slice(2)));
88
88
  const mode = userArgConfig.get("mode");
89
- const stage = userArgConfig.get("stage");
90
- uatConfig.addAll(new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)(stage, mode)));
89
+ uatConfig.addAll(new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)(mode)));
91
90
  // overriding the user config's from CLI
92
91
  uatConfig.addAll(userArgConfig);
93
92
  const modules = uatConfig.get('modules');
@@ -96,7 +95,6 @@ function main() {
96
95
  //We need to change this process.env variable to pass the module name in future.
97
96
  process.env.modules = modules;
98
97
  process.env.tearDown = tearDown;
99
- process.env.stage = stage;
100
98
  const {
101
99
  isAuthMode,
102
100
  editionOrder,
@@ -104,7 +102,7 @@ function main() {
104
102
  bddMode = false,
105
103
  headless = false
106
104
  } = uatConfig.getAll();
107
- (0, _envInitializer.initializeEnvConfig)(stage, mode, isAuthMode);
105
+ (0, _envInitializer.initializeEnvConfig)(mode, isAuthMode);
108
106
 
109
107
  //This is only used for pass the user arguments to need places in legacy code. We need to rewamp that also.
110
108
  const userArgsObject = userArgConfig.getAll();
@@ -4,72 +4,31 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  var _fs = require("fs");
5
5
  var _path = _interopRequireDefault(require("path"));
6
6
  var _configFileNameProvider = require("../../../../../core/playwright/helpers/configFileNameProvider");
7
- var _configPathResolver = require("../../../../../core/playwright/helpers/configPathResolver");
8
7
  jest.mock('fs');
9
- jest.mock('path', () => ({
10
- resolve: jest.fn()
11
- }));
12
- jest.mock("../../../../../core/playwright/helpers/configPathResolver", () => ({
13
- getConfigPath: jest.fn()
14
- }));
8
+ jest.mock('path');
15
9
  const mockCwd = '/mock/current/directory';
16
10
  _path.default.resolve = jest.fn();
17
11
  process.cwd = jest.fn(() => mockCwd);
18
12
  describe('getUATFileName', () => {
19
13
  beforeEach(() => {
20
14
  jest.clearAllMocks();
21
- _path.default.resolve.mockImplementation((...segments) => segments.join('/'));
22
15
  });
23
- test('should return pipeline-matched config path when file exists', () => {
24
- const stage = 'uat';
16
+ test('return the pipeline matched config files for pipeline matched files exists', () => {
25
17
  const mode = 'cd';
26
- _configPathResolver.getConfigPath.mockReturnValue(`${stage}/conf`);
27
- _fs.existsSync.mockReturnValue(true);
28
- const expected = `${process.cwd()}/${stage}/conf/${mode}/uat.config.js`;
29
- const result = (0, _configFileNameProvider.getUATFileName)(stage, mode);
30
- expect(_configPathResolver.getConfigPath).toHaveBeenCalledWith(stage);
31
- expect(_fs.existsSync).toHaveBeenCalledWith(expected);
32
- expect(result).toBe(expected);
33
- });
34
- test('should use default stage and mode when not provided', () => {
35
- const mode = 'dev';
36
- const stageConfigPath = 'uat/conf';
37
- const expectedPath = `${mockCwd}/${stageConfigPath}/${mode}/uat.config.js`;
18
+ const mockPath = `${mockCwd}/uat/conf/${mode}/uat.config.js`;
38
19
  _fs.existsSync.mockReturnValue(true);
20
+ _path.default.resolve.mockImplementation((...args) => args.join('/'));
39
21
  const result = (0, _configFileNameProvider.getUATFileName)(mode);
40
- expect(_fs.existsSync).toHaveBeenCalledWith(`${mockCwd}/uat/conf/${mode}/uat.config.js`);
41
- expect(result).toBe(expectedPath);
42
- });
43
- test('should return the default config files for pipeline matched files not exists', () => {
44
- const mockStage = 'uat';
45
- const mockMode = 'ci';
46
- const stageConfigPath = 'uat/conf';
47
- const nonExistingPath = `${mockCwd}/${stageConfigPath}/${mockMode}/uat.config.js`;
48
- const expectedDefaultPath = `${mockCwd}/${mockStage}/conf/default/uat.config.js`;
49
- _configPathResolver.getConfigPath.mockReturnValue(stageConfigPath);
50
- _fs.existsSync.mockReturnValue(false);
51
- const result = (0, _configFileNameProvider.getUATFileName)(mockStage, mockMode);
52
- expect(_fs.existsSync).toHaveBeenCalledWith(nonExistingPath);
53
- expect(result).toBe(expectedDefaultPath);
54
- });
55
- });
56
- describe('getEnvConfigFilePath', () => {
57
- beforeEach(() => {
58
- jest.clearAllMocks();
59
- _path.default.resolve.mockImplementation((...segments) => segments.join('/'));
60
- });
61
- test('should return conf file path when file exists', () => {
62
- _configPathResolver.getConfigPath.mockReturnValue('uat/conf');
63
- _fs.existsSync.mockReturnValue(true);
64
- const result = (0, _configFileNameProvider.getEnvConfigFilePath)('uat', 'cd');
65
- expect(_configPathResolver.getConfigPath).toHaveBeenCalledWith('uat');
66
- expect(_fs.existsSync).toHaveBeenCalled();
67
- expect(result).toBe('uat/conf/cd/settings.json');
22
+ expect(_fs.existsSync).toHaveBeenCalledWith(mockPath);
23
+ expect(result).toBe(mockPath);
68
24
  });
69
- test('should return default path when file does not exist', () => {
70
- _configPathResolver.getConfigPath.mockReturnValue('uat/conf');
25
+ test('return the default config files for pipeline matched files not exists', () => {
26
+ const mode = 'ci';
27
+ const defaultPath = `${mockCwd}/uat/conf/default/uat.config.js`;
71
28
  _fs.existsSync.mockReturnValue(false);
72
- const result = (0, _configFileNameProvider.getEnvConfigFilePath)('uat', 'ci');
73
- expect(result).toBe('uat/conf/default/settings.json');
29
+ _path.default.resolve.mockImplementation((...args) => args.join('/'));
30
+ const result = (0, _configFileNameProvider.getUATFileName)(mode);
31
+ expect(_fs.existsSync).toHaveBeenCalledWith(`${mockCwd}/uat/conf/${mode}/uat.config.js`);
32
+ expect(result).toBe(defaultPath);
74
33
  });
75
34
  });
@@ -1,83 +1,80 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _fs = _interopRequireDefault(require("fs"));
4
+ var _fs = require("fs");
5
5
  var _path = _interopRequireDefault(require("path"));
6
- var _getUsers = require("../../../../../core/playwright/helpers/auth/getUsers");
7
- var _configPathResolver = require("../../../../../core/playwright/helpers/configPathResolver");
8
6
  jest.mock('fs');
9
7
  jest.mock('path');
10
- jest.mock('../../../../../core/playwright/helpers/configPathResolver', () => ({
11
- getConfigPath: jest.fn()
8
+ jest.mock('../../../../../core/playwright/readConfigFile', () => ({
9
+ generateConfigFromFile: jest.fn(() => ({
10
+ uatDirectory: '/test/directory'
11
+ })),
12
+ getRunMode: jest.fn(() => 'dev')
12
13
  }));
14
+ const {
15
+ getListOfActors
16
+ } = require('../../../../../core/playwright/helpers/auth/getUsers');
13
17
  describe('getListOfActors', () => {
14
- const stageConfig = 'uat/conf';
15
- const mode = 'dev';
16
- const stage = 'uat';
17
18
  beforeEach(() => {
18
19
  jest.clearAllMocks();
19
20
  _path.default.join.mockImplementation((...args) => args.join('/'));
20
- _path.default.resolve.mockImplementation((...args) => args.join('/'));
21
- _configPathResolver.getConfigPath.mockReturnValue('uat/conf');
22
21
  });
23
22
  test('throws an error when config file cannot be loaded', () => {
24
- _fs.default.existsSync.mockReturnValueOnce(true);
25
- jest.mock('/uat/conf/dev/actors/index.js', () => {
23
+ _fs.existsSync.mockReturnValueOnce(true); // Main config file exists
24
+
25
+ jest.mock('/test/directory/conf/dev/actors/index.js', () => {
26
26
  throw new Error('Loading error');
27
27
  }, {
28
28
  virtual: true
29
29
  });
30
- expect(() => (0, _getUsers.getListOfActors)()).toThrow(`Error loading actor configuration from ${_path.default.join(_path.default.resolve(process.cwd(), 'uat/conf/dev/actors/index.js'))}`);
30
+ expect(() => getListOfActors()).toThrow('Error loading actor configuration from /test/directory/conf/dev/actors/index.js');
31
31
  });
32
32
  test('throws an error when beta feature config does not exist', () => {
33
- _fs.default.existsSync.mockReturnValueOnce(true) // Main config file exists
33
+ _fs.existsSync.mockReturnValueOnce(true) // Main config file exists
34
34
  .mockReturnValueOnce(false); // Beta feature config does not exist in either path
35
35
 
36
36
  const betaFeature = 'nonExistentFeature';
37
- expect(() => (0, _getUsers.getListOfActors)(betaFeature)).toThrow(`There is no beta feature configured with the name "${betaFeature}"`);
37
+ expect(() => getListOfActors(betaFeature)).toThrow(`There is no beta feature configured with the name "${betaFeature}"`);
38
38
  });
39
- test('loads main configuration when betaFeature is not provided and main config exists', () => {
40
- _fs.default.existsSync.mockReturnValueOnce(true);
41
- const file = _path.default.join(_path.default.resolve(process.cwd(), `${stageConfig}/${mode}/actors/index.js`));
42
- jest.doMock(file, () => ({
39
+ test('loads main configuration when betaFeature is not provided and main config file exists', () => {
40
+ _fs.existsSync.mockReturnValueOnce(true);
41
+ jest.doMock('/test/directory/conf/dev/actors/index.js', () => ({
43
42
  actors: []
44
43
  }), {
45
44
  virtual: true
46
45
  });
47
- const result = (0, _getUsers.getListOfActors)();
46
+ const result = getListOfActors();
48
47
  expect(result).toEqual({
49
48
  actors: []
50
49
  });
51
50
  });
52
51
  test('falls back to default configuration if main config file does not exist', () => {
53
- _fs.default.existsSync.mockReturnValueOnce(false) // Main config file missing
54
- .mockReturnValueOnce(true); // Beta feature config exists
55
-
56
- const defaultConfigFile = _path.default.join(_path.default.resolve(process.cwd(), `${stage}/conf/default/actors/index.js`));
57
- jest.doMock(defaultConfigFile, () => ({
52
+ _fs.existsSync.mockReturnValueOnce(false).mockReturnValueOnce(true);
53
+ jest.doMock('/test/directory/conf/default/actors/index.js', () => ({
58
54
  actors: []
59
55
  }), {
60
56
  virtual: true
61
57
  });
62
- const result = (0, _getUsers.getListOfActors)();
58
+ const result = getListOfActors();
63
59
  expect(result).toEqual({
64
60
  actors: []
65
61
  });
66
62
  });
67
63
  test('loads beta feature configuration when betaFeature is provided', () => {
68
- _fs.default.existsSync.mockReturnValueOnce(true) // Main config file exists
64
+ _fs.existsSync.mockReturnValueOnce(true) // Main config file exists
69
65
  .mockReturnValueOnce(true); // Beta feature config exists
70
66
 
71
67
  const betaFeature = 'parentchild';
72
- const betaFeaturePath = _path.default.join(_path.default.resolve(process.cwd(), `${stageConfig}/${mode}/actors/beta/${betaFeature}/index.js`));
68
+ const betaFeaturePath = `/test/directory/conf/dev/actors/beta/${betaFeature}/index.js`;
73
69
  jest.doMock(betaFeaturePath, () => ({
74
70
  betaActors: []
75
71
  }), {
76
72
  virtual: true
77
73
  });
78
- const result = (0, _getUsers.getListOfActors)(betaFeature);
74
+ const result = getListOfActors(betaFeature);
79
75
  expect(result).toEqual({
80
76
  betaActors: []
81
77
  });
78
+ expect(_path.default.join).toHaveBeenCalledWith('/test/directory', `conf/dev/actors/beta/${betaFeature}/index.js`);
82
79
  });
83
80
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "3.2.16",
3
+ "version": "3.2.17",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@zohodesk/testinglibrary",
9
- "version": "3.2.16",
9
+ "version": "3.2.17",
10
10
  "hasInstallScript": true,
11
11
  "license": "ISC",
12
12
  "dependencies": {
@@ -26,7 +26,6 @@
26
26
  "msw": "1.2.3",
27
27
  "playwright": "1.53.2",
28
28
  "playwright-bdd": "8.3.1",
29
- "properties-reader": "2.3.0",
30
29
  "supports-color": "8.1.1"
31
30
  },
32
31
  "bin": {
@@ -2037,6 +2036,67 @@
2037
2036
  "regexp-match-indices": "1.0.2"
2038
2037
  }
2039
2038
  },
2039
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/gherkin": {
2040
+ "version": "30.0.4",
2041
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-30.0.4.tgz",
2042
+ "integrity": "sha512-pb7lmAJqweZRADTTsgnC3F5zbTh3nwOB1M83Q9ZPbUKMb3P76PzK6cTcPTJBHWy3l7isbigIv+BkDjaca6C8/g==",
2043
+ "license": "MIT",
2044
+ "dependencies": {
2045
+ "@cucumber/messages": ">=19.1.4 <=26"
2046
+ }
2047
+ },
2048
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/gherkin/node_modules/@cucumber/messages": {
2049
+ "version": "26.0.1",
2050
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-26.0.1.tgz",
2051
+ "integrity": "sha512-DIxSg+ZGariumO+Lq6bn4kOUIUET83A4umrnWmidjGFl8XxkBieUZtsmNbLYgH/gnsmP07EfxxdTr0hOchV1Sg==",
2052
+ "license": "MIT",
2053
+ "dependencies": {
2054
+ "@types/uuid": "10.0.0",
2055
+ "class-transformer": "0.5.1",
2056
+ "reflect-metadata": "0.2.2",
2057
+ "uuid": "10.0.0"
2058
+ }
2059
+ },
2060
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/gherkin/node_modules/uuid": {
2061
+ "version": "10.0.0",
2062
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
2063
+ "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",
2064
+ "funding": [
2065
+ "https://github.com/sponsors/broofa",
2066
+ "https://github.com/sponsors/ctavan"
2067
+ ],
2068
+ "license": "MIT",
2069
+ "bin": {
2070
+ "uuid": "dist/bin/uuid"
2071
+ }
2072
+ },
2073
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/html-formatter": {
2074
+ "version": "21.10.1",
2075
+ "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.10.1.tgz",
2076
+ "integrity": "sha512-isaaNMNnBYThsvaHy7i+9kkk9V3+rhgdkt0pd6TCY6zY1CSRZQ7tG6ST9pYyRaECyfbCeF7UGH0KpNEnh6UNvQ==",
2077
+ "license": "MIT",
2078
+ "peerDependencies": {
2079
+ "@cucumber/messages": ">=18"
2080
+ }
2081
+ },
2082
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/messages": {
2083
+ "version": "27.2.0",
2084
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-27.2.0.tgz",
2085
+ "integrity": "sha512-f2o/HqKHgsqzFLdq6fAhfG1FNOQPdBdyMGpKwhb7hZqg0yZtx9BVqkTyuoNk83Fcvk3wjMVfouFXXHNEk4nddA==",
2086
+ "license": "MIT",
2087
+ "dependencies": {
2088
+ "@types/uuid": "10.0.0",
2089
+ "class-transformer": "0.5.1",
2090
+ "reflect-metadata": "0.2.2",
2091
+ "uuid": "11.0.5"
2092
+ }
2093
+ },
2094
+ "node_modules/@cucumber/cucumber/node_modules/@cucumber/tag-expressions": {
2095
+ "version": "6.1.2",
2096
+ "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-6.1.2.tgz",
2097
+ "integrity": "sha512-xa3pER+ntZhGCxRXSguDTKEHTZpUUsp+RzTRNnit+vi5cqnk6abLdSLg5i3HZXU3c74nQ8afQC6IT507EN74oQ==",
2098
+ "license": "MIT"
2099
+ },
2040
2100
  "node_modules/@cucumber/cucumber/node_modules/brace-expansion": {
2041
2101
  "version": "2.0.2",
2042
2102
  "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
@@ -2075,6 +2135,15 @@
2075
2135
  "url": "https://github.com/sponsors/isaacs"
2076
2136
  }
2077
2137
  },
2138
+ "node_modules/@cucumber/cucumber/node_modules/luxon": {
2139
+ "version": "3.6.1",
2140
+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
2141
+ "integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
2142
+ "license": "MIT",
2143
+ "engines": {
2144
+ "node": ">=12"
2145
+ }
2146
+ },
2078
2147
  "node_modules/@cucumber/cucumber/node_modules/minimatch": {
2079
2148
  "version": "9.0.5",
2080
2149
  "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
@@ -2102,13 +2171,27 @@
2102
2171
  "node": ">=10"
2103
2172
  }
2104
2173
  },
2174
+ "node_modules/@cucumber/cucumber/node_modules/uuid": {
2175
+ "version": "11.0.5",
2176
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
2177
+ "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
2178
+ "funding": [
2179
+ "https://github.com/sponsors/broofa",
2180
+ "https://github.com/sponsors/ctavan"
2181
+ ],
2182
+ "license": "MIT",
2183
+ "bin": {
2184
+ "uuid": "dist/esm/bin/uuid"
2185
+ }
2186
+ },
2105
2187
  "node_modules/@cucumber/gherkin": {
2106
- "version": "30.0.4",
2107
- "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-30.0.4.tgz",
2108
- "integrity": "sha512-pb7lmAJqweZRADTTsgnC3F5zbTh3nwOB1M83Q9ZPbUKMb3P76PzK6cTcPTJBHWy3l7isbigIv+BkDjaca6C8/g==",
2188
+ "version": "37.0.0",
2189
+ "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-37.0.0.tgz",
2190
+ "integrity": "sha512-vKJVJ6h4HCktG870wgYUUskNpFxbFI0WmAkVLPTz1LlLwJX7/KOBqFcr2/L3u0pPoHjbLRW+IpbiXLT2T13/wg==",
2109
2191
  "license": "MIT",
2192
+ "peer": true,
2110
2193
  "dependencies": {
2111
- "@cucumber/messages": ">=19.1.4 <=26"
2194
+ "@cucumber/messages": ">=31.0.0 <32"
2112
2195
  }
2113
2196
  },
2114
2197
  "node_modules/@cucumber/gherkin-streams": {
@@ -2175,16 +2258,7 @@
2175
2258
  "uuid": "10.0.0"
2176
2259
  }
2177
2260
  },
2178
- "node_modules/@cucumber/gherkin-utils/node_modules/commander": {
2179
- "version": "13.1.0",
2180
- "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
2181
- "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
2182
- "license": "MIT",
2183
- "engines": {
2184
- "node": ">=18"
2185
- }
2186
- },
2187
- "node_modules/@cucumber/gherkin-utils/node_modules/uuid": {
2261
+ "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/gherkin/node_modules/uuid": {
2188
2262
  "version": "10.0.0",
2189
2263
  "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
2190
2264
  "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",
@@ -2197,35 +2271,44 @@
2197
2271
  "uuid": "dist/bin/uuid"
2198
2272
  }
2199
2273
  },
2200
- "node_modules/@cucumber/gherkin/node_modules/@cucumber/messages": {
2201
- "version": "26.0.1",
2202
- "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-26.0.1.tgz",
2203
- "integrity": "sha512-DIxSg+ZGariumO+Lq6bn4kOUIUET83A4umrnWmidjGFl8XxkBieUZtsmNbLYgH/gnsmP07EfxxdTr0hOchV1Sg==",
2274
+ "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": {
2275
+ "version": "27.2.0",
2276
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-27.2.0.tgz",
2277
+ "integrity": "sha512-f2o/HqKHgsqzFLdq6fAhfG1FNOQPdBdyMGpKwhb7hZqg0yZtx9BVqkTyuoNk83Fcvk3wjMVfouFXXHNEk4nddA==",
2204
2278
  "license": "MIT",
2205
2279
  "dependencies": {
2206
2280
  "@types/uuid": "10.0.0",
2207
2281
  "class-transformer": "0.5.1",
2208
2282
  "reflect-metadata": "0.2.2",
2209
- "uuid": "10.0.0"
2283
+ "uuid": "11.0.5"
2210
2284
  }
2211
2285
  },
2212
- "node_modules/@cucumber/gherkin/node_modules/uuid": {
2213
- "version": "10.0.0",
2214
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz",
2215
- "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==",
2286
+ "node_modules/@cucumber/gherkin-utils/node_modules/commander": {
2287
+ "version": "13.1.0",
2288
+ "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
2289
+ "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==",
2290
+ "license": "MIT",
2291
+ "engines": {
2292
+ "node": ">=18"
2293
+ }
2294
+ },
2295
+ "node_modules/@cucumber/gherkin-utils/node_modules/uuid": {
2296
+ "version": "11.0.5",
2297
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
2298
+ "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
2216
2299
  "funding": [
2217
2300
  "https://github.com/sponsors/broofa",
2218
2301
  "https://github.com/sponsors/ctavan"
2219
2302
  ],
2220
2303
  "license": "MIT",
2221
2304
  "bin": {
2222
- "uuid": "dist/bin/uuid"
2305
+ "uuid": "dist/esm/bin/uuid"
2223
2306
  }
2224
2307
  },
2225
2308
  "node_modules/@cucumber/html-formatter": {
2226
- "version": "21.10.1",
2227
- "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.10.1.tgz",
2228
- "integrity": "sha512-isaaNMNnBYThsvaHy7i+9kkk9V3+rhgdkt0pd6TCY6zY1CSRZQ7tG6ST9pYyRaECyfbCeF7UGH0KpNEnh6UNvQ==",
2309
+ "version": "21.14.0",
2310
+ "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.14.0.tgz",
2311
+ "integrity": "sha512-vQqbmQZc0QiN4c+cMCffCItpODJlOlYtPG7pH6We096dBOa7u0ttDMjT6KrMAnQlcln54rHL46r408IFpuznAw==",
2229
2312
  "license": "MIT",
2230
2313
  "peerDependencies": {
2231
2314
  "@cucumber/messages": ">=18"
@@ -2256,15 +2339,14 @@
2256
2339
  }
2257
2340
  },
2258
2341
  "node_modules/@cucumber/messages": {
2259
- "version": "27.2.0",
2260
- "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-27.2.0.tgz",
2261
- "integrity": "sha512-f2o/HqKHgsqzFLdq6fAhfG1FNOQPdBdyMGpKwhb7hZqg0yZtx9BVqkTyuoNk83Fcvk3wjMVfouFXXHNEk4nddA==",
2342
+ "version": "31.0.0",
2343
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-31.0.0.tgz",
2344
+ "integrity": "sha512-Dqhatp4AjMsH9SREfWz3Q8nlGuwJMTW7YAW5L3OzRId86ZUEu/a8vIL1RO2c0agQefuBS2SVH9fEZ66ovrMYRA==",
2262
2345
  "license": "MIT",
2346
+ "peer": true,
2263
2347
  "dependencies": {
2264
- "@types/uuid": "10.0.0",
2265
2348
  "class-transformer": "0.5.1",
2266
- "reflect-metadata": "0.2.2",
2267
- "uuid": "11.0.5"
2349
+ "reflect-metadata": "0.2.2"
2268
2350
  }
2269
2351
  },
2270
2352
  "node_modules/@cucumber/query": {
@@ -2281,9 +2363,9 @@
2281
2363
  }
2282
2364
  },
2283
2365
  "node_modules/@cucumber/tag-expressions": {
2284
- "version": "6.1.2",
2285
- "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-6.1.2.tgz",
2286
- "integrity": "sha512-xa3pER+ntZhGCxRXSguDTKEHTZpUUsp+RzTRNnit+vi5cqnk6abLdSLg5i3HZXU3c74nQ8afQC6IT507EN74oQ==",
2366
+ "version": "6.2.0",
2367
+ "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-6.2.0.tgz",
2368
+ "integrity": "sha512-KIF0eLcafHbWOuSDWFw0lMmgJOLdDRWjEL1kfXEWrqHmx2119HxVAr35WuEd9z542d3Yyg+XNqSr+81rIKqEdg==",
2287
2369
  "license": "MIT"
2288
2370
  },
2289
2371
  "node_modules/@eslint-community/eslint-utils": {
@@ -4686,9 +4768,9 @@
4686
4768
  "license": "MIT"
4687
4769
  },
4688
4770
  "node_modules/baseline-browser-mapping": {
4689
- "version": "2.9.2",
4690
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.2.tgz",
4691
- "integrity": "sha512-PxSsosKQjI38iXkmb3d0Y32efqyA0uW4s41u4IVBsLlWLhCiYNpH/AfNOVWRqCQBlD8TFJTz6OUWNd4DFJCnmw==",
4771
+ "version": "2.8.30",
4772
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.30.tgz",
4773
+ "integrity": "sha512-aTUKW4ptQhS64+v2d6IkPzymEzzhw+G0bA1g3uBRV3+ntkH+svttKseW5IOR4Ed6NUVKqnY7qT3dKvzQ7io4AA==",
4692
4774
  "license": "Apache-2.0",
4693
4775
  "bin": {
4694
4776
  "baseline-browser-mapping": "dist/cli.js"
@@ -4740,9 +4822,9 @@
4740
4822
  }
4741
4823
  },
4742
4824
  "node_modules/browserslist": {
4743
- "version": "4.28.1",
4744
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
4745
- "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
4825
+ "version": "4.28.0",
4826
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
4827
+ "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==",
4746
4828
  "funding": [
4747
4829
  {
4748
4830
  "type": "opencollective",
@@ -4759,11 +4841,11 @@
4759
4841
  ],
4760
4842
  "license": "MIT",
4761
4843
  "dependencies": {
4762
- "baseline-browser-mapping": "^2.9.0",
4763
- "caniuse-lite": "^1.0.30001759",
4764
- "electron-to-chromium": "^1.5.263",
4844
+ "baseline-browser-mapping": "^2.8.25",
4845
+ "caniuse-lite": "^1.0.30001754",
4846
+ "electron-to-chromium": "^1.5.249",
4765
4847
  "node-releases": "^2.0.27",
4766
- "update-browserslist-db": "^1.2.0"
4848
+ "update-browserslist-db": "^1.1.4"
4767
4849
  },
4768
4850
  "bin": {
4769
4851
  "browserslist": "cli.js"
@@ -4877,9 +4959,9 @@
4877
4959
  }
4878
4960
  },
4879
4961
  "node_modules/caniuse-lite": {
4880
- "version": "1.0.30001759",
4881
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz",
4882
- "integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==",
4962
+ "version": "1.0.30001756",
4963
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001756.tgz",
4964
+ "integrity": "sha512-4HnCNKbMLkLdhJz3TToeVWHSnfJvPaq6vu/eRP0Ahub/07n484XHhBF5AJoSGHdVrS8tKFauUQz8Bp9P7LVx7A==",
4883
4965
  "funding": [
4884
4966
  {
4885
4967
  "type": "opencollective",
@@ -5570,9 +5652,9 @@
5570
5652
  "license": "MIT"
5571
5653
  },
5572
5654
  "node_modules/electron-to-chromium": {
5573
- "version": "1.5.266",
5574
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.266.tgz",
5575
- "integrity": "sha512-kgWEglXvkEfMH7rxP5OSZZwnaDWT7J9EoZCujhnpLbfi0bbNtRkgdX2E3gt0Uer11c61qCYktB3hwkAS325sJg==",
5655
+ "version": "1.5.259",
5656
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.259.tgz",
5657
+ "integrity": "sha512-I+oLXgpEJzD6Cwuwt1gYjxsDmu/S/Kd41mmLA3O+/uH2pFRO/DvOjUyGozL8j3KeLV6WyZ7ssPwELMsXCcsJAQ==",
5576
5658
  "license": "ISC"
5577
5659
  },
5578
5660
  "node_modules/emittery": {
@@ -5784,27 +5866,6 @@
5784
5866
  "url": "https://github.com/sponsors/sindresorhus"
5785
5867
  }
5786
5868
  },
5787
- "node_modules/escodegen": {
5788
- "version": "2.1.0",
5789
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
5790
- "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
5791
- "license": "BSD-2-Clause",
5792
- "dependencies": {
5793
- "esprima": "^4.0.1",
5794
- "estraverse": "^5.2.0",
5795
- "esutils": "^2.0.2"
5796
- },
5797
- "bin": {
5798
- "escodegen": "bin/escodegen.js",
5799
- "esgenerate": "bin/esgenerate.js"
5800
- },
5801
- "engines": {
5802
- "node": ">=6.0"
5803
- },
5804
- "optionalDependencies": {
5805
- "source-map": "~0.6.1"
5806
- }
5807
- },
5808
5869
  "node_modules/eslint": {
5809
5870
  "version": "9.39.1",
5810
5871
  "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz",
@@ -9259,6 +9320,27 @@
9259
9320
  }
9260
9321
  }
9261
9322
  },
9323
+ "node_modules/jsdom/node_modules/escodegen": {
9324
+ "version": "2.1.0",
9325
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz",
9326
+ "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==",
9327
+ "license": "BSD-2-Clause",
9328
+ "dependencies": {
9329
+ "esprima": "^4.0.1",
9330
+ "estraverse": "^5.2.0",
9331
+ "esutils": "^2.0.2"
9332
+ },
9333
+ "bin": {
9334
+ "escodegen": "bin/escodegen.js",
9335
+ "esgenerate": "bin/esgenerate.js"
9336
+ },
9337
+ "engines": {
9338
+ "node": ">=6.0"
9339
+ },
9340
+ "optionalDependencies": {
9341
+ "source-map": "~0.6.1"
9342
+ }
9343
+ },
9262
9344
  "node_modules/jsesc": {
9263
9345
  "version": "3.1.0",
9264
9346
  "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
@@ -9455,9 +9537,9 @@
9455
9537
  }
9456
9538
  },
9457
9539
  "node_modules/luxon": {
9458
- "version": "3.6.1",
9459
- "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
9460
- "integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
9540
+ "version": "3.7.1",
9541
+ "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.1.tgz",
9542
+ "integrity": "sha512-RkRWjA926cTvz5rAb1BqyWkKbbjzCGchDUIKMCUvNi17j6f6j8uHGDV82Aqcqtzd+icoYpELmG3ksgGiFNNcNg==",
9461
9543
  "license": "MIT",
9462
9544
  "engines": {
9463
9545
  "node": ">=12"
@@ -10435,21 +10517,18 @@
10435
10517
  "@cucumber/messages": ">=19.1.4 <28"
10436
10518
  }
10437
10519
  },
10438
- "node_modules/playwright-bdd/node_modules/@cucumber/html-formatter": {
10439
- "version": "21.15.1",
10440
- "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-21.15.1.tgz",
10441
- "integrity": "sha512-tjxEpP161sQ7xc3VREc94v1ymwIckR3ySViy7lTvfi1jUpyqy2Hd/p4oE3YT1kQ9fFDvUflPwu5ugK5mA7BQLA==",
10520
+ "node_modules/playwright-bdd/node_modules/@cucumber/messages": {
10521
+ "version": "27.2.0",
10522
+ "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-27.2.0.tgz",
10523
+ "integrity": "sha512-f2o/HqKHgsqzFLdq6fAhfG1FNOQPdBdyMGpKwhb7hZqg0yZtx9BVqkTyuoNk83Fcvk3wjMVfouFXXHNEk4nddA==",
10442
10524
  "license": "MIT",
10443
- "peerDependencies": {
10444
- "@cucumber/messages": ">=18"
10525
+ "dependencies": {
10526
+ "@types/uuid": "10.0.0",
10527
+ "class-transformer": "0.5.1",
10528
+ "reflect-metadata": "0.2.2",
10529
+ "uuid": "11.0.5"
10445
10530
  }
10446
10531
  },
10447
- "node_modules/playwright-bdd/node_modules/@cucumber/tag-expressions": {
10448
- "version": "6.2.0",
10449
- "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-6.2.0.tgz",
10450
- "integrity": "sha512-KIF0eLcafHbWOuSDWFw0lMmgJOLdDRWjEL1kfXEWrqHmx2119HxVAr35WuEd9z542d3Yyg+XNqSr+81rIKqEdg==",
10451
- "license": "MIT"
10452
- },
10453
10532
  "node_modules/playwright-bdd/node_modules/commander": {
10454
10533
  "version": "13.1.0",
10455
10534
  "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz",
@@ -10500,6 +10579,19 @@
10500
10579
  "url": "https://opencollective.com/express"
10501
10580
  }
10502
10581
  },
10582
+ "node_modules/playwright-bdd/node_modules/uuid": {
10583
+ "version": "11.0.5",
10584
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
10585
+ "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
10586
+ "funding": [
10587
+ "https://github.com/sponsors/broofa",
10588
+ "https://github.com/sponsors/ctavan"
10589
+ ],
10590
+ "license": "MIT",
10591
+ "bin": {
10592
+ "uuid": "dist/esm/bin/uuid"
10593
+ }
10594
+ },
10503
10595
  "node_modules/playwright-core": {
10504
10596
  "version": "1.53.2",
10505
10597
  "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.2.tgz",
@@ -10616,34 +10708,6 @@
10616
10708
  "node": ">= 6"
10617
10709
  }
10618
10710
  },
10619
- "node_modules/properties-reader": {
10620
- "version": "2.3.0",
10621
- "resolved": "https://registry.npmjs.org/properties-reader/-/properties-reader-2.3.0.tgz",
10622
- "integrity": "sha512-z597WicA7nDZxK12kZqHr2TcvwNU1GCfA5UwfDY/HDp3hXPoPlb5rlEx9bwGTiJnc0OqbBTkU975jDToth8Gxw==",
10623
- "license": "MIT",
10624
- "dependencies": {
10625
- "mkdirp": "^1.0.4"
10626
- },
10627
- "engines": {
10628
- "node": ">=14"
10629
- },
10630
- "funding": {
10631
- "type": "github",
10632
- "url": "https://github.com/steveukx/properties?sponsor=1"
10633
- }
10634
- },
10635
- "node_modules/properties-reader/node_modules/mkdirp": {
10636
- "version": "1.0.4",
10637
- "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
10638
- "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
10639
- "license": "MIT",
10640
- "bin": {
10641
- "mkdirp": "bin/cmd.js"
10642
- },
10643
- "engines": {
10644
- "node": ">=10"
10645
- }
10646
- },
10647
10711
  "node_modules/property-expr": {
10648
10712
  "version": "2.0.6",
10649
10713
  "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz",
@@ -10720,9 +10784,9 @@
10720
10784
  "license": "MIT"
10721
10785
  },
10722
10786
  "node_modules/react": {
10723
- "version": "19.2.1",
10724
- "resolved": "https://registry.npmjs.org/react/-/react-19.2.1.tgz",
10725
- "integrity": "sha512-DGrYcCWK7tvYMnWh79yrPHt+vdx9tY+1gPZa7nJQtO/p8bLTDaHp4dzwEhQB7pZ4Xe3ok4XKuEPrVuc+wlpkmw==",
10787
+ "version": "19.2.0",
10788
+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz",
10789
+ "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==",
10726
10790
  "license": "MIT",
10727
10791
  "peer": true,
10728
10792
  "engines": {
@@ -10730,16 +10794,16 @@
10730
10794
  }
10731
10795
  },
10732
10796
  "node_modules/react-dom": {
10733
- "version": "19.2.1",
10734
- "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.1.tgz",
10735
- "integrity": "sha512-ibrK8llX2a4eOskq1mXKu/TGZj9qzomO+sNfO98M6d9zIPOEhlBkMkBUBLd1vgS0gQsLDBzA+8jJBVXDnfHmJg==",
10797
+ "version": "19.2.0",
10798
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz",
10799
+ "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==",
10736
10800
  "license": "MIT",
10737
10801
  "peer": true,
10738
10802
  "dependencies": {
10739
10803
  "scheduler": "^0.27.0"
10740
10804
  },
10741
10805
  "peerDependencies": {
10742
- "react": "^19.2.1"
10806
+ "react": "^19.2.0"
10743
10807
  }
10744
10808
  },
10745
10809
  "node_modules/react-error-boundary": {
@@ -12106,9 +12170,9 @@
12106
12170
  }
12107
12171
  },
12108
12172
  "node_modules/update-browserslist-db": {
12109
- "version": "1.2.2",
12110
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz",
12111
- "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==",
12173
+ "version": "1.1.4",
12174
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz",
12175
+ "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==",
12112
12176
  "funding": [
12113
12177
  {
12114
12178
  "type": "opencollective",
@@ -12189,19 +12253,6 @@
12189
12253
  "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
12190
12254
  "license": "MIT"
12191
12255
  },
12192
- "node_modules/uuid": {
12193
- "version": "11.0.5",
12194
- "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz",
12195
- "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==",
12196
- "funding": [
12197
- "https://github.com/sponsors/broofa",
12198
- "https://github.com/sponsors/ctavan"
12199
- ],
12200
- "license": "MIT",
12201
- "bin": {
12202
- "uuid": "dist/esm/bin/uuid"
12203
- }
12204
- },
12205
12256
  "node_modules/v8-to-istanbul": {
12206
12257
  "version": "9.3.0",
12207
12258
  "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
@@ -12567,18 +12618,15 @@
12567
12618
  "license": "ISC"
12568
12619
  },
12569
12620
  "node_modules/yaml": {
12570
- "version": "2.8.2",
12571
- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz",
12572
- "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==",
12621
+ "version": "2.8.1",
12622
+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz",
12623
+ "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==",
12573
12624
  "license": "ISC",
12574
12625
  "bin": {
12575
12626
  "yaml": "bin.mjs"
12576
12627
  },
12577
12628
  "engines": {
12578
12629
  "node": ">= 14.6"
12579
- },
12580
- "funding": {
12581
- "url": "https://github.com/sponsors/eemeli"
12582
12630
  }
12583
12631
  },
12584
12632
  "node_modules/yargs": {
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "3.2.16",
4
- "description": "",
3
+ "version": "3.2.17",
5
4
  "main": "./build/index.js",
6
5
  "scripts": {
7
6
  "postinstall": "node bin/postinstall.js",
@@ -37,7 +36,6 @@
37
36
  "msw": "1.2.3",
38
37
  "playwright": "1.53.2",
39
38
  "playwright-bdd": "8.3.1",
40
- "properties-reader": "2.3.0",
41
39
  "supports-color": "8.1.1"
42
40
  },
43
41
  "bin": {
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- class configConstants {
8
- static DEFAULT_CONFIG_DIR = 'default';
9
- static BETA_DIR = 'beta';
10
- static ACTOR_DIR = 'actors';
11
- static UAT_CONFIG_FILE = 'uat.config.js';
12
- static INDEX_FILE = 'index.js';
13
- static SETTINGS_FILE = 'settings.json';
14
- static TEST_SUMMARY_FILE = 'test-summary.json';
15
- static STAGE_CONFIG_MAP_FILE = 'uat/conf_path_map.properties';
16
- }
17
- exports.default = configConstants;
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getConfigPath = getConfigPath;
8
- var _fs = _interopRequireDefault(require("fs"));
9
- var _path = _interopRequireDefault(require("path"));
10
- var _propertiesReader = _interopRequireDefault(require("properties-reader"));
11
- var _logger = require("../../../utils/logger");
12
- var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
13
- //This function reads a properties file and returns the entire properties
14
-
15
- function readPropertiesFile(relativeFilePath) {
16
- const filePath = _path.default.resolve(process.cwd(), relativeFilePath);
17
- let properties;
18
- if (_fs.default.existsSync(filePath)) {
19
- properties = (0, _propertiesReader.default)(filePath);
20
- } else {
21
- // we have to remove this logic after adding all the projects with proper config files
22
- _logger.Logger.log(_logger.Logger.INFO_TYPE, `Properties file ${filePath} not found. Using default configurations.`);
23
- properties = (0, _propertiesReader.default)();
24
- properties.set('uat', 'uat/conf');
25
- }
26
- return properties;
27
- }
28
-
29
- // This function return the value for the passed arguments key
30
-
31
- function getConfigPath(stage) {
32
- const props = readPropertiesFile(_configConstants.default.STAGE_CONFIG_MAP_FILE);
33
- const configPath = props.get(stage);
34
- if (!configPath) {
35
- _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `No config mapping found for stage: "${stage}"`);
36
- }
37
- return configPath;
38
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _fs = _interopRequireDefault(require("fs"));
5
- var _path = _interopRequireDefault(require("path"));
6
- var _propertiesReader = _interopRequireDefault(require("properties-reader"));
7
- var _configPathResolver = require("../../../../../core/playwright/helpers/configPathResolver");
8
- var _logger = require("../../../../../utils/logger");
9
- var _configConstants = _interopRequireDefault(require("../../../../../core/playwright/constants/configConstants"));
10
- jest.mock('fs');
11
- jest.mock('path');
12
- jest.mock('properties-reader');
13
- jest.mock('../../../../../utils/logger', () => ({
14
- Logger: {
15
- log: jest.fn(),
16
- INFO_TYPE: 'info',
17
- FAILURE_TYPE: 'failure'
18
- }
19
- }));
20
- describe('getConfigPath', () => {
21
- const mockProps = {
22
- get: jest.fn(),
23
- set: jest.fn()
24
- };
25
- beforeEach(() => {
26
- jest.clearAllMocks();
27
- _propertiesReader.default.mockReturnValue(mockProps);
28
- _path.default.resolve.mockImplementation((...args) => args.join('/'));
29
- });
30
- test('should return config path when properties file exists and has mapping', () => {
31
- _fs.default.existsSync.mockReturnValue(true);
32
- mockProps.get.mockReturnValue('uat/conf');
33
- const result = (0, _configPathResolver.getConfigPath)('uat');
34
- expect(_fs.default.existsSync).toHaveBeenCalledWith(expect.stringContaining(_configConstants.default.STAGE_CONFIG_MAP_FILE));
35
- expect(_propertiesReader.default).toHaveBeenCalled();
36
- expect(mockProps.get).toHaveBeenCalledWith('uat');
37
- expect(result).toBe('uat/conf');
38
- expect(_logger.Logger.log).not.toHaveBeenCalledWith(_logger.Logger.FAILURE_TYPE, expect.any(String));
39
- });
40
- test('should log info and use default mapping if file does not exist', () => {
41
- _fs.default.existsSync.mockReturnValue(false);
42
- mockProps.get.mockImplementation(key => key === 'uat' ? 'uat/conf' : undefined);
43
- const result = (0, _configPathResolver.getConfigPath)('uat');
44
- expect(_logger.Logger.log).toHaveBeenCalledWith(_logger.Logger.INFO_TYPE, expect.stringContaining('not found'));
45
- expect(mockProps.set).toHaveBeenCalledWith('uat', 'uat/conf');
46
- expect(result).toBe('uat/conf');
47
- });
48
- test('should log failure if config mapping not found for stage', () => {
49
- _fs.default.existsSync.mockReturnValue(true);
50
- mockProps.get.mockReturnValue(undefined);
51
- const result = (0, _configPathResolver.getConfigPath)('stageX');
52
- expect(_logger.Logger.log).toHaveBeenCalledWith(_logger.Logger.FAILURE_TYPE, expect.stringContaining('stageX'));
53
- expect(result).toBeUndefined();
54
- });
55
- });