@zohodesk/testinglibrary 0.4.99-n18-experimental → 0.5.0-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/README.md +8 -10
- package/build/common/data-generator/steps/DataGeneratorStepsHelper.js +3 -1
- package/build/core/dataGenerator/DataGenerator.js +0 -9
- package/build/core/playwright/configuration/ConfigurationHelper.js +5 -7
- package/build/core/playwright/constants/reporterPathConstants.js +11 -0
- package/build/core/playwright/custom-commands.js +1 -1
- package/build/core/playwright/env-initializer.js +9 -10
- package/build/core/playwright/helpers/auth/getUsers.js +16 -15
- package/build/core/playwright/helpers/configFileNameProvider.js +8 -15
- package/build/core/playwright/readConfigFile.js +2 -3
- package/build/core/playwright/reporter/helpers/mergeAbortedTests.js +79 -0
- package/build/core/playwright/setup/custom-reporter.js +3 -0
- package/build/core/playwright/test-runner.js +2 -4
- package/build/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js +13 -54
- package/build/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js +26 -29
- package/build/utils/logger.js +1 -1
- package/npm-shrinkwrap.json +7 -181
- package/package.json +1 -4
- package/unit_reports/unit-report.html +1 -1
- package/build/core/playwright/constants/configFiles.js +0 -14
- package/build/core/playwright/helpers/configPathResolver.js +0 -36
- package/build/test/core/playwright/helpers/__tests__/configPathResolver.test.js +0 -42
package/README.md
CHANGED
|
@@ -17,22 +17,20 @@
|
|
|
17
17
|
|
|
18
18
|
- npm run report
|
|
19
19
|
|
|
20
|
-
### v3.2.13 - 30-10-2025
|
|
21
|
-
|
|
22
|
-
#### Enhancement
|
|
23
|
-
|
|
24
|
-
- A teardown option has been introduced in the configuration to manage and clean up login sessions stored in the NFS environment.
|
|
25
|
-
|
|
26
|
-
### Issue fix
|
|
27
|
-
|
|
28
|
-
- Custom teardown comment provided
|
|
29
|
-
|
|
30
20
|
### v3.2.11 - 13-10-2025
|
|
31
21
|
|
|
32
22
|
### Feature
|
|
33
23
|
|
|
34
24
|
- New step a search entity using {string} provided for search indexing, This step will use run time data generation response as input for the indexing
|
|
35
25
|
|
|
26
|
+
### Issue fix
|
|
27
|
+
- Custom teardown comment provided
|
|
28
|
+
|
|
29
|
+
### v3.2.10 - 09-10-2025
|
|
30
|
+
|
|
31
|
+
#### Enhancement
|
|
32
|
+
- A teardown option has been introduced in the configuration to manage and clean up login sessions stored in the NFS environment.
|
|
33
|
+
|
|
36
34
|
|
|
37
35
|
### v3.2.9 - 26-09-2025
|
|
38
36
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { test } from '@zohodesk/testinglibrary';
|
|
2
2
|
import DataGenerator from '@zohodesk/testinglibrary/DataGenerator';
|
|
3
|
+
import {getUserForSelectedEditionAndProfile} from '@zohodesk/testinglibrary/helpers'
|
|
3
4
|
|
|
4
5
|
const dataGenerator = new DataGenerator();
|
|
5
6
|
|
|
@@ -9,7 +10,8 @@ export async function generateAndCacheTestData(executionContext, type, identifie
|
|
|
9
10
|
const scenarioName = testInfo.title.split('/').pop() || 'Unknown Scenario';
|
|
10
11
|
|
|
11
12
|
if (profile) {
|
|
12
|
-
|
|
13
|
+
const { edition, orgName: portal, beta } = executionContext.actorInfo;
|
|
14
|
+
actorInfo = await getUserForSelectedEditionAndProfile(edition, profile, beta, portal);
|
|
13
15
|
} else {
|
|
14
16
|
actorInfo = executionContext.actorInfo;
|
|
15
17
|
}
|
|
@@ -47,15 +47,6 @@ class DataGenerator {
|
|
|
47
47
|
throw error;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
async getDataGenUserExecutionContext(edition, profile) {
|
|
51
|
-
try {
|
|
52
|
-
const dataGenUserDetails = await (0, _helpers.getUserForSelectedEditionAndProfile)(edition, profile);
|
|
53
|
-
return dataGenUserDetails;
|
|
54
|
-
} catch (error) {
|
|
55
|
-
console.error('Error occurred while fetching data generation user details: ', error);
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
50
|
}
|
|
60
51
|
async function _getGenerator(testInfo, generatorName) {
|
|
61
52
|
let generator = null;
|
|
@@ -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
|
-
|
|
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(
|
|
29
|
+
function getApplicationConfig(mode) {
|
|
28
30
|
let filePath = "";
|
|
29
31
|
try {
|
|
30
|
-
filePath = (0, _configFileNameProvider.getUATFileName)(
|
|
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
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
class ReporterPathConstants {
|
|
8
|
+
static DEFAULT_REPORTER_PATH = 'uat/test-results/playwright-test-results.json';
|
|
9
|
+
static LAST_RUN_REPORTER_PATH = 'uat/test-results/.last-run.json';
|
|
10
|
+
}
|
|
11
|
+
exports.default = ReporterPathConstants;
|
|
@@ -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 = ['
|
|
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/
|
|
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(
|
|
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
|
-
|
|
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 ${
|
|
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
|
|
17
|
-
var _ConfigurationHelper = require("./../../configuration/ConfigurationHelper");
|
|
18
|
-
var _configFiles = require("../../constants/configFiles");
|
|
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
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
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(
|
|
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}
|
|
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
|
-
|
|
59
|
-
const stagePath = (0, _configPathResolver.getConfigPath)(stage);
|
|
60
|
-
let configFile = _path.default.join(_path.default.resolve(process.cwd(), `${stagePath}/${mode}/${_configFiles.ACTOR_DIR}/${_configFiles.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(
|
|
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(
|
|
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
|
}
|
|
@@ -113,6 +113,7 @@ function getUserForSelectedEditionAndProfile(preferedEdition, preferredProfile,
|
|
|
113
113
|
}
|
|
114
114
|
return {
|
|
115
115
|
...editionData,
|
|
116
|
-
...selectedProfile
|
|
116
|
+
...selectedProfile,
|
|
117
|
+
'beta': betaFeature
|
|
117
118
|
};
|
|
118
119
|
}
|
|
@@ -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
|
-
|
|
14
|
-
var _configPathResolver = require("./configPathResolver");
|
|
15
|
-
var _configFiles = require("../constants/configFiles");
|
|
16
|
-
function getUATFileName(stage, mode) {
|
|
17
|
-
stage = stage || (0, _ConfigurationHelper.getRunStage)();
|
|
13
|
+
function getUATFileName(mode) {
|
|
18
14
|
mode = mode || (0, _auth.getRunMode)();
|
|
19
|
-
const
|
|
20
|
-
const uatConfFilePath = _path.default.resolve(process.cwd(), `${stagePath}/${mode}/${_configFiles.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}/${_configFiles.DEFAULT_CONFIG_DIR}/${_configFiles.UAT_CONFIG_FILE}`);
|
|
19
|
+
return _path.default.resolve(process.cwd(), `uat/conf/default/uat.config.js`);
|
|
26
20
|
}
|
|
27
|
-
function getEnvConfigFilePath(
|
|
28
|
-
const
|
|
29
|
-
const confFilePath = `${stagePath}/${mode}/${_configFiles.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
|
|
25
|
+
return `uat/conf/${mode}/settings.json`;
|
|
33
26
|
}
|
|
34
|
-
return
|
|
27
|
+
return `uat/conf/default/settings.json`;
|
|
35
28
|
}
|
|
36
29
|
function getReportFileName() {
|
|
37
|
-
return
|
|
30
|
+
return `test-summary.json`;
|
|
38
31
|
}
|
|
@@ -111,16 +111,15 @@ function combineDefaultConfigWithUserConfig(userConfiguration) {
|
|
|
111
111
|
*/
|
|
112
112
|
|
|
113
113
|
function getConfigFilePath() {
|
|
114
|
-
return (0, _configFileNameProvider.getUATFileName)();
|
|
114
|
+
return _path.default.resolve(process.cwd(), (0, _configFileNameProvider.getUATFileName)());
|
|
115
115
|
}
|
|
116
116
|
function generateConfigFromFile() {
|
|
117
117
|
if (cachedConfig === null) {
|
|
118
118
|
// Getting the default config's from framework
|
|
119
119
|
const uatConfig = new _Configuration.default(getDefaultConfig());
|
|
120
120
|
// overriding the application config's from project
|
|
121
|
+
const appConfig = new _Configuration.default((0, _ConfigurationHelper.getApplicationConfig)());
|
|
121
122
|
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
123
|
// overriding the user config's from CLI
|
|
125
124
|
uatConfig.addAll(appConfig);
|
|
126
125
|
uatConfig.addAll(userArgConfig);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = mergeAbortedTestsIntoLastRun;
|
|
8
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _logger = require("../../../../utils/logger");
|
|
11
|
+
var _fileUtils = require("../../../../utils/fileUtils");
|
|
12
|
+
var _reporterPathConstants = _interopRequireDefault(require("../../constants/reporterPathConstants"));
|
|
13
|
+
function mergeAbortedTestsIntoLastRun() {
|
|
14
|
+
let resultsFile = _path.default.resolve(process.cwd(), _reporterPathConstants.default.DEFAULT_REPORTER_PATH),
|
|
15
|
+
lastRunFile = _path.default.resolve(process.cwd(), _reporterPathConstants.default.LAST_RUN_REPORTER_PATH);
|
|
16
|
+
try {
|
|
17
|
+
let report;
|
|
18
|
+
try {
|
|
19
|
+
report = JSON.parse(_fs.default.readFileSync(resultsFile, 'utf-8'));
|
|
20
|
+
} catch (e) {
|
|
21
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Failed to parse results file: ${resultsFile}`);
|
|
22
|
+
throw e;
|
|
23
|
+
}
|
|
24
|
+
const abortedTests = collectAbortedSpecIds(report);
|
|
25
|
+
let lastRunData = {
|
|
26
|
+
status: 'passed',
|
|
27
|
+
failedTests: []
|
|
28
|
+
};
|
|
29
|
+
if (_fs.default.existsSync(lastRunFile)) {
|
|
30
|
+
try {
|
|
31
|
+
const parsed = JSON.parse(_fs.default.readFileSync(lastRunFile, 'utf-8'));
|
|
32
|
+
lastRunData.status = parsed.status || lastRunData.status;
|
|
33
|
+
lastRunData.failedTests = Array.isArray(parsed.failedTests) ? parsed.failedTests : [];
|
|
34
|
+
} catch (e) {
|
|
35
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Failed to parse existing last-run file: ${lastRunFile}`);
|
|
36
|
+
throw e;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Merge existing failed tests + aborted tests
|
|
41
|
+
const failedSet = new Set(lastRunData.failedTests);
|
|
42
|
+
for (const id of abortedTests) {
|
|
43
|
+
failedSet.add(id);
|
|
44
|
+
}
|
|
45
|
+
lastRunData.failedTests = [...failedSet];
|
|
46
|
+
lastRunData.status = failedSet.size > 0 ? 'failed' : lastRunData.status;
|
|
47
|
+
(0, _fileUtils.writeFileContents)(lastRunFile, JSON.stringify(lastRunData, null, 2));
|
|
48
|
+
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Updated ${abortedTests.size} aborted tests in .last-run.json file \n`);
|
|
49
|
+
return lastRunData;
|
|
50
|
+
} catch (err) {
|
|
51
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Error updating .last-run.json: ${err.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function collectAbortedSpecIds(report) {
|
|
55
|
+
const aborted = new Set();
|
|
56
|
+
if (!Array.isArray(report.suites)) {
|
|
57
|
+
return aborted;
|
|
58
|
+
}
|
|
59
|
+
const isAbortedSpec = spec => {
|
|
60
|
+
var _spec$tests;
|
|
61
|
+
const tags = Array.isArray(spec.tags) ? spec.tags : [];
|
|
62
|
+
return (_spec$tests = spec.tests) === null || _spec$tests === void 0 ? void 0 : _spec$tests.some(t => !tags.includes('skip') && t.projectName === 'chromium' && t.status === 'skipped');
|
|
63
|
+
};
|
|
64
|
+
const testResultsObj = report.suites;
|
|
65
|
+
while (testResultsObj.length > 0) {
|
|
66
|
+
const suite = testResultsObj.pop();
|
|
67
|
+
if (Array.isArray(suite.specs)) {
|
|
68
|
+
for (const spec of suite.specs) {
|
|
69
|
+
if (spec && isAbortedSpec(spec)) {
|
|
70
|
+
aborted.add(spec.id);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (Array.isArray(suite.suites)) {
|
|
75
|
+
for (const child of suite.suites) testResultsObj.push(child);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return aborted;
|
|
79
|
+
}
|
|
@@ -11,6 +11,7 @@ var _fileUtils = require("../../../utils/fileUtils");
|
|
|
11
11
|
var _readConfigFile = require("../readConfigFile");
|
|
12
12
|
var _logger = require("../../../utils/logger");
|
|
13
13
|
var _configFileNameProvider = require("../helpers/configFileNameProvider");
|
|
14
|
+
var _mergeAbortedTests = _interopRequireDefault(require("../reporter/helpers/mergeAbortedTests"));
|
|
14
15
|
class JSONSummaryReporter {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.durationInMS = -1;
|
|
@@ -123,6 +124,8 @@ class JSONSummaryReporter {
|
|
|
123
124
|
(0, _fileUtils.writeFileContents)(_path.default.join(reportPath, './', (0, _configFileNameProvider.getReportFileName)()), JSON.stringify(this, null, ' '));
|
|
124
125
|
}
|
|
125
126
|
onExit() {
|
|
127
|
+
// Update .last-run.json with aborted tests due to timing out or interruption
|
|
128
|
+
(0, _mergeAbortedTests.default)();
|
|
126
129
|
const shouldClearLastLine = this._open !== 'always' || this._open !== 'on-failure';
|
|
127
130
|
if (shouldClearLastLine) {
|
|
128
131
|
/**Below code is to replace the playwright default report commond with abstraction tool command */
|
|
@@ -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
|
-
|
|
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)(
|
|
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('
|
|
24
|
-
const stage = 'uat';
|
|
16
|
+
test('return the pipeline matched config files for pipeline matched files exists', () => {
|
|
25
17
|
const mode = 'cd';
|
|
26
|
-
|
|
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(
|
|
41
|
-
expect(result).toBe(
|
|
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('
|
|
70
|
-
|
|
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
|
-
|
|
73
|
-
|
|
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 =
|
|
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/
|
|
11
|
-
|
|
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.
|
|
25
|
-
|
|
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(() =>
|
|
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.
|
|
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(() =>
|
|
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.
|
|
41
|
-
|
|
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 =
|
|
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.
|
|
54
|
-
.
|
|
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 =
|
|
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.
|
|
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 =
|
|
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 =
|
|
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
|
});
|
package/build/utils/logger.js
CHANGED
|
@@ -22,7 +22,7 @@ class LoggerImpl {
|
|
|
22
22
|
info() {}
|
|
23
23
|
log(type, message) {
|
|
24
24
|
const color = this.colors[type];
|
|
25
|
-
this.consoleLogger.log(`${color[0]}${message}${color[1]}`);
|
|
25
|
+
this.consoleLogger.log(`${color[0]}${message}${color[1]}\n`);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const Logger = exports.Logger = new LoggerImpl();
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-n18-experimental",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@zohodesk/testinglibrary",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.5.0-n18-experimental",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
@@ -23,11 +23,9 @@
|
|
|
23
23
|
"fast-glob": "3.3.1",
|
|
24
24
|
"jest": "29.6.2",
|
|
25
25
|
"jest-environment-jsdom": "29.6.2",
|
|
26
|
-
"jsonpath": "1.1.1",
|
|
27
26
|
"msw": "1.2.3",
|
|
28
27
|
"playwright": "1.53.2",
|
|
29
28
|
"playwright-bdd": "8.3.1",
|
|
30
|
-
"properties-reader": "2.3.0",
|
|
31
29
|
"supports-color": "8.1.1"
|
|
32
30
|
},
|
|
33
31
|
"bin": {
|
|
@@ -5436,7 +5434,8 @@
|
|
|
5436
5434
|
"version": "0.1.4",
|
|
5437
5435
|
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
|
|
5438
5436
|
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
|
|
5439
|
-
"license": "MIT"
|
|
5437
|
+
"license": "MIT",
|
|
5438
|
+
"peer": true
|
|
5440
5439
|
},
|
|
5441
5440
|
"node_modules/deepmerge": {
|
|
5442
5441
|
"version": "4.3.1",
|
|
@@ -6202,7 +6201,8 @@
|
|
|
6202
6201
|
"version": "2.0.6",
|
|
6203
6202
|
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
|
6204
6203
|
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
|
|
6205
|
-
"license": "MIT"
|
|
6204
|
+
"license": "MIT",
|
|
6205
|
+
"peer": true
|
|
6206
6206
|
},
|
|
6207
6207
|
"node_modules/fastq": {
|
|
6208
6208
|
"version": "1.19.1",
|
|
@@ -6424,20 +6424,6 @@
|
|
|
6424
6424
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
|
6425
6425
|
"license": "ISC"
|
|
6426
6426
|
},
|
|
6427
|
-
"node_modules/fsevents": {
|
|
6428
|
-
"version": "2.3.3",
|
|
6429
|
-
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
|
6430
|
-
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
|
6431
|
-
"hasInstallScript": true,
|
|
6432
|
-
"license": "MIT",
|
|
6433
|
-
"optional": true,
|
|
6434
|
-
"os": [
|
|
6435
|
-
"darwin"
|
|
6436
|
-
],
|
|
6437
|
-
"engines": {
|
|
6438
|
-
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
6439
|
-
}
|
|
6440
|
-
},
|
|
6441
6427
|
"node_modules/function-bind": {
|
|
6442
6428
|
"version": "1.1.2",
|
|
6443
6429
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
|
@@ -9309,29 +9295,6 @@
|
|
|
9309
9295
|
"node": ">=6"
|
|
9310
9296
|
}
|
|
9311
9297
|
},
|
|
9312
|
-
"node_modules/jsonpath": {
|
|
9313
|
-
"version": "1.1.1",
|
|
9314
|
-
"resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz",
|
|
9315
|
-
"integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==",
|
|
9316
|
-
"license": "MIT",
|
|
9317
|
-
"dependencies": {
|
|
9318
|
-
"esprima": "1.2.2",
|
|
9319
|
-
"static-eval": "2.0.2",
|
|
9320
|
-
"underscore": "1.12.1"
|
|
9321
|
-
}
|
|
9322
|
-
},
|
|
9323
|
-
"node_modules/jsonpath/node_modules/esprima": {
|
|
9324
|
-
"version": "1.2.2",
|
|
9325
|
-
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz",
|
|
9326
|
-
"integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==",
|
|
9327
|
-
"bin": {
|
|
9328
|
-
"esparse": "bin/esparse.js",
|
|
9329
|
-
"esvalidate": "bin/esvalidate.js"
|
|
9330
|
-
},
|
|
9331
|
-
"engines": {
|
|
9332
|
-
"node": ">=0.4.0"
|
|
9333
|
-
}
|
|
9334
|
-
},
|
|
9335
9298
|
"node_modules/keyv": {
|
|
9336
9299
|
"version": "4.5.4",
|
|
9337
9300
|
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
|
|
@@ -10530,20 +10493,6 @@
|
|
|
10530
10493
|
"node": ">=18"
|
|
10531
10494
|
}
|
|
10532
10495
|
},
|
|
10533
|
-
"node_modules/playwright/node_modules/fsevents": {
|
|
10534
|
-
"version": "2.3.2",
|
|
10535
|
-
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
|
10536
|
-
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
|
10537
|
-
"hasInstallScript": true,
|
|
10538
|
-
"license": "MIT",
|
|
10539
|
-
"optional": true,
|
|
10540
|
-
"os": [
|
|
10541
|
-
"darwin"
|
|
10542
|
-
],
|
|
10543
|
-
"engines": {
|
|
10544
|
-
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
|
10545
|
-
}
|
|
10546
|
-
},
|
|
10547
10496
|
"node_modules/possible-typed-array-names": {
|
|
10548
10497
|
"version": "1.1.0",
|
|
10549
10498
|
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
|
@@ -10634,34 +10583,6 @@
|
|
|
10634
10583
|
"node": ">= 6"
|
|
10635
10584
|
}
|
|
10636
10585
|
},
|
|
10637
|
-
"node_modules/properties-reader": {
|
|
10638
|
-
"version": "2.3.0",
|
|
10639
|
-
"resolved": "https://registry.npmjs.org/properties-reader/-/properties-reader-2.3.0.tgz",
|
|
10640
|
-
"integrity": "sha512-z597WicA7nDZxK12kZqHr2TcvwNU1GCfA5UwfDY/HDp3hXPoPlb5rlEx9bwGTiJnc0OqbBTkU975jDToth8Gxw==",
|
|
10641
|
-
"license": "MIT",
|
|
10642
|
-
"dependencies": {
|
|
10643
|
-
"mkdirp": "^1.0.4"
|
|
10644
|
-
},
|
|
10645
|
-
"engines": {
|
|
10646
|
-
"node": ">=14"
|
|
10647
|
-
},
|
|
10648
|
-
"funding": {
|
|
10649
|
-
"type": "github",
|
|
10650
|
-
"url": "https://github.com/steveukx/properties?sponsor=1"
|
|
10651
|
-
}
|
|
10652
|
-
},
|
|
10653
|
-
"node_modules/properties-reader/node_modules/mkdirp": {
|
|
10654
|
-
"version": "1.0.4",
|
|
10655
|
-
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
|
10656
|
-
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
|
|
10657
|
-
"license": "MIT",
|
|
10658
|
-
"bin": {
|
|
10659
|
-
"mkdirp": "bin/cmd.js"
|
|
10660
|
-
},
|
|
10661
|
-
"engines": {
|
|
10662
|
-
"node": ">=10"
|
|
10663
|
-
}
|
|
10664
|
-
},
|
|
10665
10586
|
"node_modules/property-expr": {
|
|
10666
10587
|
"version": "2.0.6",
|
|
10667
10588
|
"resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz",
|
|
@@ -11539,96 +11460,6 @@
|
|
|
11539
11460
|
"integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==",
|
|
11540
11461
|
"license": "MIT"
|
|
11541
11462
|
},
|
|
11542
|
-
"node_modules/static-eval": {
|
|
11543
|
-
"version": "2.0.2",
|
|
11544
|
-
"resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz",
|
|
11545
|
-
"integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==",
|
|
11546
|
-
"license": "MIT",
|
|
11547
|
-
"dependencies": {
|
|
11548
|
-
"escodegen": "^1.8.1"
|
|
11549
|
-
}
|
|
11550
|
-
},
|
|
11551
|
-
"node_modules/static-eval/node_modules/escodegen": {
|
|
11552
|
-
"version": "1.14.3",
|
|
11553
|
-
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
|
|
11554
|
-
"integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
|
|
11555
|
-
"license": "BSD-2-Clause",
|
|
11556
|
-
"dependencies": {
|
|
11557
|
-
"esprima": "^4.0.1",
|
|
11558
|
-
"estraverse": "^4.2.0",
|
|
11559
|
-
"esutils": "^2.0.2",
|
|
11560
|
-
"optionator": "^0.8.1"
|
|
11561
|
-
},
|
|
11562
|
-
"bin": {
|
|
11563
|
-
"escodegen": "bin/escodegen.js",
|
|
11564
|
-
"esgenerate": "bin/esgenerate.js"
|
|
11565
|
-
},
|
|
11566
|
-
"engines": {
|
|
11567
|
-
"node": ">=4.0"
|
|
11568
|
-
},
|
|
11569
|
-
"optionalDependencies": {
|
|
11570
|
-
"source-map": "~0.6.1"
|
|
11571
|
-
}
|
|
11572
|
-
},
|
|
11573
|
-
"node_modules/static-eval/node_modules/estraverse": {
|
|
11574
|
-
"version": "4.3.0",
|
|
11575
|
-
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
|
11576
|
-
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
|
|
11577
|
-
"license": "BSD-2-Clause",
|
|
11578
|
-
"engines": {
|
|
11579
|
-
"node": ">=4.0"
|
|
11580
|
-
}
|
|
11581
|
-
},
|
|
11582
|
-
"node_modules/static-eval/node_modules/levn": {
|
|
11583
|
-
"version": "0.3.0",
|
|
11584
|
-
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
|
|
11585
|
-
"integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
|
|
11586
|
-
"license": "MIT",
|
|
11587
|
-
"dependencies": {
|
|
11588
|
-
"prelude-ls": "~1.1.2",
|
|
11589
|
-
"type-check": "~0.3.2"
|
|
11590
|
-
},
|
|
11591
|
-
"engines": {
|
|
11592
|
-
"node": ">= 0.8.0"
|
|
11593
|
-
}
|
|
11594
|
-
},
|
|
11595
|
-
"node_modules/static-eval/node_modules/optionator": {
|
|
11596
|
-
"version": "0.8.3",
|
|
11597
|
-
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
|
11598
|
-
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
|
|
11599
|
-
"license": "MIT",
|
|
11600
|
-
"dependencies": {
|
|
11601
|
-
"deep-is": "~0.1.3",
|
|
11602
|
-
"fast-levenshtein": "~2.0.6",
|
|
11603
|
-
"levn": "~0.3.0",
|
|
11604
|
-
"prelude-ls": "~1.1.2",
|
|
11605
|
-
"type-check": "~0.3.2",
|
|
11606
|
-
"word-wrap": "~1.2.3"
|
|
11607
|
-
},
|
|
11608
|
-
"engines": {
|
|
11609
|
-
"node": ">= 0.8.0"
|
|
11610
|
-
}
|
|
11611
|
-
},
|
|
11612
|
-
"node_modules/static-eval/node_modules/prelude-ls": {
|
|
11613
|
-
"version": "1.1.2",
|
|
11614
|
-
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
|
|
11615
|
-
"integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
|
|
11616
|
-
"engines": {
|
|
11617
|
-
"node": ">= 0.8.0"
|
|
11618
|
-
}
|
|
11619
|
-
},
|
|
11620
|
-
"node_modules/static-eval/node_modules/type-check": {
|
|
11621
|
-
"version": "0.3.2",
|
|
11622
|
-
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
|
|
11623
|
-
"integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
|
|
11624
|
-
"license": "MIT",
|
|
11625
|
-
"dependencies": {
|
|
11626
|
-
"prelude-ls": "~1.1.2"
|
|
11627
|
-
},
|
|
11628
|
-
"engines": {
|
|
11629
|
-
"node": ">= 0.8.0"
|
|
11630
|
-
}
|
|
11631
|
-
},
|
|
11632
11463
|
"node_modules/stop-iteration-iterator": {
|
|
11633
11464
|
"version": "1.1.0",
|
|
11634
11465
|
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
|
|
@@ -12136,12 +11967,6 @@
|
|
|
12136
11967
|
"url": "https://github.com/sponsors/ljharb"
|
|
12137
11968
|
}
|
|
12138
11969
|
},
|
|
12139
|
-
"node_modules/underscore": {
|
|
12140
|
-
"version": "1.12.1",
|
|
12141
|
-
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz",
|
|
12142
|
-
"integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==",
|
|
12143
|
-
"license": "MIT"
|
|
12144
|
-
},
|
|
12145
11970
|
"node_modules/undici-types": {
|
|
12146
11971
|
"version": "7.16.0",
|
|
12147
11972
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
|
@@ -12564,6 +12389,7 @@
|
|
|
12564
12389
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
|
12565
12390
|
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
|
|
12566
12391
|
"license": "MIT",
|
|
12392
|
+
"peer": true,
|
|
12567
12393
|
"engines": {
|
|
12568
12394
|
"node": ">=0.10.0"
|
|
12569
12395
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-n18-experimental",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./build/index.js",
|
|
17
|
-
"./decorators": "./build/decorators.js",
|
|
18
17
|
"./helpers": "./build/core/playwright/helpers/auth/index.js",
|
|
19
18
|
"./DataGenerator": "./build/core/dataGenerator/DataGenerator.js"
|
|
20
19
|
},
|
|
@@ -35,11 +34,9 @@
|
|
|
35
34
|
"fast-glob": "3.3.1",
|
|
36
35
|
"jest": "29.6.2",
|
|
37
36
|
"jest-environment-jsdom": "29.6.2",
|
|
38
|
-
"jsonpath": "1.1.1",
|
|
39
37
|
"msw": "1.2.3",
|
|
40
38
|
"playwright": "1.53.2",
|
|
41
39
|
"playwright-bdd": "8.3.1",
|
|
42
|
-
"properties-reader": "2.3.0",
|
|
43
40
|
"supports-color": "8.1.1"
|
|
44
41
|
},
|
|
45
42
|
"bin": {
|
|
@@ -257,4 +257,4 @@ header {
|
|
|
257
257
|
font-size: 1rem;
|
|
258
258
|
padding: 0 0.5rem;
|
|
259
259
|
}
|
|
260
|
-
</style></head><body><div class="jesthtml-content"><header><h1 id="title">Unit Report</h1></header><div id="metadata-container"><div id="timestamp">Started: 2025-11-10 12:11:54</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (13)</div><div class="summary-passed ">13 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (46)</div><div class="summary-passed ">46 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><input id="collapsible-0" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-0"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/tagProcessor.test.js</div><div class="suite-time">1.095s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should return tagArgs if no edition is provided</div><div class="test-status">passed</div><div class="test-duration">0.008s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with <= operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with >= operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with < operator</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with > operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with no operator</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should log a message if edition is not found</div><div class="test-status">passed</div><div class="test-duration">0.004s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle multiple editions</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should build tags correctly when tags are empty</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div></div></div><div id="suite-2" class="suite-container"><input id="collapsible-1" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-1"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js</div><div class="suite-time">1.193s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns selected user when any tag info is present</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">logs and returns undefined if getCustomAccountDetails function throws</div><div class="test-status">passed</div><div class="test-duration">0.009s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns default actor when no tag info is not provided</div><div class="test-status">passed</div><div class="test-duration">0.006s</div></div></div></div></div><div id="suite-3" class="suite-container"><input id="collapsible-2" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-2"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/additionalProfiles.test.js</div><div class="suite-time">1.228s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return empty object when no additional profile tags are present</div><div class="test-status">passed</div><div class="test-duration">0.039s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when additional profile tags and editionInfo are present</div><div class="test-status">passed</div><div class="test-duration">0.008s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when all actor details are present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-4" class="suite-container"><input id="collapsible-3" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-3"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js</div><div class="suite-time">1.311s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when config file cannot be loaded</div><div class="test-status">passed</div><div class="test-duration">0.059s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when beta feature config does not exist</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads main configuration when betaFeature is not provided and main config exists</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">falls back to default configuration if main config file does not exist</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads beta feature configuration when betaFeature is provided</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-5" class="suite-container"><input id="collapsible-4" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-4"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js</div><div class="suite-time">1.313s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">should return pipeline-matched config path when file exists</div><div class="test-status">passed</div><div class="test-duration">0.011s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">should use default stage and mode when not provided</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">should return the default config files for pipeline matched files not exists</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getEnvConfigFilePath</div><div class="test-title">should return conf file path when file exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getEnvConfigFilePath</div><div class="test-title">should return default path when file does not exist</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-6" class="suite-container"><input id="collapsible-5" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-5"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/configPathResolver.test.js</div><div class="suite-time">0.22s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getConfigPath</div><div class="test-title">should return correct stageConfig when mapping exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getConfigPath</div><div class="test-title">should log failure when stage mapping does not exist</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-7" class="suite-container"><input id="collapsible-6" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-6"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/configuration/__tests__/Configuration.test.js</div><div class="suite-time">0.205s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should add new key-value pair to the configuration</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should combine configurations correctly using addAll</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should return correct value for a given key</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-8" class="suite-container"><input id="collapsible-7" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-7"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js</div><div class="suite-time">0.222s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">executionContext</div><div class="test-title">should pass actorInfo with details from getCustomAccountDetails to use</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div></div></div><div id="suite-9" class="suite-container"><input id="collapsible-8" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-8"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/examples/src/__tests__/App.test.js</div><div class="suite-time">0.165s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">add function adds two numbers correctly</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">greet function greets a person with their name</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-10" class="suite-container"><input id="collapsible-9" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-9"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/SpawnRunner.test.js</div><div class="suite-time">0.8s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">SpawnRunner > run</div><div class="test-title">should call runPreprocessing when bddMode is true</div><div class="test-status">passed</div><div class="test-duration">0.006s</div></div></div></div></div><div id="suite-11" class="suite-container"><input id="collapsible-10" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-10"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/validateFeature.test.js</div><div class="suite-time">1.946s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with correct arguments and log success</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with playwright conf</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">error when runPreprocessing fails</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-12" class="suite-container"><input id="collapsible-11" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-11"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/RunnerHelper.test.js</div><div class="suite-time">0.763s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should throw error on invalid runner type</div><div class="test-status">passed</div><div class="test-duration">0.004s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should create a valid runner class</div><div class="test-status">passed</div><div class="test-duration">0.011s</div></div></div></div></div><div id="suite-13" class="suite-container"><input id="collapsible-12" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-12"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/fileMutex.test.js</div><div class="suite-time">2.266s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should create the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0.059s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should wait for lock file deletion if it exists</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should reject if watch timeout exceeds</div><div class="test-status">passed</div><div class="test-duration">1.037s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should delete the lock file if it exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should release lock by deleting lock file</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should not attempt to delete the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should log an error if deleting the lock file fails</div><div class="test-status">passed</div><div class="test-duration">0.007s</div></div></div></div></div></div></body></html>
|
|
260
|
+
</style></head><body><div class="jesthtml-content"><header><h1 id="title">Unit Report</h1></header><div id="metadata-container"><div id="timestamp">Started: 2025-11-14 18:34:36</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (12)</div><div class="summary-passed ">12 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (41)</div><div class="summary-passed ">41 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></div><div id="suite-1" class="suite-container"><input id="collapsible-0" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-0"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/tagProcessor.test.js</div><div class="suite-time">1.173s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should return tagArgs if no edition is provided</div><div class="test-status">passed</div><div class="test-duration">0.007s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with <= operator</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with >= operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with < operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with > operator</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle a single edition with no operator</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should log a message if edition is not found</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should handle multiple editions</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">TagProcessor</div><div class="test-title">should build tags correctly when tags are empty</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-2" class="suite-container"><input id="collapsible-1" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-1"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/customFixturesHelper.test.js</div><div class="suite-time">1.223s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns selected user when any tag info is present</div><div class="test-status">passed</div><div class="test-duration">0.01s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">logs and returns undefined if getCustomAccountDetails function throws</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getCustomAccountDetails</div><div class="test-title">returns default actor when no tag info is not provided</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-3" class="suite-container"><input id="collapsible-2" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-2"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/additionalProfiles.test.js</div><div class="suite-time">1.243s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return empty object when no additional profile tags are present</div><div class="test-status">passed</div><div class="test-duration">0.007s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when additional profile tags and editionInfo are present</div><div class="test-status">passed</div><div class="test-duration">0.004s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">additionalProfiles</div><div class="test-title">should return additional profile actors when all actor details are present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-4" class="suite-container"><input id="collapsible-3" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-3"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/getUsers_ListOfActors.test.js</div><div class="suite-time">1.68s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when config file cannot be loaded</div><div class="test-status">passed</div><div class="test-duration">0.076s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">throws an error when beta feature config does not exist</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads main configuration when betaFeature is not provided and main config file exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">falls back to default configuration if main config file does not exist</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getListOfActors</div><div class="test-title">loads beta feature configuration when betaFeature is provided</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-5" class="suite-container"><input id="collapsible-4" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-4"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js</div><div class="suite-time">0.545s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">return the pipeline matched config files for pipeline matched files exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">getUATFileName</div><div class="test-title">return the default config files for pipeline matched files not exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div><div id="suite-6" class="suite-container"><input id="collapsible-5" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-5"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/examples/src/__tests__/App.test.js</div><div class="suite-time">0.192s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">add function adds two numbers correctly</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">example functions</div><div class="test-title">greet function greets a person with their name</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-7" class="suite-container"><input id="collapsible-6" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-6"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/buildInFixtures/__tests__/executionContext.test.js</div><div class="suite-time">0.63s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">executionContext</div><div class="test-title">should pass actorInfo with details from getCustomAccountDetails to use</div><div class="test-status">passed</div><div class="test-duration">0.002s</div></div></div></div></div><div id="suite-8" class="suite-container"><input id="collapsible-7" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-7"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/configuration/__tests__/Configuration.test.js</div><div class="suite-time">0.148s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should add new key-value pair to the configuration</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should combine configurations correctly using addAll</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">Configuration Class</div><div class="test-title">should return correct value for a given key</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-9" class="suite-container"><input id="collapsible-8" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-8"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/helpers/__tests__/fileMutex.test.js</div><div class="suite-time">2.282s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should create the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0.052s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should wait for lock file deletion if it exists</div><div class="test-status">passed</div><div class="test-duration">0.007s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > acquire</div><div class="test-title">should reject if watch timeout exceeds</div><div class="test-status">passed</div><div class="test-duration">1.015s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should delete the lock file if it exists</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should release lock by deleting lock file</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should not attempt to delete the lock file if it does not exist</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">FileMutex > release</div><div class="test-title">should log an error if deleting the lock file fails</div><div class="test-status">passed</div><div class="test-duration">0.005s</div></div></div></div></div><div id="suite-10" class="suite-container"><input id="collapsible-9" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-9"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/SpawnRunner.test.js</div><div class="suite-time">2.264s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">SpawnRunner > run</div><div class="test-title">should call runPreprocessing when bddMode is true</div><div class="test-status">passed</div><div class="test-duration">0.004s</div></div></div></div></div><div id="suite-11" class="suite-container"><input id="collapsible-10" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-10"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/runner/__tests__/RunnerHelper.test.js</div><div class="suite-time">1.045s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should throw error on invalid runner type</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">RunnerHelper > createRunner</div><div class="test-title">should create a valid runner class</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div></div></div><div id="suite-12" class="suite-container"><input id="collapsible-11" type="checkbox" class="toggle" checked="checked"/><label for="collapsible-11"><div class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/__tests__/validateFeature.test.js</div><div class="suite-time">2.325s</div></div></label><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with correct arguments and log success</div><div class="test-status">passed</div><div class="test-duration">0.008s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">runPreprocessing with playwright conf</div><div class="test-status">passed</div><div class="test-duration">0s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">validateFeatureFiles</div><div class="test-title">error when runPreprocessing fails</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></div></div></body></html>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UAT_CONFIG_FILE = exports.TEST_SUMMARY_FILE = exports.STAGE_CONFIG_MAP_FILE = exports.SETTINGS_FILE = exports.INDEX_FILE = exports.DEFAULT_CONFIG_DIR = exports.BETA_DIR = exports.ACTOR_DIR = void 0;
|
|
7
|
-
const DEFAULT_CONFIG_DIR = exports.DEFAULT_CONFIG_DIR = 'default';
|
|
8
|
-
const BETA_DIR = exports.BETA_DIR = 'beta';
|
|
9
|
-
const ACTOR_DIR = exports.ACTOR_DIR = 'actors';
|
|
10
|
-
const UAT_CONFIG_FILE = exports.UAT_CONFIG_FILE = 'uat.config.js';
|
|
11
|
-
const INDEX_FILE = exports.INDEX_FILE = 'index.js';
|
|
12
|
-
const SETTINGS_FILE = exports.SETTINGS_FILE = 'settings.json';
|
|
13
|
-
const TEST_SUMMARY_FILE = exports.TEST_SUMMARY_FILE = 'test-summary.json';
|
|
14
|
-
const STAGE_CONFIG_MAP_FILE = exports.STAGE_CONFIG_MAP_FILE = 'uat/conf-path-map.properties';
|
|
@@ -1,36 +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 _configFiles = require("../constants/configFiles");
|
|
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
|
-
if (!_fs.default.existsSync(filePath)) {
|
|
18
|
-
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Properties file ${filePath} not found at path. Using default configurations.`);
|
|
19
|
-
return {
|
|
20
|
-
get: () => 'uat/conf'
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const properties = (0, _propertiesReader.default)(filePath);
|
|
24
|
-
return properties;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// This function return the value for the passed arguments key
|
|
28
|
-
|
|
29
|
-
function getConfigPath(stage) {
|
|
30
|
-
const props = readPropertiesFile(_configFiles.STAGE_CONFIG_MAP_FILE);
|
|
31
|
-
const configPath = props.get(stage);
|
|
32
|
-
if (!configPath) {
|
|
33
|
-
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `No config mapping found for stage: "${stage}"`);
|
|
34
|
-
}
|
|
35
|
-
return configPath;
|
|
36
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
5
|
-
var _propertiesReader = _interopRequireDefault(require("properties-reader"));
|
|
6
|
-
var _configPathResolver = require("../../../../../core/playwright/helpers/configPathResolver");
|
|
7
|
-
var _logger = require("../../../../../utils/logger");
|
|
8
|
-
jest.mock('../../../../../utils/logger', () => ({
|
|
9
|
-
Logger: {
|
|
10
|
-
log: jest.fn(),
|
|
11
|
-
FAILURE_TYPE: 'FAILURE'
|
|
12
|
-
}
|
|
13
|
-
}));
|
|
14
|
-
jest.mock('fs');
|
|
15
|
-
jest.mock('path');
|
|
16
|
-
jest.mock('properties-reader');
|
|
17
|
-
describe('getConfigPath', () => {
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
jest.clearAllMocks();
|
|
20
|
-
});
|
|
21
|
-
test('should return correct stageConfig when mapping exists', () => {
|
|
22
|
-
const mockProps = {
|
|
23
|
-
get: jest.fn(() => 'uat/conf')
|
|
24
|
-
};
|
|
25
|
-
_propertiesReader.default.mockReturnValue(mockProps);
|
|
26
|
-
_fs.default.existsSync.mockReturnValue(true);
|
|
27
|
-
const result = (0, _configPathResolver.getConfigPath)('uat');
|
|
28
|
-
expect(mockProps.get).toHaveBeenCalledWith('uat');
|
|
29
|
-
expect(result).toBe('uat/conf');
|
|
30
|
-
expect(_logger.Logger.log).not.toHaveBeenCalled();
|
|
31
|
-
});
|
|
32
|
-
test('should log failure when stage mapping does not exist', () => {
|
|
33
|
-
const mockProps = {
|
|
34
|
-
get: jest.fn(() => undefined)
|
|
35
|
-
};
|
|
36
|
-
_propertiesReader.default.mockReturnValue(mockProps);
|
|
37
|
-
_fs.default.existsSync.mockReturnValue(true);
|
|
38
|
-
const result = (0, _configPathResolver.getConfigPath)('invalidStage');
|
|
39
|
-
expect(result).toEqual(undefined);
|
|
40
|
-
expect(_logger.Logger.log).toHaveBeenCalledWith('FAILURE', 'No config mapping found for stage: "invalidStage"');
|
|
41
|
-
});
|
|
42
|
-
});
|