@zohodesk/testinglibrary 0.5.7-n18-experimental → 0.5.9-n18-experimental
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/build/core/playwright/builtInFixtures/page.js +1 -2
- package/build/core/playwright/helpers/auth/loginDefaultStepsHelper.js +2 -0
- package/build/core/playwright/helpers/auth/loginSteps.js +12 -7
- package/build/core/playwright/readConfigFile.js +2 -2
- package/build/core/playwright/setup/config-utils.js +0 -1
- package/npm-shrinkwrap.json +2 -37
- package/package.json +1 -2
|
@@ -26,8 +26,7 @@ var _default = exports.default = {
|
|
|
26
26
|
await context.clearCookies();
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
// await executeDefaultLoginSteps(context, testInfo , testDetails, testPortalDetails);
|
|
29
|
+
await (0, _loginDefaultStepsHelper.executeDefaultLoginSteps)(context, testInfo, testDetails, testPortalDetails);
|
|
31
30
|
} catch (e) {
|
|
32
31
|
console.error('Error during page', e);
|
|
33
32
|
} finally {
|
|
@@ -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,16 +18,21 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
|
18
18
|
authFilePrefix,
|
|
19
19
|
email
|
|
20
20
|
} = testInfo;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
if (!authFilePrefix) {
|
|
22
|
+
authFileName = email;
|
|
23
|
+
} else if (authFilePrefix.includes(email)) {
|
|
24
|
+
authFileName = authFilePrefix;
|
|
25
|
+
} else {
|
|
26
|
+
authFileName = authFilePrefix + email;
|
|
27
|
+
}
|
|
28
|
+
process.env.authFileName = authFileName;
|
|
29
|
+
const authFile = _path.default.resolve(_path.default.join((0, _checkAuthCookies.getAuthFileDirectory)(), `${authFileName}-cookies.json`));
|
|
30
|
+
const lockFileName = authFileName.replace(/[@.]/g, '_');
|
|
26
31
|
const fileMutex = new _fileMutex.default((0, _checkAuthDirectory.getLockDirectoryPath)(), lockFileName, _fileMutexConfig.fileDeletionTimeoutConfig);
|
|
27
32
|
let loginUsingCookie = false;
|
|
28
33
|
try {
|
|
29
34
|
if ((0, _checkAuthCookies.verifyIfCookieFileExists)(authFile)) {
|
|
30
|
-
console.log(`${
|
|
35
|
+
console.log(`${authFileName} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
31
36
|
loginUsingCookie = true;
|
|
32
37
|
} else {
|
|
33
38
|
await fileMutex.acquire();
|
|
@@ -42,7 +47,7 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
|
42
47
|
});
|
|
43
48
|
}
|
|
44
49
|
} catch (error) {
|
|
45
|
-
console.error(`Error during login for ${
|
|
50
|
+
console.error(`Error during login for ${authFileName}:`, error);
|
|
46
51
|
} finally {
|
|
47
52
|
if (!loginUsingCookie) {
|
|
48
53
|
await fileMutex.release();
|
|
@@ -18,8 +18,8 @@ var _UserArgs = _interopRequireDefault(require("./configuration/UserArgs"));
|
|
|
18
18
|
var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
|
|
19
19
|
let cachedConfig = null;
|
|
20
20
|
function getPrimaryCookiePath() {
|
|
21
|
-
const
|
|
22
|
-
return `uat/playwright/.auth/${
|
|
21
|
+
const authFileName = process.env.authFileName;
|
|
22
|
+
return `uat/playwright/.auth/${authFileName}-cookies.json`;
|
|
23
23
|
}
|
|
24
24
|
function getDefaultConfig() {
|
|
25
25
|
return {
|
|
@@ -35,7 +35,6 @@ function getBrowserConfig({
|
|
|
35
35
|
viewport,
|
|
36
36
|
storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
|
|
37
37
|
};
|
|
38
|
-
console.log("authFilePath", authFilePath);
|
|
39
38
|
// Determine dependencies based on the mode and smoke test status
|
|
40
39
|
let dependencies = isAuthMode ? ['setup'] : [];
|
|
41
40
|
dependencies = isSmokeTest ? [...dependencies, 'smokeTest'] : dependencies;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9-n18-experimental",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@zohodesk/testinglibrary",
|
|
9
|
-
"version": "0.5.
|
|
9
|
+
"version": "0.5.9-n18-experimental",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"@testing-library/jest-dom": "5.11.9",
|
|
19
19
|
"@testing-library/react": "11.2.7",
|
|
20
20
|
"@testing-library/react-hooks": "7.0.2",
|
|
21
|
-
"@zohodesk/testinglibrary": "file:zohodesk-testinglibrary-0.5.4-n18-experimental.tgz",
|
|
22
21
|
"babel-jest": "29.6.2",
|
|
23
22
|
"babel-plugin-transform-dynamic-import": "2.1.0",
|
|
24
23
|
"fast-glob": "3.3.1",
|
|
@@ -4236,40 +4235,6 @@
|
|
|
4236
4235
|
"node": ">=10.0.0"
|
|
4237
4236
|
}
|
|
4238
4237
|
},
|
|
4239
|
-
"node_modules/@zohodesk/testinglibrary": {
|
|
4240
|
-
"version": "0.5.4-n18-experimental",
|
|
4241
|
-
"resolved": "file:zohodesk-testinglibrary-0.5.4-n18-experimental.tgz",
|
|
4242
|
-
"integrity": "sha512-Y1fW2IiqobcE15ZfYSOca8CZ+/9zxoWkqW+XlRQtwUEfETjMSkccn4fuvycAnje7yDib14Bh804gP1ufncWv5w==",
|
|
4243
|
-
"hasInstallScript": true,
|
|
4244
|
-
"license": "ISC",
|
|
4245
|
-
"dependencies": {
|
|
4246
|
-
"@babel/code-frame": "7.27.1",
|
|
4247
|
-
"@babel/preset-react": "7.22.5",
|
|
4248
|
-
"@cucumber/cucumber": "11.3.0",
|
|
4249
|
-
"@playwright/test": "1.53.2",
|
|
4250
|
-
"@reportportal/agent-js-playwright": "5.1.11",
|
|
4251
|
-
"@testing-library/jest-dom": "5.11.9",
|
|
4252
|
-
"@testing-library/react": "11.2.7",
|
|
4253
|
-
"@testing-library/react-hooks": "7.0.2",
|
|
4254
|
-
"babel-jest": "29.6.2",
|
|
4255
|
-
"babel-plugin-transform-dynamic-import": "2.1.0",
|
|
4256
|
-
"fast-glob": "3.3.1",
|
|
4257
|
-
"jest": "29.6.2",
|
|
4258
|
-
"jest-environment-jsdom": "29.6.2",
|
|
4259
|
-
"msw": "1.2.3",
|
|
4260
|
-
"playwright": "1.53.2",
|
|
4261
|
-
"playwright-bdd": "8.3.1",
|
|
4262
|
-
"supports-color": "8.1.1"
|
|
4263
|
-
},
|
|
4264
|
-
"bin": {
|
|
4265
|
-
"ZDTestingFramework": "bin/cli.js"
|
|
4266
|
-
},
|
|
4267
|
-
"peerDependencies": {
|
|
4268
|
-
"eslint": "*",
|
|
4269
|
-
"react": "*",
|
|
4270
|
-
"react-dom": "*"
|
|
4271
|
-
}
|
|
4272
|
-
},
|
|
4273
4238
|
"node_modules/@zxing/text-encoding": {
|
|
4274
4239
|
"version": "0.9.0",
|
|
4275
4240
|
"resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9-n18-experimental",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"@testing-library/jest-dom": "5.11.9",
|
|
30
30
|
"@testing-library/react": "11.2.7",
|
|
31
31
|
"@testing-library/react-hooks": "7.0.2",
|
|
32
|
-
"@zohodesk/testinglibrary": "file:zohodesk-testinglibrary-0.5.4-n18-experimental.tgz",
|
|
33
32
|
"babel-jest": "29.6.2",
|
|
34
33
|
"babel-plugin-transform-dynamic-import": "2.1.0",
|
|
35
34
|
"fast-glob": "3.3.1",
|