@zohodesk/testinglibrary 0.4.99-n18-experimental → 0.4.100-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/.gitlab-ci.yml +13 -13
- package/README.md +8 -10
- package/build/core/playwright/configuration/ConfigurationHelper.js +5 -7
- 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 +14 -14
- package/build/core/playwright/helpers/configFileNameProvider.js +8 -15
- package/build/core/playwright/readConfigFile.js +2 -3
- package/build/core/playwright/setup/custom-reporter.js +3 -0
- package/build/core/playwright/setup/lastRunUpdater.js +80 -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 +2 -31
- package/package.json +1 -2
- 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/.gitlab-ci.yml
CHANGED
|
@@ -188,19 +188,19 @@ uat-data_generator:
|
|
|
188
188
|
paths:
|
|
189
189
|
- examples/uat/playwright-report
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
191
|
+
uat-search_indexing:
|
|
192
|
+
stage: uat
|
|
193
|
+
script:
|
|
194
|
+
- cd examples
|
|
195
|
+
- npm install $(npm pack ../../testing-framework | tail -1)
|
|
196
|
+
- output=$(npm run uat-search_indexing)
|
|
197
|
+
- echo "$output"
|
|
198
|
+
- node ../ValidateUATReport.js examples
|
|
199
|
+
|
|
200
|
+
artifacts:
|
|
201
|
+
when: always
|
|
202
|
+
paths:
|
|
203
|
+
- examples/uat/playwright-report
|
|
204
204
|
|
|
205
205
|
|
|
206
206
|
|
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,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
|
}
|
|
@@ -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
|
}
|
|
@@ -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);
|
|
@@ -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 _lastRunUpdater = _interopRequireDefault(require("./lastRunUpdater"));
|
|
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, _lastRunUpdater.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 */
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
function mergeAbortedTestsIntoLastRun() {
|
|
13
|
+
let projectName = 'chromium',
|
|
14
|
+
resultsFile = _path.default.join(process.cwd(), 'uat', 'test-results', 'playwright-test-results.json'),
|
|
15
|
+
lastRunFile = _path.default.join(process.cwd(), 'uat', 'test-results', '.last-run.json');
|
|
16
|
+
try {
|
|
17
|
+
if (!_fs.default.existsSync(resultsFile)) {
|
|
18
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `No test results found at ${resultsFile}, skipping .last-run update.`);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let report;
|
|
22
|
+
try {
|
|
23
|
+
report = JSON.parse(_fs.default.readFileSync(resultsFile, 'utf-8'));
|
|
24
|
+
} catch (e) {
|
|
25
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Failed to parse results file: ${resultsFile}`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const abortedTests = new Set();
|
|
29
|
+
const isAbortedSpec = spec => {
|
|
30
|
+
const tags = Array.isArray(spec.tags) ? spec.tags : [];
|
|
31
|
+
// If no test satisfies all three, it returns false
|
|
32
|
+
return spec.tests.some(test => !tags.includes('skip') && test.projectName === projectName && test.status === 'skipped');
|
|
33
|
+
};
|
|
34
|
+
const traverseSuites = suite => {
|
|
35
|
+
if (suite.suites) {
|
|
36
|
+
for (const child of suite.suites) {
|
|
37
|
+
traverseSuites(child);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (suite.specs) {
|
|
41
|
+
for (const spec of suite.specs) {
|
|
42
|
+
if (isAbortedSpec(spec)) {
|
|
43
|
+
abortedTests.add(spec.id);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (Array.isArray(report.suites)) {
|
|
49
|
+
for (const suite of report.suites) {
|
|
50
|
+
traverseSuites(suite);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let lastRunData = {
|
|
54
|
+
status: 'passed',
|
|
55
|
+
failedTests: []
|
|
56
|
+
};
|
|
57
|
+
if (_fs.default.existsSync(lastRunFile)) {
|
|
58
|
+
try {
|
|
59
|
+
const parsed = JSON.parse(_fs.default.readFileSync(lastRunFile, 'utf-8'));
|
|
60
|
+
lastRunData.status = parsed.status || lastRunData.status;
|
|
61
|
+
lastRunData.failedTests = Array.isArray(parsed.failedTests) ? parsed.failedTests : [];
|
|
62
|
+
} catch (e) {
|
|
63
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Failed to parse existing last-run file: ${lastRunFile}. Rebuilding.`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Merge existing failed tests + aborted tests
|
|
68
|
+
const failedSet = new Set(lastRunData.failedTests);
|
|
69
|
+
for (const id of abortedTests) {
|
|
70
|
+
failedSet.add(id);
|
|
71
|
+
}
|
|
72
|
+
lastRunData.failedTests = [...failedSet];
|
|
73
|
+
lastRunData.status = failedSet.size > 0 ? 'failed' : lastRunData.status;
|
|
74
|
+
(0, _fileUtils.writeFileContents)(lastRunFile, JSON.stringify(lastRunData, null, 2));
|
|
75
|
+
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Updated → → → ${abortedTests.size} aborted tests in .last-run.json file`);
|
|
76
|
+
return lastRunData;
|
|
77
|
+
} catch (err) {
|
|
78
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Error updating .last-run.json: ${err.message}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -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.4.
|
|
3
|
+
"version": "0.4.100-n18-experimental",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@zohodesk/testinglibrary",
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.100-n18-experimental",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"msw": "1.2.3",
|
|
28
28
|
"playwright": "1.53.2",
|
|
29
29
|
"playwright-bdd": "8.3.1",
|
|
30
|
-
"properties-reader": "2.3.0",
|
|
31
30
|
"supports-color": "8.1.1"
|
|
32
31
|
},
|
|
33
32
|
"bin": {
|
|
@@ -6424,20 +6423,6 @@
|
|
|
6424
6423
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
|
6425
6424
|
"license": "ISC"
|
|
6426
6425
|
},
|
|
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
6426
|
"node_modules/function-bind": {
|
|
6442
6427
|
"version": "1.1.2",
|
|
6443
6428
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
|
@@ -10530,20 +10515,6 @@
|
|
|
10530
10515
|
"node": ">=18"
|
|
10531
10516
|
}
|
|
10532
10517
|
},
|
|
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
10518
|
"node_modules/possible-typed-array-names": {
|
|
10548
10519
|
"version": "1.1.0",
|
|
10549
10520
|
"resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/testinglibrary",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.100-n18-experimental",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"msw": "1.2.3",
|
|
40
40
|
"playwright": "1.53.2",
|
|
41
41
|
"playwright-bdd": "8.3.1",
|
|
42
|
-
"properties-reader": "2.3.0",
|
|
43
42
|
"supports-color": "8.1.1"
|
|
44
43
|
},
|
|
45
44
|
"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-12 18:33:34</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.171s</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.009s</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">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">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">0s</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.002s</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__/additionalProfiles.test.js</div><div class="suite-time">1.606s</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.002s</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.001s</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-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__/getUsers_ListOfActors.test.js</div><div class="suite-time">1.623s</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.045s</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.006s</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.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">0s</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__/configFileNameProvider.test.js</div><div class="suite-time">1.593s</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.003s</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">0s</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">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 conf file path when file 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 default path when file does not exist</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__/customFixturesHelper.test.js</div><div class="suite-time">1.59s</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.008s</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-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/configuration/__tests__/Configuration.test.js</div><div class="suite-time">0.133s</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.002s</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">0.004s</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-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/helpers/__tests__/configPathResolver.test.js</div><div class="suite-time">0.247s</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.002s</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-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.271s</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.001s</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.18s</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/helpers/__tests__/fileMutex.test.js</div><div class="suite-time">2.278s</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.039s</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.018s</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">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 release lock by deleting lock file</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 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.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">0.689s</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.003s</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.001s</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.306s</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.007s</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-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/runner/__tests__/SpawnRunner.test.js</div><div class="suite-time">1.111s</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.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
|
-
});
|