@zohodesk/testinglibrary 4.0.2 → 4.0.3

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
@@ -16,6 +16,33 @@
16
16
  ### Generate Report
17
17
 
18
18
  - npm run report
19
+
20
+
21
+ ### v4.0.3 - 17-12-2025
22
+
23
+ #### Enhancement
24
+ - Cookie storage prefix support is provided in this version.
25
+
26
+
27
+ ### v4.0.2 - 16-12-2025
28
+
29
+ #### Bug Fixes
30
+
31
+ - Deprecated the react and react hooks from dependencies
32
+ - @cucumber/cucumber - 10.9.0 version downgraded due to Missing Step Definition Issue
33
+
34
+
35
+ ### v4.0.0 - 04-12-2025
36
+
37
+ #### Features
38
+ - Supported node 20 for the testing-framework
39
+
40
+ - Below package versions are updated in this release.
41
+ - playwright - 1.56.1,
42
+ - playwright-bdd - 8.4.2,
43
+ - @playwright/test - 1.56.1,
44
+ - @cucumber/cucumber - 12.2.0
45
+
19
46
 
20
47
  ### v3.2.15 - 14-11-2025
21
48
 
@@ -41,6 +41,7 @@ async function executeDefaultLoginSteps(context, testInfo, testDetails, testPort
41
41
  }
42
42
  try {
43
43
  const projectName = testInfo.project.name;
44
+ testDetails.authFilePrefix = process.env.authFilePrefix;
44
45
  if (testPortalDetails && projectName !== 'setup' && projectName !== 'cleanup') {
45
46
  await context.clearCookies();
46
47
  await (0, _auth.performLoginSteps)(testDetails, async testInfo => {
@@ -18,14 +18,20 @@ 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 = `${authFilePrefix}-${email}`;
24
+ process.env.authFilePrefix = authFilePrefix;
25
+ } else {
26
+ authFileName = `${email}`;
27
+ }
28
+ const authFile = _path.default.resolve(_path.default.join((0, _checkAuthCookies.getAuthFileDirectory)(), `${authFileName}-cookies.json`));
29
+ const lockFileName = `${authFileName}`.replace(/[@.]/g, '_');
24
30
  const fileMutex = new _fileMutex.default((0, _checkAuthDirectory.getLockDirectoryPath)(), lockFileName, _fileMutexConfig.fileDeletionTimeoutConfig);
25
31
  let loginUsingCookie = false;
26
32
  try {
27
33
  if ((0, _checkAuthCookies.verifyIfCookieFileExists)(authFile)) {
28
- console.log(`${email} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
34
+ console.log(`${authFileName} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
29
35
  loginUsingCookie = true;
30
36
  } else {
31
37
  await fileMutex.acquire();
@@ -40,7 +46,7 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
40
46
  });
41
47
  }
42
48
  } catch (error) {
43
- console.error(`Error during login for ${email}:`, error);
49
+ console.error(`Error during login for ${authFileName}:`, error);
44
50
  } finally {
45
51
  if (!loginUsingCookie) {
46
52
  await fileMutex.release();
@@ -16,7 +16,16 @@ var _mergeObjects = require("./helpers/mergeObjects");
16
16
  var _Configuration = _interopRequireDefault(require("./configuration/Configuration"));
17
17
  var _UserArgs = _interopRequireDefault(require("./configuration/UserArgs"));
18
18
  var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
19
+ var _auth = require("./helpers/auth");
19
20
  let cachedConfig = null;
21
+ function getPrimaryCookiePath() {
22
+ const {
23
+ email
24
+ } = (0, _auth.getDefaultActor)();
25
+ const authFilePrefix = process.env.authFilePrefix;
26
+ let authFileName = authFilePrefix ? `${authFilePrefix}-${email}` : `${email}`;
27
+ return `uat/playwright/.auth/${authFileName}-cookies.json`;
28
+ }
20
29
  function getDefaultConfig() {
21
30
  return {
22
31
  isTearDown: true,
@@ -33,7 +42,7 @@ function getDefaultConfig() {
33
42
  bddMode: false,
34
43
  expectTimeout: 5 * 1000,
35
44
  testTimeout: 60 * 1000,
36
- authFilePath: 'uat/playwright/.auth/user.json',
45
+ authFilePath: getPrimaryCookiePath(),
37
46
  viewport: {
38
47
  width: 1280,
39
48
  height: 720