@zohodesk/testinglibrary 0.1.6-exp.2 → 0.1.6-exp.3
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.
|
@@ -104,6 +104,17 @@ const test = exports.test = base.extend({
|
|
|
104
104
|
}, use) => {
|
|
105
105
|
await use(cacheMap);
|
|
106
106
|
},
|
|
107
|
+
addTags: [async ({
|
|
108
|
+
$tags
|
|
109
|
+
}, use, testInfo) => {
|
|
110
|
+
testInfo.annotations.push({
|
|
111
|
+
type: 'tags',
|
|
112
|
+
description: $tags.join(', ')
|
|
113
|
+
});
|
|
114
|
+
await use();
|
|
115
|
+
}, {
|
|
116
|
+
auto: true
|
|
117
|
+
}],
|
|
107
118
|
...additionalPages
|
|
108
119
|
});
|
|
109
120
|
const {
|
|
@@ -10,6 +10,7 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
10
10
|
var _logger = require("../../utils/logger");
|
|
11
11
|
var _rootPath = require("../../utils/rootPath");
|
|
12
12
|
var _readConfigFile = require("./readConfigFile");
|
|
13
|
+
var _reportAlteration = require("../../setup-folder-structure/reportEnhancement/reportAlteration");
|
|
13
14
|
const userArgs = process.argv.slice(3);
|
|
14
15
|
const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
|
|
15
16
|
const command = playwrightPath;
|
|
@@ -17,7 +18,8 @@ const {
|
|
|
17
18
|
reportPath: htmlPath
|
|
18
19
|
} = (0, _readConfigFile.generateConfigFromFile)();
|
|
19
20
|
const args = ['show-report', htmlPath].concat(userArgs);
|
|
20
|
-
function generateReport() {
|
|
21
|
+
async function generateReport() {
|
|
22
|
+
// await preProcessReport()
|
|
21
23
|
const childProcess = (0, _child_process.spawn)(command, args, {
|
|
22
24
|
stdio: 'inherit'
|
|
23
25
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
function sortEdition(event) {
|
|
3
|
+
var currentURL = window.location.href;
|
|
4
|
+
const endPointCount = window.location.href.indexOf('#');
|
|
5
|
+
if (!(endPointCount == -1)) {
|
|
6
|
+
window.history.pushState({}, '', currentURL.slice(0, endPointCount));
|
|
7
|
+
currentURL = currentURL.slice(0, endPointCount);
|
|
8
|
+
}
|
|
9
|
+
console.log(currentURL);
|
|
10
|
+
window.open(`${currentURL}#?q=@edition_${event.target.value}`, '_self');
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
<div class="mainContainer" style="margin-left: 20px; display: flex;">
|
|
14
|
+
<div class="selectEditionContainer" style="padding: 20px;">
|
|
15
|
+
<select class="selectEdition" style="padding: 5px; width: 100px; border-radius: 6px; border: 1px solid var(--color-border-default);" onchange="sortEdition(event)">
|
|
16
|
+
<option value="EnterPrise">EnterPrise</option>
|
|
17
|
+
<option value="Professional">Professional</option>
|
|
18
|
+
<option value="Express">Express</option>
|
|
19
|
+
<option value="Standard">Standard</option>
|
|
20
|
+
<option value="Free">Free</option>
|
|
21
|
+
</select>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.preProcessReport = preProcessReport;
|
|
8
|
+
var _fs = _interopRequireDefault(require("fs"));
|
|
9
|
+
var _logger = require("./../../utils/logger");
|
|
10
|
+
var _path = _interopRequireDefault(require("path"));
|
|
11
|
+
const htmlFilePath = _path.default.resolve(process.cwd(), 'uat', 'playwright-report', 'index.html');
|
|
12
|
+
const fileHtml = _fs.default.readFileSync(htmlFilePath, 'utf-8');
|
|
13
|
+
const addOnHtml = _fs.default.readFileSync(_path.default.resolve(__filename, '../', 'addonScript.html'), 'utf-8');
|
|
14
|
+
const splitedHTML = fileHtml.split('\n');
|
|
15
|
+
const toAdd = addOnHtml.split('\n');
|
|
16
|
+
function preProcessReport() {
|
|
17
|
+
if (_fs.default.existsSync(htmlFilePath)) {
|
|
18
|
+
const modifiedContent = [...splitedHTML.slice(0, 55), ...toAdd, ...splitedHTML.slice(56)].join('').toString();
|
|
19
|
+
_fs.default.writeFileSync(htmlFilePath, modifiedContent);
|
|
20
|
+
return;
|
|
21
|
+
} else {
|
|
22
|
+
_logger.Logger.log(_logger.Logger.FAILURE_TYPE, 'Report is not generated Properly ...');
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|