@zohodesk/testinglibrary 0.4.56-experimental → 0.4.57-n14-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 +2 -2
- package/README.md +1 -54
- package/build/bdd-framework/cli/commands/env.js +42 -0
- package/build/bdd-framework/cli/commands/export.js +62 -0
- package/build/bdd-framework/cli/commands/test.js +64 -0
- package/build/bdd-framework/cli/index.js +11 -0
- package/build/bdd-framework/cli/options.js +19 -0
- package/build/bdd-framework/cli/worker.js +13 -0
- package/build/bdd-framework/config/configDir.js +35 -0
- package/build/bdd-framework/config/enrichReporterData.js +23 -0
- package/build/bdd-framework/config/env.js +50 -0
- package/build/bdd-framework/config/index.js +94 -0
- package/build/bdd-framework/config/lang.js +14 -0
- package/build/bdd-framework/cucumber/buildStepDefinition.js +43 -0
- package/build/bdd-framework/cucumber/createTestStep.js +43 -0
- package/build/bdd-framework/cucumber/formatter/EventDataCollector.js +126 -0
- package/build/bdd-framework/cucumber/formatter/GherkinDocumentParser.js +72 -0
- package/build/bdd-framework/cucumber/formatter/PickleParser.js +25 -0
- package/build/bdd-framework/cucumber/formatter/durationHelpers.js +13 -0
- package/build/bdd-framework/cucumber/formatter/getColorFns.js +57 -0
- package/build/bdd-framework/cucumber/formatter/index.js +16 -0
- package/build/bdd-framework/cucumber/formatter/locationHelpers.js +16 -0
- package/build/bdd-framework/cucumber/loadConfig.js +17 -0
- package/build/bdd-framework/cucumber/loadFeatures.js +70 -0
- package/build/bdd-framework/cucumber/loadSnippetBuilder.js +20 -0
- package/build/bdd-framework/cucumber/loadSteps.js +47 -0
- package/build/bdd-framework/cucumber/resolveFeaturePaths.js +62 -0
- package/build/bdd-framework/cucumber/stepArguments.js +21 -0
- package/build/bdd-framework/cucumber/types.js +5 -0
- package/build/bdd-framework/cucumber/valueChecker.js +23 -0
- package/build/bdd-framework/decorators.js +18 -0
- package/build/bdd-framework/gen/fixtures.js +48 -0
- package/build/bdd-framework/gen/formatter.js +167 -0
- package/build/bdd-framework/gen/i18n.js +39 -0
- package/build/bdd-framework/gen/index.js +197 -0
- package/build/bdd-framework/gen/specialTags.js +70 -0
- package/build/bdd-framework/gen/testFile.js +470 -0
- package/build/bdd-framework/gen/testMeta.js +60 -0
- package/build/bdd-framework/gen/testNode.js +35 -0
- package/build/bdd-framework/gen/testPoms.js +133 -0
- package/build/bdd-framework/hooks/scenario.js +130 -0
- package/build/bdd-framework/hooks/worker.js +89 -0
- package/build/bdd-framework/index.js +52 -0
- package/build/bdd-framework/playwright/fixtureParameterNames.js +93 -0
- package/build/bdd-framework/playwright/getLocationInFile.js +79 -0
- package/build/bdd-framework/playwright/loadConfig.js +42 -0
- package/build/bdd-framework/playwright/loadUtils.js +33 -0
- package/build/bdd-framework/playwright/testTypeImpl.js +79 -0
- package/build/bdd-framework/playwright/transform.js +88 -0
- package/build/bdd-framework/playwright/types.js +12 -0
- package/build/bdd-framework/playwright/utils.js +56 -0
- package/build/bdd-framework/reporter/cucumber/base.js +52 -0
- package/build/bdd-framework/reporter/cucumber/custom.js +73 -0
- package/build/bdd-framework/reporter/cucumber/helper.js +12 -0
- package/build/bdd-framework/reporter/cucumber/html.js +40 -0
- package/build/bdd-framework/reporter/cucumber/index.js +74 -0
- package/build/bdd-framework/reporter/cucumber/json.js +312 -0
- package/build/bdd-framework/reporter/cucumber/junit.js +205 -0
- package/build/bdd-framework/reporter/cucumber/message.js +20 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/AttachmentMapper.js +82 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Builder.js +197 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocument.js +43 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocumentClone.js +52 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/GherkinDocuments.js +105 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Hook.js +70 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Meta.js +45 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Pickles.js +27 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/Projects.js +38 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCase.js +128 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRun.js +154 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestCaseRunHooks.js +123 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepAttachments.js +67 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/TestStepRun.js +114 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/index.js +30 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/pwStepUtils.js +70 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/timing.js +35 -0
- package/build/bdd-framework/reporter/cucumber/messagesBuilder/types.js +5 -0
- package/build/bdd-framework/run/StepInvoker.js +69 -0
- package/build/bdd-framework/run/bddData/index.js +59 -0
- package/build/bdd-framework/run/bddData/types.js +5 -0
- package/build/bdd-framework/run/bddFixtures.js +192 -0
- package/build/bdd-framework/run/bddWorld.js +79 -0
- package/build/bdd-framework/run/bddWorldInternal.js +11 -0
- package/build/bdd-framework/snippets/index.js +132 -0
- package/build/bdd-framework/snippets/snippetSyntax.js +43 -0
- package/build/bdd-framework/snippets/snippetSyntaxDecorators.js +26 -0
- package/build/bdd-framework/snippets/snippetSyntaxTs.js +18 -0
- package/build/bdd-framework/stepDefinitions/createBdd.js +66 -0
- package/build/bdd-framework/stepDefinitions/decorators/class.js +68 -0
- package/build/bdd-framework/stepDefinitions/decorators/steps.js +99 -0
- package/build/bdd-framework/stepDefinitions/defineStep.js +62 -0
- package/build/bdd-framework/stepDefinitions/stepConfig.js +24 -0
- package/build/bdd-framework/steps/createBdd.js +78 -0
- package/build/bdd-framework/steps/decorators/class.js +68 -0
- package/build/bdd-framework/steps/decorators/steps.js +98 -0
- package/build/bdd-framework/steps/defineStep.js +62 -0
- package/build/bdd-framework/steps/stepConfig.js +24 -0
- package/build/bdd-framework/utils/AutofillMap.js +20 -0
- package/build/bdd-framework/utils/exit.js +62 -0
- package/build/bdd-framework/utils/index.js +93 -0
- package/build/bdd-framework/utils/jsStringWrap.js +44 -0
- package/build/bdd-framework/utils/logger.js +30 -0
- package/build/bdd-framework/utils/stripAnsiEscapes.js +20 -0
- package/build/core/playwright/clear-caches.js +0 -7
- package/build/core/playwright/helpers/auth/checkAuthCookies.js +8 -9
- package/build/core/playwright/helpers/auth/loginSteps.js +12 -3
- package/build/core/playwright/helpers/configFileNameProvider.js +1 -1
- package/build/core/playwright/helpers/fileMutex.js +14 -19
- package/build/core/playwright/index.js +23 -10
- package/build/core/playwright/runner/SpawnRunner.js +2 -2
- package/build/core/playwright/setup/config-creator.js +8 -15
- package/build/core/playwright/setup/config-utils.js +25 -8
- package/build/core/playwright/tagProcessor.js +7 -5
- package/build/core/playwright/test-runner.js +2 -2
- package/build/decorators.d.ts +1 -1
- package/build/decorators.js +1 -1
- package/build/index.js +0 -6
- package/build/setup-folder-structure/samples/auth-setup-sample.js +68 -10
- package/build/setup-folder-structure/samples/authUsers-sample.json +9 -0
- package/build/setup-folder-structure/samples/env-config-sample.json +21 -0
- package/build/setup-folder-structure/samples/uat-config-sample.js +1 -3
- package/build/setup-folder-structure/setupProject.js +5 -22
- package/build/test/core/playwright/__tests__/tagProcessor.test.js +19 -18
- package/build/test/core/playwright/helpers/__tests__/configFileNameProvider.test.js +1 -1
- package/build/test/core/playwright/helpers/__tests__/fileMutex.test.js +2 -19
- package/npm-shrinkwrap.json +2284 -7299
- package/package.json +9 -10
- package/playwright.config.js +48 -0
- package/unit_reports/unit-report.html +260 -0
- package/build/core/playwright/fixtures.js +0 -24
- package/build/setup-folder-structure/samples/accountLogin-sample.js +0 -19
- package/build/setup-folder-structure/samples/actors-index.js +0 -2
- package/build/setup-folder-structure/samples/editions-index.js +0 -3
- package/build/setup-folder-structure/samples/free-sample.json +0 -25
- package/build/setup-folder-structure/samples/settings.json +0 -7
- package/build/setup-folder-structure/samples/testSetup-sample.js +0 -14
|
@@ -10,6 +10,7 @@ var _fileMutex = _interopRequireDefault(require("../fileMutex"));
|
|
|
10
10
|
var _fileMutexConfig = require("../../constants/fileMutexConfig");
|
|
11
11
|
var _checkAuthCookies = require("./checkAuthCookies");
|
|
12
12
|
var _checkAuthDirectory = require("../checkAuthDirectory");
|
|
13
|
+
var _fs = require("fs");
|
|
13
14
|
/* eslint-disable no-console */
|
|
14
15
|
|
|
15
16
|
async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
@@ -21,9 +22,15 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
|
21
22
|
authFilePrefix = authFilePrefix || email;
|
|
22
23
|
const authFile = _path.default.resolve(_path.default.join((0, _checkAuthCookies.getAuthFileDirectory)(), `${authFilePrefix}-cookies.json`));
|
|
23
24
|
const lockFileName = email.replace(/[@.]/g, '_');
|
|
24
|
-
const fileMutex = new _fileMutex.default((0, _checkAuthDirectory.getLockDirectoryPath)(), lockFileName,
|
|
25
|
+
const fileMutex = new _fileMutex.default((0, _checkAuthDirectory.getLockDirectoryPath)(), lockFileName, _fileMutexConfig.fileDeletionTimeoutConfig);
|
|
26
|
+
let loginUsingCookie = false;
|
|
25
27
|
try {
|
|
26
|
-
|
|
28
|
+
if ((0, _checkAuthCookies.verifyIfCookieFileExists)(authFile)) {
|
|
29
|
+
console.log(`${email} Cookie file exists. Loading cookies, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
30
|
+
loginUsingCookie = true;
|
|
31
|
+
} else {
|
|
32
|
+
await fileMutex.acquire();
|
|
33
|
+
}
|
|
27
34
|
await (0, _checkAuthCookies.loadCookiesIfPresent)(page, authFile);
|
|
28
35
|
const isAlreadyLoggedIn = await isLoggedIn(testInfo);
|
|
29
36
|
if (!isAlreadyLoggedIn) {
|
|
@@ -36,7 +43,9 @@ async function performLoginSteps(testInfo, isLoggedIn, loginSteps) {
|
|
|
36
43
|
} catch (error) {
|
|
37
44
|
console.error(`Error during login for ${email}:`, error);
|
|
38
45
|
} finally {
|
|
39
|
-
|
|
46
|
+
if (!loginUsingCookie) {
|
|
47
|
+
await fileMutex.release();
|
|
48
|
+
}
|
|
40
49
|
}
|
|
41
50
|
}
|
|
42
51
|
var _default = exports.default = performLoginSteps;
|
|
@@ -16,7 +16,7 @@ function getUATFileName(mode) {
|
|
|
16
16
|
if (_fs.default.existsSync(uatConfFilePath)) {
|
|
17
17
|
return uatConfFilePath;
|
|
18
18
|
}
|
|
19
|
-
return _path.default.resolve(process.cwd(), `uat
|
|
19
|
+
return _path.default.resolve(process.cwd(), `uat.config.js`);
|
|
20
20
|
}
|
|
21
21
|
function getEnvConfigFilePath(mode) {
|
|
22
22
|
const confFilePath = _path.default.resolve(process.cwd(), `uat/conf/${mode}/settings.json`);
|
|
@@ -12,25 +12,19 @@ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("C
|
|
|
12
12
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
13
13
|
var _FileMutex_brand = /*#__PURE__*/new WeakSet();
|
|
14
14
|
class FileMutex {
|
|
15
|
-
constructor(directory, lockFileName,
|
|
15
|
+
constructor(directory, lockFileName, fileDeletionTimeoutConfig) {
|
|
16
16
|
_classPrivateMethodInitSpec(this, _FileMutex_brand);
|
|
17
17
|
this.directory = directory;
|
|
18
18
|
this.lockFileName = lockFileName + ".lock";
|
|
19
|
-
this.email = email;
|
|
20
|
-
this.authFile = authFile;
|
|
21
19
|
this.fileDeletionTimeout = fileDeletionTimeoutConfig.timeout;
|
|
22
|
-
this.createDirectoryIfNotExist();
|
|
23
20
|
this.lockFilePath = _assertClassBrand(_FileMutex_brand, this, _getLockFilePath).call(this);
|
|
21
|
+
_assertClassBrand(_FileMutex_brand, this, _createDirectoryIfNotExist).call(this);
|
|
24
22
|
}
|
|
25
23
|
async acquire() {
|
|
26
|
-
if ((0, _fs.existsSync)(this.authFile)) {
|
|
27
|
-
console.log(`${this.email} Cookie file exists. Loading cookies...`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
24
|
return new Promise((resolve, reject) => {
|
|
31
25
|
if (!(0, _fs.existsSync)(this.lockFilePath)) {
|
|
32
26
|
(0, _fs.writeFileSync)(this.lockFilePath, 'locked');
|
|
33
|
-
console.log(`Lock file created: ${this.lockFilePath}`);
|
|
27
|
+
console.log(`Lock file created: ${this.lockFilePath}, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
34
28
|
return resolve();
|
|
35
29
|
}
|
|
36
30
|
const timeout = setTimeout(() => {
|
|
@@ -41,7 +35,7 @@ class FileMutex {
|
|
|
41
35
|
try {
|
|
42
36
|
if (eventType === 'rename' && filename === this.lockFileName) {
|
|
43
37
|
clearTimeout(timeout);
|
|
44
|
-
console.log(`Lock file deleted! Proceeding
|
|
38
|
+
console.log(`Lock file deleted! Proceeding, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
45
39
|
watcher.close();
|
|
46
40
|
resolve();
|
|
47
41
|
}
|
|
@@ -56,21 +50,22 @@ class FileMutex {
|
|
|
56
50
|
try {
|
|
57
51
|
if ((0, _fs.existsSync)(this.lockFilePath)) {
|
|
58
52
|
(0, _fs.unlinkSync)(this.lockFilePath);
|
|
59
|
-
console.log(`Lock file deleted: ${this.lockFilePath}`);
|
|
53
|
+
console.log(`Lock file deleted: ${this.lockFilePath}, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
60
54
|
}
|
|
61
55
|
} catch (err) {
|
|
62
|
-
console.error(`Error deleting lock file: ${err.message}`);
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
async createDirectoryIfNotExist() {
|
|
66
|
-
if (!(0, _fs.existsSync)(this.directory)) {
|
|
67
|
-
(0, _fs.mkdirSync)(this.directory, {
|
|
68
|
-
recursive: true
|
|
69
|
-
});
|
|
56
|
+
console.error(`Error deleting lock file: ${err.message}, worker index - ${process.env.TEST_WORKER_INDEX}`);
|
|
57
|
+
throw err;
|
|
70
58
|
}
|
|
71
59
|
}
|
|
72
60
|
}
|
|
73
61
|
function _getLockFilePath() {
|
|
74
62
|
return _path.default.resolve(_path.default.join(this.directory, this.lockFileName));
|
|
75
63
|
}
|
|
64
|
+
async function _createDirectoryIfNotExist() {
|
|
65
|
+
if (!(0, _fs.existsSync)(this.directory)) {
|
|
66
|
+
(0, _fs.mkdirSync)(this.directory, {
|
|
67
|
+
recursive: true
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
76
71
|
var _default = exports.default = FileMutex;
|
|
@@ -1,24 +1,37 @@
|
|
|
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
|
-
exports
|
|
7
|
-
Object.defineProperty(exports, "expect", {
|
|
7
|
+
Object.defineProperty(exports, "createBdd", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
10
|
-
return
|
|
10
|
+
return _bddFramework.createBdd;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "expect", {
|
|
14
14
|
enumerable: true,
|
|
15
15
|
get: function () {
|
|
16
|
-
return
|
|
16
|
+
return _test.expect;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
exports.test = void 0;
|
|
20
|
+
var _bddFramework = require("../../bdd-framework");
|
|
20
21
|
var _test = require("@playwright/test");
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
var _readConfigFile = require("./readConfigFile");
|
|
23
|
+
var _builtInFixtures = _interopRequireDefault(require("./builtInFixtures"));
|
|
24
|
+
var _getUserFixtures = _interopRequireDefault(require("./helpers/getUserFixtures"));
|
|
25
|
+
const {
|
|
26
|
+
bddMode
|
|
27
|
+
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
28
|
+
let base = bddMode ? _bddFramework.test : _test.test;
|
|
29
|
+
const buildInFixtures = (0, _builtInFixtures.default)(bddMode);
|
|
30
|
+
const buildInFixturesTest = base.extend({
|
|
31
|
+
...buildInFixtures
|
|
32
|
+
});
|
|
33
|
+
const userFixtures = (0, _getUserFixtures.default)();
|
|
34
|
+
const userFixturesTest = base.extend({
|
|
35
|
+
...userFixtures
|
|
36
|
+
});
|
|
37
|
+
const test = exports.test = (0, _test.mergeTests)(buildInFixturesTest, userFixturesTest);
|
|
@@ -33,9 +33,9 @@ class SpawnRunner extends _Runner.default {
|
|
|
33
33
|
const {
|
|
34
34
|
tagArgs
|
|
35
35
|
} = this.runnerObj;
|
|
36
|
-
const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? _path.default.resolve(__dirname, '../', 'setup', 'config-creator.js') : _path.default.resolve(
|
|
36
|
+
const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? _path.default.resolve(__dirname, '../', 'setup', 'config-creator.js') : _path.default.resolve('../', '../', '../', '../', 'playwrightConfig.js');
|
|
37
37
|
const beforeCommand = 'node';
|
|
38
|
-
const bddGenPath = _path.default.resolve(
|
|
38
|
+
const bddGenPath = _path.default.resolve(__dirname, '../', '../', '../', 'bdd-framework', 'cli', 'index.js');
|
|
39
39
|
const beforeArgs = [bddGenPath, '-c', require.resolve(configPath)];
|
|
40
40
|
if (tagArgs) {
|
|
41
41
|
beforeArgs.push('--tags');
|
|
@@ -25,8 +25,7 @@ const {
|
|
|
25
25
|
featureFilesFolder,
|
|
26
26
|
stepDefinitionsFolder,
|
|
27
27
|
testIdAttribute,
|
|
28
|
-
globalTimeout
|
|
29
|
-
customReporter
|
|
28
|
+
globalTimeout
|
|
30
29
|
} = uatConfig;
|
|
31
30
|
const projects = (0, _configUtils.getProjects)({
|
|
32
31
|
browsers,
|
|
@@ -40,21 +39,12 @@ const testDir = (0, _configUtils.getTestDir)(bddMode, process.cwd(), {
|
|
|
40
39
|
featureFilesFolder,
|
|
41
40
|
stepDefinitionsFolder
|
|
42
41
|
});
|
|
43
|
-
const
|
|
42
|
+
const testOptions = (0, _configUtils.getTestUseOptions)({
|
|
44
43
|
trace,
|
|
45
44
|
video,
|
|
46
45
|
viewport,
|
|
47
46
|
testIdAttribute
|
|
48
|
-
};
|
|
49
|
-
let reporter = [['html', {
|
|
50
|
-
outputFolder: reportPath,
|
|
51
|
-
open: openReportOn
|
|
52
|
-
}], ['list'], ['json', {
|
|
53
|
-
outputFile: _path.default.join(process.cwd(), 'uat', 'test-results', 'test-results.json')
|
|
54
|
-
}], ['./custom-reporter.js']];
|
|
55
|
-
if (customReporter) {
|
|
56
|
-
reporter = [customReporter, ...reporter];
|
|
57
|
-
}
|
|
47
|
+
});
|
|
58
48
|
|
|
59
49
|
/**
|
|
60
50
|
* Playwright configuration object
|
|
@@ -67,12 +57,15 @@ function getPlaywrightConfig() {
|
|
|
67
57
|
globalTimeout: globalTimeout || 3600000,
|
|
68
58
|
outputDir: _path.default.join(process.cwd(), 'uat', 'test-results'),
|
|
69
59
|
fullyParallel: true,
|
|
70
|
-
reporter,
|
|
60
|
+
reporter: [['html', {
|
|
61
|
+
outputFolder: reportPath,
|
|
62
|
+
open: openReportOn
|
|
63
|
+
}], ['list'], ['./custom-reporter.js']],
|
|
71
64
|
timeout: testTimeout,
|
|
72
65
|
expect: {
|
|
73
66
|
timeout: expectTimeout
|
|
74
67
|
},
|
|
75
|
-
use,
|
|
68
|
+
use: testOptions,
|
|
76
69
|
projects: isAuthMode ? [{
|
|
77
70
|
name: 'setup',
|
|
78
71
|
testMatch: /.*\.setup\.js/,
|
|
@@ -7,12 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getBrowsersList = getBrowsersList;
|
|
8
8
|
exports.getProjects = getProjects;
|
|
9
9
|
exports.getTestDir = getTestDir;
|
|
10
|
+
exports.getTestUseOptions = getTestUseOptions;
|
|
10
11
|
var _test = require("@playwright/test");
|
|
11
12
|
var _path = _interopRequireDefault(require("path"));
|
|
12
13
|
var _readConfigFile = require("../readConfigFile");
|
|
13
|
-
var
|
|
14
|
+
var _bddFramework = require("../../../bdd-framework");
|
|
14
15
|
var _logger = require("../../../utils/logger");
|
|
15
16
|
var _browserTypes = require("../constants/browserTypes");
|
|
17
|
+
var _configFileNameProvider = require("../helpers/configFileNameProvider");
|
|
16
18
|
var _fileUtils = require("../../../utils/fileUtils");
|
|
17
19
|
/**
|
|
18
20
|
** Playwright project configuration
|
|
@@ -146,15 +148,30 @@ function getPathsForFeatureFiles(cwd) {
|
|
|
146
148
|
function getTestDir(bddMode, cwd, {
|
|
147
149
|
stepDefinitionsFolder
|
|
148
150
|
}) {
|
|
149
|
-
return bddMode ? (0,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
importTestFrom: require.resolve('../fixtures.js'),
|
|
151
|
+
return bddMode ? (0, _bddFramework.defineBddConfig)({
|
|
152
|
+
paths: getPathsForFeatureFiles(cwd),
|
|
153
|
+
import: [_path.default.join(cwd, 'uat', '**', stepDefinitionsFolder, '*.spec.js')],
|
|
153
154
|
featuresRoot: _path.default.join(cwd, 'uat'),
|
|
154
155
|
outputDir: _path.default.join(cwd, 'uat', '.features-gen'),
|
|
155
|
-
disableWarnings: {
|
|
156
|
-
importTestFrom: true
|
|
157
|
-
},
|
|
158
156
|
publish: true
|
|
159
157
|
}) : _path.default.join(cwd, 'uat');
|
|
158
|
+
}
|
|
159
|
+
function getTestUseOptions({
|
|
160
|
+
viewport,
|
|
161
|
+
trace,
|
|
162
|
+
video,
|
|
163
|
+
testIdAttribute
|
|
164
|
+
}) {
|
|
165
|
+
let defaultTestuseOptions = {
|
|
166
|
+
viewport,
|
|
167
|
+
testIdAttribute,
|
|
168
|
+
trace: trace ? 'on' : 'off',
|
|
169
|
+
video: video ? {
|
|
170
|
+
mode: 'on',
|
|
171
|
+
size: {
|
|
172
|
+
...viewport
|
|
173
|
+
}
|
|
174
|
+
} : 'off'
|
|
175
|
+
};
|
|
176
|
+
return defaultTestuseOptions;
|
|
160
177
|
}
|
|
@@ -10,12 +10,14 @@ class TagProcessor {
|
|
|
10
10
|
_classPrivateMethodInitSpec(this, _TagProcessor_brand);
|
|
11
11
|
this.editionOrder = editionOrder;
|
|
12
12
|
}
|
|
13
|
-
processTags(
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
processTags(config) {
|
|
14
|
+
const {
|
|
15
|
+
tags,
|
|
16
|
+
edition
|
|
17
|
+
} = config.getAll();
|
|
18
|
+
if (!edition) return tags;
|
|
17
19
|
const editionsArray = edition.split(',');
|
|
18
|
-
const editionTags = editionsArray.length === 1 ? _assertClassBrand(_TagProcessor_brand, this, _processSingleEdition).call(this, editionsArray[0],
|
|
20
|
+
const editionTags = editionsArray.length === 1 ? _assertClassBrand(_TagProcessor_brand, this, _processSingleEdition).call(this, editionsArray[0], tags) : _assertClassBrand(_TagProcessor_brand, this, _processMultipleEditions).call(this, editionsArray, tags);
|
|
19
21
|
return editionTags;
|
|
20
22
|
}
|
|
21
23
|
}
|
|
@@ -24,7 +24,7 @@ var _RunnerHelper = _interopRequireDefault(require("./runner/RunnerHelper"));
|
|
|
24
24
|
var _Runner = _interopRequireDefault(require("./runner/Runner"));
|
|
25
25
|
function runPreprocessing(tagArgs, configPath) {
|
|
26
26
|
const beforeCommand = 'node';
|
|
27
|
-
const bddGenPath = _path.default.resolve(
|
|
27
|
+
const bddGenPath = _path.default.resolve(__dirname, '../', '../', 'bdd-framework', 'cli', 'index.js');
|
|
28
28
|
const beforeArgs = [bddGenPath, '-c', configPath];
|
|
29
29
|
if (tagArgs) {
|
|
30
30
|
beforeArgs.push('--tags');
|
|
@@ -104,7 +104,7 @@ function main() {
|
|
|
104
104
|
//This is only used for pass the user arguments to need places in legacy code. We need to rewamp that also.
|
|
105
105
|
const userArgsObject = userArgConfig.getAll();
|
|
106
106
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
107
|
-
const tagArgs = tagProcessor.processTags(
|
|
107
|
+
const tagArgs = tagProcessor.processTags(uatConfig);
|
|
108
108
|
const runnerObj = new _Runner.default();
|
|
109
109
|
runnerObj.setTagArgs(tagArgs);
|
|
110
110
|
runnerObj.setUserArgs(userArgsObject);
|
package/build/decorators.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './bdd-framework/decorators';
|
package/build/decorators.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _decorators = require("
|
|
6
|
+
var _decorators = require("./bdd-framework/decorators");
|
|
7
7
|
Object.keys(_decorators).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
9
|
if (key in exports && exports[key] === _decorators[key]) return;
|
package/build/index.js
CHANGED
|
@@ -70,12 +70,6 @@ Object.defineProperty(exports, "performLoginSteps", {
|
|
|
70
70
|
return _index.performLoginSteps;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
Object.defineProperty(exports, "setup", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return _index.setup;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
73
|
Object.defineProperty(exports, "test", {
|
|
80
74
|
enumerable: true,
|
|
81
75
|
get: function () {
|
|
@@ -1,15 +1,73 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
import { test as setup, expect } from '@zohodesk/testinglibrary';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
5
|
+
import { getAuthFileDirectory } from '../../core/playwright';
|
|
6
|
+
import { Logger } from '../../utils/logger';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
const userdata = require('./authUsers.json');
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const authContent = { cookies: [] };
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const LOGIN_ERR_MESSAGE = 'Need go be logged in';
|
|
13
|
+
// const AUTH_ERR_MESSAGE = `Founded Path - ${path.resolve(process.cwd(),'uat','playwright','.auth')} \n Find if file is Properly Created. Cookies Cannot Be Read .. `
|
|
14
|
+
|
|
15
|
+
function convertCookiesToParse(cookies, authFilePath) {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(cookies);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
Logger.error(err);
|
|
20
|
+
throw new Error(
|
|
21
|
+
` Error while parsing cookies ${err} \n${path.resolve(
|
|
22
|
+
process.cwd(),
|
|
23
|
+
authFilePath
|
|
24
|
+
)} File is Empty`
|
|
25
|
+
);
|
|
26
|
+
// process.exit()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const authDirectory = getAuthFileDirectory(); //path.resolve(process.cwd(), 'uat', 'playwright', '.auth');
|
|
30
|
+
if (!existsSync(authDirectory)) {
|
|
31
|
+
console.log('Creating auth directory for the first time setup...');
|
|
32
|
+
mkdirSync(authDirectory, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
userdata.forEach(data => {
|
|
36
|
+
const authFile = path.resolve(path.join(authDirectory, `${data.filename}`));
|
|
37
|
+
if (!existsSync(authFile)) {
|
|
38
|
+
console.log('creating auth file..');
|
|
39
|
+
writeFileSync(authFile, JSON.stringify(authContent, null, 2));
|
|
40
|
+
}
|
|
41
|
+
setup(data.description, async ({ page }) => {
|
|
42
|
+
try {
|
|
43
|
+
const cookies = readFileSync(authFile);
|
|
44
|
+
const parsedCookies = convertCookiesToParse(cookies, authFile);
|
|
45
|
+
await page
|
|
46
|
+
.context()
|
|
47
|
+
.addCookies(
|
|
48
|
+
parsedCookies.cookies === undefined ? [] : parsedCookies.cookies
|
|
49
|
+
);
|
|
50
|
+
await page.goto(page.getBaseUrl());
|
|
51
|
+
await page.waitForLoadState();
|
|
52
|
+
if (await page.url().includes(process.env.domain)) {
|
|
53
|
+
await page.waitForSelector(data.locator);
|
|
54
|
+
} else {
|
|
55
|
+
throw new Error(LOGIN_ERR_MESSAGE);
|
|
56
|
+
}
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (err.message === LOGIN_ERR_MESSAGE) {
|
|
59
|
+
await expect(page.locator('.load-bg')).toBeHidden();
|
|
60
|
+
await page.locator('#login_id').type(data.useremail);
|
|
61
|
+
await page.locator('#nextbtn').click();
|
|
62
|
+
await page.locator('#password').type(data.password);
|
|
63
|
+
await page.locator('#nextbtn').click();
|
|
64
|
+
|
|
65
|
+
await page.waitForLoadState('networkidle');
|
|
66
|
+
|
|
67
|
+
await page.waitForSelector(data.locator);
|
|
68
|
+
|
|
69
|
+
await page.context().storageState({ path: authFile });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dev": {
|
|
3
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
4
|
+
"orgName": "org-name",
|
|
5
|
+
"deptName": "dept-name",
|
|
6
|
+
"moduleName": "module-name",
|
|
7
|
+
"devURL": "Provide your devURL here"
|
|
8
|
+
},
|
|
9
|
+
"prod": {
|
|
10
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
11
|
+
"orgName": "org-name",
|
|
12
|
+
"deptName": "dept-name",
|
|
13
|
+
"moduleName": "module-name"
|
|
14
|
+
},
|
|
15
|
+
"k8test": {
|
|
16
|
+
"domain": "https://desk.localzoho.com/agent",
|
|
17
|
+
"orgName": "org-name",
|
|
18
|
+
"deptName": "dept-name",
|
|
19
|
+
"moduleName": "module-name"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const testSetup = require('../../fixtures/testSetup');
|
|
2
1
|
/**
|
|
3
2
|
* @typedef {Object|null} viewportConfig
|
|
4
3
|
* @property {number} width - width of the viewport
|
|
@@ -41,6 +40,5 @@ module.exports = {
|
|
|
41
40
|
bddMode: true,
|
|
42
41
|
featureFilesFolder: 'feature-files',
|
|
43
42
|
stepDefinitionsFolder: 'steps',
|
|
44
|
-
viewport: { width: 1280, height: 720 }
|
|
45
|
-
testSetup
|
|
43
|
+
viewport: { width: 1280, height: 720 }
|
|
46
44
|
}
|
|
@@ -10,9 +10,8 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
10
10
|
var _logger = require("../utils/logger");
|
|
11
11
|
function getScriptsToBeAdded() {
|
|
12
12
|
return {
|
|
13
|
-
"uat": "ZDTestingFramework test --mode=
|
|
14
|
-
"uat-debug": "ZDTestingFramework test --mode=
|
|
15
|
-
"uat-validate": "ZDTestingFramework validate",
|
|
13
|
+
"uat": "ZDTestingFramework test --mode=prod --headed",
|
|
14
|
+
"uat-debug": "ZDTestingFramework test --mode=prod --debug",
|
|
16
15
|
"uat-report": "ZDTestingFramework report --port=9009",
|
|
17
16
|
"codegen": "ZDTestingFramework codegen deskclientapp.localzoho.com/agent"
|
|
18
17
|
};
|
|
@@ -72,11 +71,8 @@ function createAuthenticationFile() {
|
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
73
|
(0, _fs.writeFileSync)(_path.default.resolve(process.cwd(), 'uat', 'fixtures', 'auth.setup.js'), getSetupFileAsString('auth-setup-sample.js'), null, 2);
|
|
74
|
+
(0, _fs.writeFileSync)(_path.default.resolve(process.cwd(), 'uat', 'fixtures', 'authUsers.json'), getSetupFileAsString('authUsers-sample.json'), null, 2);
|
|
75
75
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Creating Authentication File ....');
|
|
76
|
-
(0, _fs.writeFileSync)(_path.default.resolve(process.cwd(), 'uat', 'fixtures', 'accountLogin.js'), getSetupFileAsString('accountLogin-sample.js'), null, 2);
|
|
77
|
-
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Creating login script File ....');
|
|
78
|
-
(0, _fs.writeFileSync)(_path.default.resolve(process.cwd(), 'uat', 'fixtures', 'testSetup.js'), getSetupFileAsString('testSetup-sample.js'), null, 2);
|
|
79
|
-
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Creating testSetup File ....');
|
|
80
76
|
} catch (err) {
|
|
81
77
|
_logger.Logger.error(err);
|
|
82
78
|
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Something went wrong ! Folder not Created. Please re-initialize npm init-uat');
|
|
@@ -88,21 +84,8 @@ function createAuthenticationFile() {
|
|
|
88
84
|
function createConfigJson() {
|
|
89
85
|
const uatFolder = _path.default.resolve(process.cwd(), 'uat');
|
|
90
86
|
if ((0, _fs.existsSync)(uatFolder)) {
|
|
91
|
-
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Creating
|
|
92
|
-
|
|
93
|
-
(0, _fs.mkdirSync)(_path.default.resolve(uatFolder, 'conf', 'default'), {
|
|
94
|
-
recursive: true
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
(0, _fs.writeFileSync)(_path.default.resolve(uatFolder, 'conf', 'default', './settings.json'), getSetupFileAsString('settings.json'), null, 2);
|
|
98
|
-
if (!(0, _fs.existsSync)(_path.default.resolve(uatFolder, 'conf', 'default', 'actors', 'editions'))) {
|
|
99
|
-
(0, _fs.mkdirSync)(_path.default.resolve(uatFolder, 'conf', 'default', 'actors', 'editions'), {
|
|
100
|
-
recursive: true
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
(0, _fs.writeFileSync)(_path.default.resolve(uatFolder, 'conf', 'default', 'actors', 'editions', 'free.json'), getSetupFileAsString('free-sample.json'), null, 2);
|
|
104
|
-
(0, _fs.writeFileSync)(_path.default.resolve(uatFolder, 'conf', 'default', 'actors', 'editions', 'index.js'), getSetupFileAsString('editions-index.js'), null, 2);
|
|
105
|
-
(0, _fs.writeFileSync)(_path.default.resolve(uatFolder, 'conf', 'default', 'actors', 'index.js'), getSetupFileAsString('actors-index.js'), null, 2);
|
|
87
|
+
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Creating env-config file inside UAT Folder');
|
|
88
|
+
(0, _fs.writeFileSync)(_path.default.resolve(uatFolder, './env-config.json'), getSetupFileAsString('env-config-sample.json'), null, 2);
|
|
106
89
|
} else {
|
|
107
90
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, 'Something went wrong. Please re-initialize the @zohodesk/testinglibrary');
|
|
108
91
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
var _tagProcessor = _interopRequireDefault(require("../../../../../src/core/playwright/tagProcessor"));
|
|
5
|
+
var _Configuration = _interopRequireDefault(require("../../../../../src/core/playwright/configuration/Configuration.js"));
|
|
5
6
|
var _logger = require("../../../../utils/logger");
|
|
6
7
|
jest.mock('../../../../utils/logger');
|
|
7
8
|
describe('TagProcessor', () => {
|
|
@@ -11,83 +12,83 @@ describe('TagProcessor', () => {
|
|
|
11
12
|
});
|
|
12
13
|
test('should return tagArgs if no edition is provided', () => {
|
|
13
14
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
14
|
-
const userArgs = {
|
|
15
|
+
const userArgs = new _Configuration.default({
|
|
15
16
|
tags: 'tag1',
|
|
16
17
|
edition: null
|
|
17
|
-
};
|
|
18
|
+
});
|
|
18
19
|
const result = tagProcessor.processTags(userArgs);
|
|
19
20
|
expect(result).toBe('tag1');
|
|
20
21
|
});
|
|
21
22
|
test('should handle a single edition with <= operator', () => {
|
|
22
23
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
23
|
-
const userArgs = {
|
|
24
|
+
const userArgs = new _Configuration.default({
|
|
24
25
|
tags: 'tag1',
|
|
25
26
|
edition: '<=edition2'
|
|
26
|
-
};
|
|
27
|
+
});
|
|
27
28
|
const result = tagProcessor.processTags(userArgs);
|
|
28
29
|
expect(result).toBe('tag1 and not (@edition_edition3 or @edition_edition4)');
|
|
29
30
|
});
|
|
30
31
|
test('should handle a single edition with >= operator', () => {
|
|
31
32
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
32
|
-
const userArgs = {
|
|
33
|
+
const userArgs = new _Configuration.default({
|
|
33
34
|
tags: 'tag1',
|
|
34
35
|
edition: '>=edition2'
|
|
35
|
-
};
|
|
36
|
+
});
|
|
36
37
|
const result = tagProcessor.processTags(userArgs);
|
|
37
38
|
expect(result).toBe('tag1 and not (@edition_edition1)');
|
|
38
39
|
});
|
|
39
40
|
test('should handle a single edition with < operator', () => {
|
|
40
41
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
41
|
-
const userArgs = {
|
|
42
|
+
const userArgs = new _Configuration.default({
|
|
42
43
|
tags: 'tag1',
|
|
43
44
|
edition: '<edition3'
|
|
44
|
-
};
|
|
45
|
+
});
|
|
45
46
|
const result = tagProcessor.processTags(userArgs);
|
|
46
47
|
expect(result).toBe('tag1 and not (@edition_edition3 or @edition_edition4)');
|
|
47
48
|
});
|
|
48
49
|
test('should handle a single edition with > operator', () => {
|
|
49
50
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
50
|
-
const userArgs = {
|
|
51
|
+
const userArgs = new _Configuration.default({
|
|
51
52
|
tags: 'tag1',
|
|
52
53
|
edition: '>edition1'
|
|
53
|
-
};
|
|
54
|
+
});
|
|
54
55
|
const result = tagProcessor.processTags(userArgs);
|
|
55
56
|
expect(result).toBe('tag1 and not (@edition_edition1)');
|
|
56
57
|
});
|
|
57
58
|
test('should handle a single edition with no operator', () => {
|
|
58
59
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
59
|
-
const userArgs = {
|
|
60
|
+
const userArgs = new _Configuration.default({
|
|
60
61
|
tags: 'tag1',
|
|
61
62
|
edition: 'edition2'
|
|
62
|
-
};
|
|
63
|
+
});
|
|
63
64
|
const result = tagProcessor.processTags(userArgs);
|
|
64
65
|
expect(result).toBe('tag1 and not (@edition_edition1 or @edition_edition3 or @edition_edition4)');
|
|
65
66
|
});
|
|
66
67
|
test('should log a message if edition is not found', () => {
|
|
67
68
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
68
|
-
const userArgs = {
|
|
69
|
+
const userArgs = new _Configuration.default({
|
|
69
70
|
tags: 'tag1',
|
|
70
71
|
edition: 'nonexistentEdition'
|
|
71
|
-
};
|
|
72
|
+
});
|
|
72
73
|
const result = tagProcessor.processTags(userArgs);
|
|
73
74
|
expect(result).toBe('tag1');
|
|
74
75
|
expect(_logger.Logger.log).toHaveBeenCalledWith(_logger.Logger.INFO_TYPE, expect.stringContaining('No matching editions for nonexistentEdition found.'));
|
|
75
76
|
});
|
|
76
77
|
test('should handle multiple editions', () => {
|
|
77
78
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
78
|
-
const userArgs = {
|
|
79
|
+
const userArgs = new _Configuration.default({
|
|
79
80
|
tags: 'tag1',
|
|
80
81
|
edition: 'edition1,edition3'
|
|
81
|
-
};
|
|
82
|
+
});
|
|
82
83
|
const result = tagProcessor.processTags(userArgs);
|
|
83
84
|
expect(result).toBe('tag1 and not (@edition_edition2 or @edition_edition4)');
|
|
84
85
|
});
|
|
85
86
|
test('should build tags correctly when tags are empty', () => {
|
|
86
87
|
const tagProcessor = new _tagProcessor.default(editionOrder);
|
|
87
|
-
const userArgs = {
|
|
88
|
+
const userArgs = new _Configuration.default({
|
|
88
89
|
tags: '',
|
|
89
90
|
edition: 'edition1'
|
|
90
|
-
};
|
|
91
|
+
});
|
|
91
92
|
const result = tagProcessor.processTags(userArgs);
|
|
92
93
|
expect(result).toBe('not (@edition_edition2 or @edition_edition3 or @edition_edition4)');
|
|
93
94
|
});
|
|
@@ -24,7 +24,7 @@ describe('getUATFileName', () => {
|
|
|
24
24
|
});
|
|
25
25
|
test('return the default config files for pipeline matched files not exists', () => {
|
|
26
26
|
const mode = 'ci';
|
|
27
|
-
const defaultPath = `${mockCwd}/uat
|
|
27
|
+
const defaultPath = `${mockCwd}/uat.config.js`;
|
|
28
28
|
_fs.existsSync.mockReturnValue(false);
|
|
29
29
|
_path.default.resolve.mockImplementation((...args) => args.join('/'));
|
|
30
30
|
const result = (0, _configFileNameProvider.getUATFileName)(mode);
|