@testomatio/reporter 2.3.6-beta.1-truncate-steps → 2.3.6-beta.2-fix-beforesuite
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/lib/adapter/codecept.js +2 -3
- package/lib/client.js +1 -1
- package/lib/pipe/testomatio.js +1 -0
- package/lib/utils/utils.d.ts +0 -1
- package/lib/utils/utils.js +0 -9
- package/package.json +1 -1
- package/src/adapter/codecept.js +3 -5
- package/src/client.js +2 -2
- package/src/pipe/testomatio.js +2 -0
- package/src/utils/utils.js +0 -8
package/lib/adapter/codecept.js
CHANGED
|
@@ -379,7 +379,7 @@ function formatCodeceptStep(step) {
|
|
|
379
379
|
if (!step)
|
|
380
380
|
return null;
|
|
381
381
|
const category = step.constructor.name === 'HelperStep' ? 'framework' : 'user';
|
|
382
|
-
const title =
|
|
382
|
+
const title = step.toString(); // Use built-in toString
|
|
383
383
|
const duration = step.duration || 0; // Use built-in duration
|
|
384
384
|
const formattedStep = {
|
|
385
385
|
category,
|
|
@@ -403,11 +403,10 @@ function formatHookStep(step) {
|
|
|
403
403
|
if (step.actor && step.name) {
|
|
404
404
|
title = `${step.actor} ${step.name}`;
|
|
405
405
|
if (step.args && step.args.length > 0) {
|
|
406
|
-
const argsStr = step.args.map(arg =>
|
|
406
|
+
const argsStr = step.args.map(arg => JSON.stringify(arg)).join(', ');
|
|
407
407
|
title += ` ${argsStr}`;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
title = (0, utils_js_1.truncate)(title);
|
|
411
410
|
return {
|
|
412
411
|
category: 'hook',
|
|
413
412
|
title,
|
package/lib/client.js
CHANGED
|
@@ -329,7 +329,7 @@ class Client {
|
|
|
329
329
|
*/
|
|
330
330
|
formatLogs({ error, steps, logs }) {
|
|
331
331
|
error = error?.trim();
|
|
332
|
-
logs = logs?.trim()
|
|
332
|
+
logs = logs?.trim();
|
|
333
333
|
if (Array.isArray(steps)) {
|
|
334
334
|
steps = steps
|
|
335
335
|
.map(step => (0, utils_js_1.formatStep)(step))
|
package/lib/pipe/testomatio.js
CHANGED
|
@@ -410,6 +410,7 @@ class TestomatioPipe {
|
|
|
410
410
|
tests: params.tests,
|
|
411
411
|
}
|
|
412
412
|
});
|
|
413
|
+
console.log(constants_js_1.APP_PREFIX, '✅ Testrun finished');
|
|
413
414
|
if (this.runUrl) {
|
|
414
415
|
console.log(constants_js_1.APP_PREFIX, '📊 Report Saved. Report URL:', picocolors_1.default.magenta(this.runUrl));
|
|
415
416
|
}
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export function getPackageVersion(): any;
|
|
|
2
2
|
export const TEST_ID_REGEX: RegExp;
|
|
3
3
|
export const SUITE_ID_REGEX: RegExp;
|
|
4
4
|
export function ansiRegExp(): RegExp;
|
|
5
|
-
export function truncate(s: any, size?: number): any;
|
|
6
5
|
export function cleanLatestRunId(): any;
|
|
7
6
|
export function isSameTest(test: any, t: any): boolean;
|
|
8
7
|
export function fetchSourceCode(contents: any, opts?: {}): string;
|
package/lib/utils/utils.js
CHANGED
|
@@ -38,7 +38,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.validateSuiteId = exports.testRunnerHelper = exports.specificTestInfo = exports.parseSuite = exports.isValidUrl = exports.humanize = exports.getTestomatIdFromTestTitle = exports.getCurrentDateTime = exports.foundedTestLog = exports.fileSystem = exports.fetchFilesFromStackTrace = exports.fetchIdFromOutput = exports.fetchIdFromCode = exports.fetchSourceCodeFromStackTrace = exports.fetchSourceCode = exports.isSameTest = exports.ansiRegExp = exports.SUITE_ID_REGEX = exports.TEST_ID_REGEX = void 0;
|
|
40
40
|
exports.getPackageVersion = getPackageVersion;
|
|
41
|
-
exports.truncate = truncate;
|
|
42
41
|
exports.cleanLatestRunId = cleanLatestRunId;
|
|
43
42
|
exports.formatStep = formatStep;
|
|
44
43
|
exports.readLatestRunId = readLatestRunId;
|
|
@@ -470,17 +469,9 @@ function transformEnvVarToBoolean(value) {
|
|
|
470
469
|
// if not recognized, return truthy if any value is set
|
|
471
470
|
return Boolean(value);
|
|
472
471
|
}
|
|
473
|
-
function truncate(s, size = 255) {
|
|
474
|
-
if (s.toString().trim().length < size) {
|
|
475
|
-
return s.toString();
|
|
476
|
-
}
|
|
477
|
-
return `${s.toString().substring(0, size)}...`;
|
|
478
|
-
}
|
|
479
472
|
|
|
480
473
|
module.exports.getPackageVersion = getPackageVersion;
|
|
481
474
|
|
|
482
|
-
module.exports.truncate = truncate;
|
|
483
|
-
|
|
484
475
|
module.exports.cleanLatestRunId = cleanLatestRunId;
|
|
485
476
|
|
|
486
477
|
module.exports.formatStep = formatStep;
|
package/package.json
CHANGED
package/src/adapter/codecept.js
CHANGED
|
@@ -2,7 +2,7 @@ import createDebugMessages from 'debug';
|
|
|
2
2
|
import pc from 'picocolors';
|
|
3
3
|
import TestomatClient from '../client.js';
|
|
4
4
|
import { STATUS, APP_PREFIX, TESTOMAT_TMP_STORAGE_DIR } from '../constants.js';
|
|
5
|
-
import { getTestomatIdFromTestTitle,
|
|
5
|
+
import { getTestomatIdFromTestTitle, fileSystem } from '../utils/utils.js';
|
|
6
6
|
import { services } from '../services/index.js';
|
|
7
7
|
import { dataStorage } from '../data-storage.js';
|
|
8
8
|
import codeceptjs from 'codeceptjs';
|
|
@@ -441,7 +441,7 @@ function formatCodeceptStep(step) {
|
|
|
441
441
|
if (!step) return null;
|
|
442
442
|
|
|
443
443
|
const category = step.constructor.name === 'HelperStep' ? 'framework' : 'user';
|
|
444
|
-
const title =
|
|
444
|
+
const title = step.toString(); // Use built-in toString
|
|
445
445
|
const duration = step.duration || 0; // Use built-in duration
|
|
446
446
|
|
|
447
447
|
const formattedStep = {
|
|
@@ -469,11 +469,10 @@ function formatHookStep(step) {
|
|
|
469
469
|
if (step.actor && step.name) {
|
|
470
470
|
title = `${step.actor} ${step.name}`;
|
|
471
471
|
if (step.args && step.args.length > 0) {
|
|
472
|
-
const argsStr = step.args.map(arg =>
|
|
472
|
+
const argsStr = step.args.map(arg => JSON.stringify(arg)).join(', ');
|
|
473
473
|
title += ` ${argsStr}`;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
title = truncate(title);
|
|
477
476
|
|
|
478
477
|
return {
|
|
479
478
|
category: 'hook',
|
|
@@ -482,6 +481,5 @@ function formatHookStep(step) {
|
|
|
482
481
|
};
|
|
483
482
|
}
|
|
484
483
|
|
|
485
|
-
|
|
486
484
|
export { CodeceptReporter };
|
|
487
485
|
export default CodeceptReporter;
|
package/src/client.js
CHANGED
|
@@ -10,7 +10,7 @@ import { glob } from 'glob';
|
|
|
10
10
|
import path, { sep } from 'path';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
12
12
|
import { S3Uploader } from './uploader.js';
|
|
13
|
-
import { formatStep,
|
|
13
|
+
import { formatStep, readLatestRunId, storeRunId, validateSuiteId } from './utils/utils.js';
|
|
14
14
|
import { filesize as prettyBytes } from 'filesize';
|
|
15
15
|
|
|
16
16
|
const debug = createDebugMessages('@testomatio/reporter:client');
|
|
@@ -387,7 +387,7 @@ class Client {
|
|
|
387
387
|
*/
|
|
388
388
|
formatLogs({ error, steps, logs }) {
|
|
389
389
|
error = error?.trim();
|
|
390
|
-
logs = logs?.trim()
|
|
390
|
+
logs = logs?.trim();
|
|
391
391
|
|
|
392
392
|
if (Array.isArray(steps)) {
|
|
393
393
|
steps = steps
|
package/src/pipe/testomatio.js
CHANGED
package/src/utils/utils.js
CHANGED
|
@@ -428,16 +428,8 @@ function transformEnvVarToBoolean(value) {
|
|
|
428
428
|
return Boolean(value);
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
function truncate(s, size = 255) {
|
|
432
|
-
if (s.toString().trim().length < size) {
|
|
433
|
-
return s.toString();
|
|
434
|
-
}
|
|
435
|
-
return `${s.toString().substring(0, size)}...`;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
431
|
export {
|
|
439
432
|
ansiRegExp,
|
|
440
|
-
truncate,
|
|
441
433
|
cleanLatestRunId,
|
|
442
434
|
isSameTest,
|
|
443
435
|
fetchSourceCode,
|