@zohodesk/testinglibrary 0.5.12-n18-experimental → 0.5.13-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 +27 -25
- package/build/common/searchFake/steps/searchFake.spec.js +3 -3
- package/build/core/playwright/clear-caches.js +2 -5
- package/build/core/playwright/constants/configConstants.js +6 -3
- package/build/core/playwright/constants/reporterConstants.js +2 -6
- package/build/core/playwright/helpers/auth/index.js +1 -8
- package/build/core/playwright/helpers/thirdPartyLib.js +13 -0
- package/build/core/playwright/readConfigFile.js +3 -5
- package/build/core/playwright/setup/ProjectConfiguration.js +26 -9
- package/build/core/playwright/setup/config-creator.js +5 -8
- package/build/core/playwright/setup/config-utils.js +3 -7
- package/build/core/playwright/setup/qc-custom-reporter.js +1 -4
- package/build/core/playwright/test-runner.js +4 -0
- package/build/index.js +0 -6
- package/build/test/Test.js +13 -0
- package/build/utils/commonUtils.js +1 -4
- package/npm-shrinkwrap.json +123 -717
- package/package.json +5 -3
- package/playwright.config.js +7 -10
package/.gitlab-ci.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
image:
|
|
1
|
+
image: zdesk-auto13.csez.zohocorpin.com/long-term-storage/node18-npm10:v2
|
|
2
2
|
|
|
3
3
|
workflow:
|
|
4
4
|
rules:
|
|
@@ -55,7 +55,7 @@ uat-auth:
|
|
|
55
55
|
artifacts:
|
|
56
56
|
when: always
|
|
57
57
|
paths:
|
|
58
|
-
- examples/
|
|
58
|
+
- examples/uat/playwright-report
|
|
59
59
|
|
|
60
60
|
uat-noauth:
|
|
61
61
|
stage: uat
|
|
@@ -69,7 +69,7 @@ uat-noauth:
|
|
|
69
69
|
artifacts:
|
|
70
70
|
when: always
|
|
71
71
|
paths:
|
|
72
|
-
- examples/
|
|
72
|
+
- examples/uat/playwright-report
|
|
73
73
|
|
|
74
74
|
uat-profile:
|
|
75
75
|
stage: uat
|
|
@@ -83,7 +83,7 @@ uat-profile:
|
|
|
83
83
|
artifacts:
|
|
84
84
|
when: always
|
|
85
85
|
paths:
|
|
86
|
-
- examples/
|
|
86
|
+
- examples/uat/playwright-report
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
uat-unauth:
|
|
@@ -99,7 +99,7 @@ uat-unauth:
|
|
|
99
99
|
artifacts:
|
|
100
100
|
when: always
|
|
101
101
|
paths:
|
|
102
|
-
- examples/
|
|
102
|
+
- examples/uat/playwright-report
|
|
103
103
|
|
|
104
104
|
uat-nobdd:
|
|
105
105
|
stage: uat
|
|
@@ -114,7 +114,7 @@ uat-nobdd:
|
|
|
114
114
|
artifacts:
|
|
115
115
|
when: always
|
|
116
116
|
paths:
|
|
117
|
-
- nobdd/
|
|
117
|
+
- nobdd/uat/playwright-report
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
uatmodule:
|
|
@@ -130,7 +130,7 @@ uatmodule:
|
|
|
130
130
|
artifacts:
|
|
131
131
|
when: always
|
|
132
132
|
paths:
|
|
133
|
-
- examples/
|
|
133
|
+
- examples/uat/playwright-report
|
|
134
134
|
|
|
135
135
|
uatconfigmodule:
|
|
136
136
|
stage: uat
|
|
@@ -144,7 +144,7 @@ uatconfigmodule:
|
|
|
144
144
|
artifacts:
|
|
145
145
|
when: always
|
|
146
146
|
paths:
|
|
147
|
-
- examples/
|
|
147
|
+
- examples/uat/playwright-report
|
|
148
148
|
|
|
149
149
|
uat-smoketest:
|
|
150
150
|
stage: uat
|
|
@@ -158,7 +158,7 @@ uat-smoketest:
|
|
|
158
158
|
artifacts:
|
|
159
159
|
when: always
|
|
160
160
|
paths:
|
|
161
|
-
- examples/
|
|
161
|
+
- examples/uat/playwright-report
|
|
162
162
|
|
|
163
163
|
uat-multiactor:
|
|
164
164
|
stage: uat
|
|
@@ -172,7 +172,7 @@ uat-multiactor:
|
|
|
172
172
|
artifacts:
|
|
173
173
|
when: always
|
|
174
174
|
paths:
|
|
175
|
-
- examples/
|
|
175
|
+
- examples/uat/playwright-report
|
|
176
176
|
|
|
177
177
|
uat-data_generator:
|
|
178
178
|
stage: uat
|
|
@@ -186,21 +186,23 @@ uat-data_generator:
|
|
|
186
186
|
artifacts:
|
|
187
187
|
when: always
|
|
188
188
|
paths:
|
|
189
|
-
- examples/
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
189
|
+
- examples/uat/playwright-report
|
|
190
|
+
|
|
191
|
+
uat-search_indexing:
|
|
192
|
+
stage: uat
|
|
193
|
+
script:
|
|
194
|
+
- cd examples
|
|
195
|
+
- npm install $(npm pack ../../testing-framework | tail -1)
|
|
196
|
+
- echo "Removing jsonpath from examples/node_modules to avoid conflicts"
|
|
197
|
+
- rm -rf node_modules/jsonpath || true
|
|
198
|
+
- output=$(npm run uat-search_indexing)
|
|
199
|
+
- echo "$output"
|
|
200
|
+
- node ../ValidateUATReport.js examples
|
|
201
|
+
|
|
202
|
+
artifacts:
|
|
203
|
+
when: always
|
|
204
|
+
paths:
|
|
205
|
+
- examples/uat/playwright-report
|
|
204
206
|
|
|
205
207
|
|
|
206
208
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {createBdd
|
|
1
|
+
import {createBdd} from '@zohodesk/testinglibrary';
|
|
2
|
+
import { jsonpath } from '@zohodesk/testinglibrary/thirdPartyHelper';
|
|
2
3
|
import { executeRpcRequest , entityIdReConstructor } from '../helpers/rpcRequestHelper';
|
|
3
|
-
// import jp from 'jsonpath';
|
|
4
4
|
|
|
5
5
|
const { Given } = createBdd();
|
|
6
6
|
|
|
@@ -54,7 +54,7 @@ Given('a search entity using {string}', async ({page,cacheLayer}, reference,data
|
|
|
54
54
|
entityIdValue = searchObj;
|
|
55
55
|
} else {
|
|
56
56
|
const jsonPath = searchEntity?.startsWith?.('$') ? searchEntity : `$.${searchEntity}`;
|
|
57
|
-
const result =
|
|
57
|
+
const result = jsonpath.query(searchObj, jsonPath);
|
|
58
58
|
|
|
59
59
|
if (!result || result.length === 0) {
|
|
60
60
|
throw new Error(`JSONPath query '${jsonPath}' returned no results from cache object for reference: ${reference}`);
|
|
@@ -10,9 +10,6 @@ var _fileUtils = require("../../utils/fileUtils");
|
|
|
10
10
|
var _logger = require("../../utils/logger");
|
|
11
11
|
var _readConfigFile = require("./readConfigFile");
|
|
12
12
|
var _checkAuthDirectory = require("./helpers/checkAuthDirectory");
|
|
13
|
-
var _configConstants = _interopRequireDefault(require("./constants/configConstants"));
|
|
14
|
-
var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
|
|
15
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
16
13
|
function deleteAuthFiles(authFilePath) {
|
|
17
14
|
authFilePath = _path.default.resolve(process.cwd(), authFilePath);
|
|
18
15
|
const authFileFolder = _path.default.dirname(authFilePath);
|
|
@@ -24,7 +21,7 @@ function deletePlaywrightReport(reportPath) {
|
|
|
24
21
|
(0, _fileUtils.deleteFolder)(reportPath);
|
|
25
22
|
}
|
|
26
23
|
function deleteGeneratedFeatures() {
|
|
27
|
-
const featuresGenPath = _path.default.resolve(process.cwd(),
|
|
24
|
+
const featuresGenPath = _path.default.resolve(process.cwd(), 'uat', '.features-gen');
|
|
28
25
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Deleting generated features at ${featuresGenPath}`);
|
|
29
26
|
(0, _fileUtils.deleteFolder)(featuresGenPath);
|
|
30
27
|
}
|
|
@@ -46,7 +43,7 @@ function clearCaches() {
|
|
|
46
43
|
_logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Caches Cleared. Now you can try running npm run uat');
|
|
47
44
|
} catch (err) {
|
|
48
45
|
_logger.Logger.error(err);
|
|
49
|
-
_logger.Logger.log(_logger.Logger.FAILURE_TYPE,
|
|
46
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Error While clearing cookies. Try manually delete folder uat/playwright and uat/playwright-report');
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
var _default = exports.default = clearCaches;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
3
7
|
class configConstants {
|
|
4
8
|
static DEFAULT_CONFIG_DIR = 'default';
|
|
5
9
|
static BETA_DIR = 'beta';
|
|
@@ -8,7 +12,6 @@ class configConstants {
|
|
|
8
12
|
static INDEX_FILE = 'index.js';
|
|
9
13
|
static SETTINGS_FILE = 'settings.json';
|
|
10
14
|
static TEST_SUMMARY_FILE = 'test-summary.json';
|
|
11
|
-
static STAGE_CONFIG_MAP_FILE = '
|
|
12
|
-
static TEST_SLICE_FOLDER = 'test-slices';
|
|
15
|
+
static STAGE_CONFIG_MAP_FILE = 'uat/conf_path_map.properties';
|
|
13
16
|
}
|
|
14
|
-
|
|
17
|
+
exports.default = configConstants;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _configConstants = _interopRequireDefault(require("./configConstants"));
|
|
9
|
-
var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
|
|
10
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
11
7
|
class ReporterConstants {
|
|
12
|
-
static DEFAULT_REPORTER_PATH =
|
|
13
|
-
static LAST_RUN_REPORTER_PATH =
|
|
8
|
+
static DEFAULT_REPORTER_PATH = 'uat/test-results/playwright-test-results.json';
|
|
9
|
+
static LAST_RUN_REPORTER_PATH = 'uat/test-results/.last-run.json';
|
|
14
10
|
}
|
|
15
11
|
exports.default = ReporterConstants;
|
|
@@ -34,12 +34,6 @@ Object.defineProperty(exports, "getRunMode", {
|
|
|
34
34
|
return _getUsers.getRunMode;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
-
Object.defineProperty(exports, "getRunStage", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return _ConfigurationHelper.getRunStage;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
37
|
Object.defineProperty(exports, "getUserForSelectedEditionAndProfile", {
|
|
44
38
|
enumerable: true,
|
|
45
39
|
get: function () {
|
|
@@ -79,5 +73,4 @@ Object.defineProperty(exports, "verifyIfCookieFileExists", {
|
|
|
79
73
|
var _accountLogin = _interopRequireDefault(require("./accountLogin"));
|
|
80
74
|
var _checkAuthCookies = require("./checkAuthCookies");
|
|
81
75
|
var _getUsers = require("./getUsers");
|
|
82
|
-
var _loginSteps = _interopRequireDefault(require("./loginSteps"));
|
|
83
|
-
var _ConfigurationHelper = require("../../configuration/ConfigurationHelper");
|
|
76
|
+
var _loginSteps = _interopRequireDefault(require("./loginSteps"));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "jsonpath", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _jsonpath.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _jsonpath = _interopRequireDefault(require("jsonpath"));
|
|
@@ -16,13 +16,11 @@ var _mergeObjects = require("./helpers/mergeObjects");
|
|
|
16
16
|
var _Configuration = _interopRequireDefault(require("./configuration/Configuration"));
|
|
17
17
|
var _UserArgs = _interopRequireDefault(require("./configuration/UserArgs"));
|
|
18
18
|
var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
|
|
19
|
-
var _configConstants = _interopRequireDefault(require("./constants/configConstants"));
|
|
20
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
21
19
|
let cachedConfig = null;
|
|
22
20
|
function getDefaultConfig() {
|
|
23
21
|
return {
|
|
24
22
|
isTearDown: true,
|
|
25
|
-
uatDirectory: _path.default.join(process.cwd(),
|
|
23
|
+
uatDirectory: _path.default.join(process.cwd(), 'uat'),
|
|
26
24
|
headless: false,
|
|
27
25
|
browsers: ['Chrome'],
|
|
28
26
|
forbidOnly: false,
|
|
@@ -31,11 +29,11 @@ function getDefaultConfig() {
|
|
|
31
29
|
video: false,
|
|
32
30
|
isAuthMode: false,
|
|
33
31
|
openReportOn: 'never',
|
|
34
|
-
reportPath: _path.default.join(process.cwd(),
|
|
32
|
+
reportPath: _path.default.join(process.cwd(), 'uat', 'playwright-report'),
|
|
35
33
|
bddMode: false,
|
|
36
34
|
expectTimeout: 5 * 1000,
|
|
37
35
|
testTimeout: 60 * 1000,
|
|
38
|
-
authFilePath:
|
|
36
|
+
authFilePath: 'uat/playwright/.auth/user.json',
|
|
39
37
|
viewport: {
|
|
40
38
|
width: 1280,
|
|
41
39
|
height: 720
|
|
@@ -11,9 +11,6 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
11
11
|
var _Project = require("./Project");
|
|
12
12
|
var _configUtils = require("./config-utils");
|
|
13
13
|
var _readConfigFile = require("../readConfigFile");
|
|
14
|
-
var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
|
|
15
|
-
var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
|
|
16
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
17
14
|
const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
|
|
18
15
|
const {
|
|
19
16
|
isAuthMode,
|
|
@@ -28,7 +25,7 @@ const {
|
|
|
28
25
|
function setupConfig() {
|
|
29
26
|
const setupProject = new _Project.Project('setup');
|
|
30
27
|
setupProject.setTestMatch(/.*\.setup\.js/);
|
|
31
|
-
setupProject.setTestDir(_path.default.join(process.cwd(),
|
|
28
|
+
setupProject.setTestDir(_path.default.join(process.cwd(), 'uat'));
|
|
32
29
|
const isTearDown = JSON.parse(process.env.tearDown);
|
|
33
30
|
setupProject.setTearDown(isTearDown ? 'cleanup' : '');
|
|
34
31
|
const setupProjectConfig = [setupProject.getProperties()];
|
|
@@ -37,10 +34,10 @@ function setupConfig() {
|
|
|
37
34
|
function smokeTestConfig() {
|
|
38
35
|
const smokeTestProject = new _Project.Project('smokeTest');
|
|
39
36
|
const smokeTestDir = (0, _configUtils.getTestDir)(bddMode, {
|
|
40
|
-
featureFilesFolder: _path.default.join(process.cwd(),
|
|
41
|
-
stepDefinitionsFolder: _path.default.join(process.cwd(),
|
|
42
|
-
outputDir: _path.default.join(process.cwd(),
|
|
43
|
-
uatPath: _path.default.join(process.cwd(),
|
|
37
|
+
featureFilesFolder: _path.default.join(process.cwd(), 'uat', 'smokeTest', '**', '*.feature'),
|
|
38
|
+
stepDefinitionsFolder: _path.default.join(process.cwd(), 'uat', '**', 'steps', '*.spec.js'),
|
|
39
|
+
outputDir: _path.default.join(process.cwd(), 'uat', '.features-smoke-gen'),
|
|
40
|
+
uatPath: _path.default.join(process.cwd(), 'uat', 'smokeTest')
|
|
44
41
|
});
|
|
45
42
|
const commonConfig = {
|
|
46
43
|
storageState: isAuthMode ? (0, _readConfigFile.getAuthFilePath)(_path.default.resolve(process.cwd(), authFilePath)) : {}
|
|
@@ -54,10 +51,30 @@ function smokeTestConfig() {
|
|
|
54
51
|
const smokeTestProjectConfig = [smokeTestProject.getProperties()];
|
|
55
52
|
return smokeTestProjectConfig;
|
|
56
53
|
}
|
|
54
|
+
function defaultConfig() {
|
|
55
|
+
const defaultProject = new _Project.Project('default');
|
|
56
|
+
const testDir = (0, _configUtils.getTestDir)(bddMode, {
|
|
57
|
+
featureFilesFolder: (0, _configUtils.getPathsForFeatureFiles)(process.cwd()),
|
|
58
|
+
stepDefinitionsFolder: _path.default.join(process.cwd(), 'uat', '**', 'steps', '*.spec.js'),
|
|
59
|
+
outputDir: _path.default.join(process.cwd(), 'uat', '.features-gen'),
|
|
60
|
+
uatPath: _path.default.join(process.cwd(), 'uat')
|
|
61
|
+
});
|
|
62
|
+
const use = {
|
|
63
|
+
trace,
|
|
64
|
+
video,
|
|
65
|
+
viewport,
|
|
66
|
+
testIdAttribute
|
|
67
|
+
};
|
|
68
|
+
defaultProject.setUse(use);
|
|
69
|
+
defaultProject.setTestDir(testDir);
|
|
70
|
+
defaultProject.setDependencies(isSmokeTest ? ['smokeTest'] : []);
|
|
71
|
+
const defaultProjectConfig = [defaultProject.getProperties()];
|
|
72
|
+
return defaultProjectConfig;
|
|
73
|
+
}
|
|
57
74
|
function cleanupConfig() {
|
|
58
75
|
const cleanupProject = new _Project.Project('cleanup');
|
|
59
76
|
cleanupProject.setTestMatch(/.*\.teardown\.js/);
|
|
60
|
-
cleanupProject.setTestDir(_path.default.join(process.cwd(),
|
|
77
|
+
cleanupProject.setTestDir(_path.default.join(process.cwd(), 'uat'));
|
|
61
78
|
const cleanupProjectConfig = [cleanupProject.getProperties()];
|
|
62
79
|
return cleanupProjectConfig;
|
|
63
80
|
}
|
|
@@ -10,10 +10,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
10
10
|
var _readConfigFile = require("../readConfigFile");
|
|
11
11
|
var _configUtils = require("./config-utils");
|
|
12
12
|
var _ProjectConfiguration = require("./ProjectConfiguration");
|
|
13
|
-
var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
|
|
14
|
-
var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
|
|
15
13
|
const uatConfig = (0, _readConfigFile.generateConfigFromFile)();
|
|
16
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
17
14
|
const {
|
|
18
15
|
bddMode,
|
|
19
16
|
browsers,
|
|
@@ -44,7 +41,7 @@ let reporter = [['html', {
|
|
|
44
41
|
outputFolder: reportPath,
|
|
45
42
|
open: openReportOn
|
|
46
43
|
}], ['list'], ['json', {
|
|
47
|
-
outputFile: _path.default.join(process.cwd(),
|
|
44
|
+
outputFile: _path.default.join(process.cwd(), 'uat', 'test-results', 'playwright-test-results.json')
|
|
48
45
|
}], ['./custom-reporter.js'], ['./qc-custom-reporter.js']];
|
|
49
46
|
if (customReporter) {
|
|
50
47
|
reporter = [customReporter, ...reporter];
|
|
@@ -64,9 +61,9 @@ const use = {
|
|
|
64
61
|
};
|
|
65
62
|
const testDir = (0, _configUtils.getTestDir)(bddMode, {
|
|
66
63
|
featureFilesFolder: (0, _configUtils.getPathsForFeatureFiles)(process.cwd()),
|
|
67
|
-
stepDefinitionsFolder: _path.default.join(process.cwd(),
|
|
68
|
-
outputDir: _path.default.join(process.cwd(),
|
|
69
|
-
uatPath: _path.default.join(process.cwd(),
|
|
64
|
+
stepDefinitionsFolder: _path.default.join(process.cwd(), 'uat', '**', 'steps', '*.spec.js'),
|
|
65
|
+
outputDir: _path.default.join(process.cwd(), 'uat', '.features-gen'),
|
|
66
|
+
uatPath: _path.default.join(process.cwd(), 'uat')
|
|
70
67
|
});
|
|
71
68
|
function getPlaywrightConfig() {
|
|
72
69
|
const smokeTestProject = isSmokeTest ? (0, _ProjectConfiguration.smokeTestConfig)() : [];
|
|
@@ -76,7 +73,7 @@ function getPlaywrightConfig() {
|
|
|
76
73
|
const playwrightConfig = {
|
|
77
74
|
testDir,
|
|
78
75
|
globalTimeout: globalTimeout || 3600000,
|
|
79
|
-
outputDir: _path.default.join(process.cwd(),
|
|
76
|
+
outputDir: _path.default.join(process.cwd(), 'uat', 'test-results'),
|
|
80
77
|
fullyParallel: true,
|
|
81
78
|
reporter,
|
|
82
79
|
timeout: testTimeout,
|
|
@@ -16,14 +16,11 @@ var _playwrightBdd = require("playwright-bdd");
|
|
|
16
16
|
var _logger = require("../../../utils/logger");
|
|
17
17
|
var _browserTypes = require("../constants/browserTypes");
|
|
18
18
|
var _fileUtils = require("../../../utils/fileUtils");
|
|
19
|
-
var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
|
|
20
|
-
var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
|
|
21
19
|
/**
|
|
22
20
|
** Playwright project configuration
|
|
23
21
|
* @returns {import('@playwright/test').Project}
|
|
24
22
|
*/
|
|
25
23
|
|
|
26
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
27
24
|
function getBrowserConfig({
|
|
28
25
|
browserName,
|
|
29
26
|
isAuthMode,
|
|
@@ -145,8 +142,7 @@ function getPathsForFeatureFiles(cwd) {
|
|
|
145
142
|
const {
|
|
146
143
|
failed = []
|
|
147
144
|
} = JSON.parse(testSummary);
|
|
148
|
-
const casesToRun = failed.map(filePath => _path.default.join(cwd,
|
|
149
|
-
;
|
|
145
|
+
const casesToRun = failed.map(filePath => _path.default.join(cwd, 'uat', filePath.replace(/\.spec\.js$|\.js$/, '')));
|
|
150
146
|
return casesToRun;
|
|
151
147
|
} else {
|
|
152
148
|
_logger.Logger.log(_logger.Logger.INFO_TYPE, `Unable to read test summary from the ${reportPath}. Verify If File Exists in the path`);
|
|
@@ -157,12 +153,12 @@ function getPathsForFeatureFiles(cwd) {
|
|
|
157
153
|
let moduleList = modules.split(',');
|
|
158
154
|
return getModulePathForFeatureFiles(moduleList);
|
|
159
155
|
}
|
|
160
|
-
return [_path.default.join(cwd,
|
|
156
|
+
return [_path.default.join(cwd, 'uat', 'modules', '**', '*.feature')];
|
|
161
157
|
}
|
|
162
158
|
function getModulePathForFeatureFiles(moduleList) {
|
|
163
159
|
let validModuleList = [];
|
|
164
160
|
moduleList.forEach(moduleName => {
|
|
165
|
-
let modulePath = _path.default.join(process.cwd(),
|
|
161
|
+
let modulePath = _path.default.join(process.cwd(), 'uat', 'modules', '**', `${moduleName}`);
|
|
166
162
|
if ((0, _fileUtils.checkIfFolderExistsWithPattern)(modulePath)) {
|
|
167
163
|
validModuleList.push(_path.default.join(modulePath, '**', '*.feature'));
|
|
168
164
|
} else {
|
|
@@ -8,14 +8,11 @@ exports.default = void 0;
|
|
|
8
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
9
9
|
var _path = _interopRequireDefault(require("path"));
|
|
10
10
|
var _codeFrame = require("@babel/code-frame");
|
|
11
|
-
var _configConstants = _interopRequireDefault(require("../constants/configConstants"));
|
|
12
|
-
var _ConfigurationHelper = require("../configuration/ConfigurationHelper");
|
|
13
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
14
11
|
class CustomJsonReporter {
|
|
15
12
|
constructor({
|
|
16
13
|
outputFile = 'test-results.json'
|
|
17
14
|
} = {}) {
|
|
18
|
-
this.outputFile = _path.default.resolve(process.cwd(),
|
|
15
|
+
this.outputFile = _path.default.resolve(process.cwd(), 'uat/test-results/', outputFile);
|
|
19
16
|
this.rootSuite = null;
|
|
20
17
|
this.report = {
|
|
21
18
|
config: {},
|
|
@@ -8,11 +8,15 @@ exports.default = void 0;
|
|
|
8
8
|
exports.runPreprocessing = runPreprocessing;
|
|
9
9
|
var _child_process = require("child_process");
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
|
+
var _customCommands = require("./custom-commands");
|
|
12
|
+
var _cliArgsToObject = require("../../utils/cliArgsToObject");
|
|
11
13
|
var _envInitializer = require("./env-initializer");
|
|
12
14
|
var _logger = require("../../utils/logger");
|
|
13
15
|
var _readConfigFile = require("./readConfigFile");
|
|
14
16
|
var _rootPath = require("../../utils/rootPath");
|
|
15
17
|
var _tagProcessor = _interopRequireDefault(require("./tagProcessor"));
|
|
18
|
+
var _configUtils = require("./setup/config-utils");
|
|
19
|
+
var _browserTypes = require("./constants/browserTypes");
|
|
16
20
|
var _ConfigurationHelper = require("./configuration/ConfigurationHelper");
|
|
17
21
|
var _Configuration = _interopRequireDefault(require("./configuration/Configuration"));
|
|
18
22
|
var _UserArgs = _interopRequireDefault(require("./configuration/UserArgs"));
|
package/build/index.js
CHANGED
|
@@ -40,12 +40,6 @@ Object.defineProperty(exports, "getRunMode", {
|
|
|
40
40
|
return _index.getRunMode;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
|
-
Object.defineProperty(exports, "getRunStage", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _index.getRunStage;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
43
|
Object.defineProperty(exports, "getUserForSelectedEditionAndProfile", {
|
|
50
44
|
enumerable: true,
|
|
51
45
|
get: function () {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
delete require.cache[require.resolve('../core/playwright/runner/Runner')];
|
|
4
|
+
function test() {
|
|
5
|
+
const inputString = "@hc";
|
|
6
|
+
const selectedTag = ["@hc_1234"].reverse().find(tag => tag.startsWith(inputString));
|
|
7
|
+
let tagInput = null;
|
|
8
|
+
if (selectedTag) {
|
|
9
|
+
tagInput = selectedTag.split(`${inputString}_`).pop().toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
console.log(tagInput);
|
|
12
|
+
}
|
|
13
|
+
test();
|
|
@@ -7,14 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.copyCommonSpecs = copyCommonSpecs;
|
|
8
8
|
var _fileUtils = require("./fileUtils");
|
|
9
9
|
var _path = _interopRequireDefault(require("path"));
|
|
10
|
-
var _configConstants = _interopRequireDefault(require("../core/playwright/constants/configConstants"));
|
|
11
|
-
var _ConfigurationHelper = require("../core/playwright/configuration/ConfigurationHelper");
|
|
12
|
-
const stage = (0, _ConfigurationHelper.getRunStage)();
|
|
13
10
|
function copyCommonSpecs() {
|
|
14
11
|
const libraryPath = require.resolve("@zohodesk/testinglibrary");
|
|
15
12
|
// libraryPath will be build/index.js to go to the common specs we need to go one level up
|
|
16
13
|
const commonSpecPath = _path.default.resolve(libraryPath, '../', 'common');
|
|
17
|
-
const destDirectory = _path.default.resolve(process.cwd(),
|
|
14
|
+
const destDirectory = _path.default.resolve(process.cwd(), 'uat', 'modules', '.testingLib-common');
|
|
18
15
|
(0, _fileUtils.deleteFolder)(destDirectory);
|
|
19
16
|
(0, _fileUtils.copyDirectory)(commonSpecPath, destDirectory);
|
|
20
17
|
}
|