testbeats 2.1.1 → 2.1.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testbeats",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Publish test results to Microsoft Teams, Google Chat, Slack and InfluxDB",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"pretty-ms": "^7.0.1",
|
|
56
56
|
"rosters": "0.0.1",
|
|
57
57
|
"sade": "^1.8.1",
|
|
58
|
-
"test-results-parser": "0.2.
|
|
58
|
+
"test-results-parser": "0.2.5"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"c8": "^7.12.0",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { BaseExtension } = require('./base.extension');
|
|
2
2
|
const { STATUS, HOOK } = require("../helpers/constants");
|
|
3
|
+
const { truncate } = require('../helpers/helper');
|
|
3
4
|
|
|
4
5
|
class ErrorClustersExtension extends BaseExtension {
|
|
5
6
|
|
|
@@ -35,7 +36,7 @@ class ErrorClustersExtension extends BaseExtension {
|
|
|
35
36
|
|
|
36
37
|
const texts = [];
|
|
37
38
|
for (const cluster of clusters) {
|
|
38
|
-
texts.push(`${cluster.failure} - ${this.bold(`(x${cluster.count})`)}`);
|
|
39
|
+
texts.push(`${truncate(cluster.failure, 150)} - ${this.bold(`(x${cluster.count})`)}`);
|
|
39
40
|
}
|
|
40
41
|
this.text = this.mergeTexts(texts);
|
|
41
42
|
}
|
package/src/helpers/helper.js
CHANGED
|
@@ -46,9 +46,15 @@ function processData(data) {
|
|
|
46
46
|
return data;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param {string} text
|
|
52
|
+
* @param {number} length
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
49
55
|
function truncate(text, length) {
|
|
50
56
|
if (text && text.length > length) {
|
|
51
|
-
return text.slice(0, length) + "...";
|
|
57
|
+
return text.slice(0, length).trim() + "...";
|
|
52
58
|
} else {
|
|
53
59
|
return text;
|
|
54
60
|
}
|
|
@@ -103,12 +103,22 @@ class BasePlatform {
|
|
|
103
103
|
|
|
104
104
|
const texts = [];
|
|
105
105
|
|
|
106
|
+
// webdriver io
|
|
107
|
+
if (suite.metadata.device && typeof suite.metadata.device === 'string') {
|
|
108
|
+
texts.push(`${suite.metadata.device}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
106
111
|
if (suite.metadata.platform && suite.metadata.platform.name && suite.metadata.platform.version) {
|
|
107
|
-
texts.push(`${suite.metadata.platform.name} ${suite.metadata.platform.version}`)
|
|
112
|
+
texts.push(`${suite.metadata.platform.name} ${suite.metadata.platform.version}`);
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
if (suite.metadata.browser && suite.metadata.browser.name && suite.metadata.browser.version) {
|
|
111
|
-
texts.push(`${suite.metadata.browser.name} ${suite.metadata.browser.version}`)
|
|
116
|
+
texts.push(`${suite.metadata.browser.name} ${suite.metadata.browser.version}`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// playwright
|
|
120
|
+
if (suite.metadata.hostname && typeof suite.metadata.hostname === 'string') {
|
|
121
|
+
texts.push(`${suite.metadata.hostname}`);
|
|
112
122
|
}
|
|
113
123
|
|
|
114
124
|
return texts.join(' • ');
|