@serenity-js/console-reporter 3.0.0-rc.9 → 3.0.1
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/CHANGELOG.md +75 -1171
- package/README.md +98 -27
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -1
- package/lib/index.js.map +1 -1
- package/lib/stage/crew/console-reporter/ConsoleReporter.d.ts +84 -60
- package/lib/stage/crew/console-reporter/ConsoleReporter.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/ConsoleReporter.js +233 -171
- package/lib/stage/crew/console-reporter/ConsoleReporter.js.map +1 -1
- package/lib/stage/crew/console-reporter/ConsoleReporterConfig.d.ts +13 -0
- package/lib/stage/crew/console-reporter/ConsoleReporterConfig.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/ConsoleReporterConfig.js +3 -0
- package/lib/stage/crew/console-reporter/ConsoleReporterConfig.js.map +1 -0
- package/lib/stage/crew/console-reporter/Printer.d.ts +2 -4
- package/lib/stage/crew/console-reporter/Printer.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/Printer.js +0 -3
- package/lib/stage/crew/console-reporter/Printer.js.map +1 -1
- package/lib/stage/crew/console-reporter/Summary.d.ts +7 -1
- package/lib/stage/crew/console-reporter/Summary.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/Summary.js +14 -1
- package/lib/stage/crew/console-reporter/Summary.js.map +1 -1
- package/lib/stage/crew/console-reporter/SummaryFormatter.d.ts +1 -0
- package/lib/stage/crew/console-reporter/SummaryFormatter.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/SummaryFormatter.js +4 -1
- package/lib/stage/crew/console-reporter/SummaryFormatter.js.map +1 -1
- package/lib/stage/crew/console-reporter/index.d.ts +2 -0
- package/lib/stage/crew/console-reporter/index.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/index.js +6 -1
- package/lib/stage/crew/console-reporter/index.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.d.ts +1 -7
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.js +0 -6
- package/lib/stage/crew/console-reporter/themes/TerminalTheme.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.d.ts +7 -21
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.js +9 -30
- package/lib/stage/crew/console-reporter/themes/ThemeForColourTerminals.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.d.ts +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForDarkTerminals.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.d.ts +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForLightTerminals.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.d.ts +7 -20
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.js +6 -29
- package/lib/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.js.map +1 -1
- package/lib/stage/crew/console-reporter/themes/index.d.ts +1 -0
- package/lib/stage/crew/console-reporter/themes/index.d.ts.map +1 -0
- package/lib/stage/crew/console-reporter/themes/index.js +5 -1
- package/lib/stage/crew/console-reporter/themes/index.js.map +1 -1
- package/lib/stage/crew/index.d.ts +1 -0
- package/lib/stage/crew/index.d.ts.map +1 -0
- package/lib/stage/crew/index.js +5 -1
- package/lib/stage/crew/index.js.map +1 -1
- package/lib/stage/index.d.ts +1 -0
- package/lib/stage/index.d.ts.map +1 -0
- package/lib/stage/index.js +5 -1
- package/lib/stage/index.js.map +1 -1
- package/package.json +19 -42
- package/src/index.ts +9 -0
- package/src/stage/crew/console-reporter/ConsoleReporter.ts +237 -173
- package/src/stage/crew/console-reporter/ConsoleReporterConfig.ts +12 -0
- package/src/stage/crew/console-reporter/Printer.ts +1 -4
- package/src/stage/crew/console-reporter/Summary.ts +23 -4
- package/src/stage/crew/console-reporter/SummaryFormatter.ts +5 -10
- package/src/stage/crew/console-reporter/index.ts +1 -0
- package/src/stage/crew/console-reporter/themes/TerminalTheme.ts +0 -8
- package/src/stage/crew/console-reporter/themes/ThemeForColourTerminals.ts +11 -42
- package/src/stage/crew/console-reporter/themes/ThemeForDarkTerminals.ts +1 -1
- package/src/stage/crew/console-reporter/themes/ThemeForLightTerminals.ts +1 -1
- package/src/stage/crew/console-reporter/themes/ThemeForMonochromaticTerminals.ts +6 -30
- package/tsconfig.build.json +10 -0
- package/tsconfig.eslint.json +0 -10
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# Serenity/JS
|
|
2
2
|
|
|
3
|
-
[Serenity/JS](https://serenity-js
|
|
4
|
-
|
|
3
|
+
[](https://www.linkedin.com/company/serenity-js)
|
|
4
|
+
[](https://www.youtube.com/@serenity-js)
|
|
5
|
+
[](https://matrix.to/#/#serenity-js:gitter.im)
|
|
6
|
+
[](https://github.com/sponsors/serenity-js)
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
[Serenity/JS](https://serenity-js.org) is an innovative framework designed to make acceptance and regression testing
|
|
9
|
+
of complex software systems faster, more collaborative and easier to scale.
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
To get started, check out the comprehensive [Serenity/JS Handbook](https://serenity-js.org/handbook), [API documentation](https://serenity-js.org/api/core), and [Serenity/JS project templates on GitHub](https://serenity-js.org/handbook/getting-started#serenityjs-project-templates).
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
with dark and light backgrounds.
|
|
13
|
+
If you have any questions or just want to say hello, join the [Serenity/JS Community Chat](https://matrix.to/#/#serenity-js:gitter.im).
|
|
12
14
|
|
|
13
15
|
### Installation
|
|
14
16
|
|
|
@@ -27,41 +29,110 @@ instead of `cmd.exe` to benefit from the colour output.
|
|
|
27
29
|
|
|
28
30
|
To allow Serenity/JS to print the progress report to standard output, assign the `ConsoleReporter` to the `Stage`.
|
|
29
31
|
|
|
30
|
-
This can be done
|
|
32
|
+
This can be done:
|
|
33
|
+
- via `playwright.config.ts`, if you're using Serenity/JS with [Playwright Test](https://serenity-js.org/api/playwright-test)
|
|
34
|
+
- via `wdio.conf.ts`, if you're using Serenity/JS with [WebdriverIO](https://serenity-js.org/api/playwright-test)
|
|
35
|
+
- via `protractor.conf.js`, if you're using Serenity/JS with [Protractor](https://serenity-js.org/api/protractor)
|
|
36
|
+
- or programmatically.
|
|
31
37
|
|
|
32
|
-
####
|
|
38
|
+
#### Usage with Playwright Test
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
import { configure } from '@serenity-js/core';
|
|
36
|
-
import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
40
|
+
Learn more about using [Serenity/JS with Playwright Test](https://serenity-js.org/api/playwright-test).
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
```typescript
|
|
43
|
+
// playwright.config.ts
|
|
44
|
+
import type { PlaywrightTestConfig } from '@serenity-js/playwright-test';
|
|
45
|
+
|
|
46
|
+
const config: PlaywrightTestConfig = {
|
|
47
|
+
reporter: [
|
|
48
|
+
[ '@serenity-js/playwright-test', {
|
|
49
|
+
crew: [
|
|
50
|
+
// console reporter with default settings
|
|
51
|
+
'@serenity-js/console-reporter',
|
|
52
|
+
|
|
53
|
+
// console reporter with a theme for 'dark', 'light' or 'mono' terminals
|
|
54
|
+
// [ '@serenity-js/console-reporter', { theme: 'auto' } ]
|
|
55
|
+
]
|
|
56
|
+
}]
|
|
41
57
|
],
|
|
42
|
-
|
|
58
|
+
|
|
59
|
+
// Other configuration omitted for brevity
|
|
60
|
+
// For details, see https://playwright.dev/docs/test-configuration
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default config;
|
|
43
64
|
```
|
|
44
65
|
|
|
45
|
-
####
|
|
66
|
+
#### Usage with WebdriverIO
|
|
67
|
+
|
|
68
|
+
Learn more about using [Serenity/JS with WebdriverIO](https://serenity-js.org/api/webdriverio).
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// wdio.conf.ts
|
|
72
|
+
|
|
73
|
+
import { WebdriverIOConfig } from '@serenity-js/webdriverio';
|
|
74
|
+
|
|
75
|
+
export const config: WebdriverIOConfig = {
|
|
76
|
+
|
|
77
|
+
framework: '@serenity-js/webdriverio',
|
|
78
|
+
|
|
79
|
+
serenity: {
|
|
80
|
+
crew: [
|
|
81
|
+
// console reporter with default settings
|
|
82
|
+
'@serenity-js/console-reporter',
|
|
83
|
+
|
|
84
|
+
// console reporter with a theme for 'dark', 'light' or 'mono' terminals
|
|
85
|
+
// [ '@serenity-js/console-reporter', { theme: 'auto' } ]
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// Other configuration omitted for brevity
|
|
90
|
+
// For details, see https://webdriver.io/docs/options
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
#### Usage with Protractor
|
|
95
|
+
|
|
96
|
+
Learn more about using [Serenity/JS with Protractor](https://serenity-js.org/api/protractor).
|
|
46
97
|
|
|
47
98
|
```javascript
|
|
48
99
|
// protractor.conf.js
|
|
49
100
|
|
|
50
|
-
const { ConsoleReporter } = require('@serenity-js/console-reporter');
|
|
51
|
-
|
|
52
101
|
exports.config = {
|
|
53
|
-
|
|
54
|
-
|
|
102
|
+
|
|
103
|
+
framework: 'custom',
|
|
104
|
+
frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
|
|
105
|
+
|
|
55
106
|
serenity: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
107
|
+
crew: [
|
|
108
|
+
// console reporter with default settings
|
|
109
|
+
'@serenity-js/console-reporter',
|
|
110
|
+
|
|
111
|
+
// console reporter with a theme for 'dark', 'light' or 'mono' terminals
|
|
112
|
+
// [ '@serenity-js/console-reporter', { theme: 'auto' } ]
|
|
113
|
+
]
|
|
60
114
|
},
|
|
61
|
-
|
|
62
|
-
|
|
115
|
+
|
|
116
|
+
// ...
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Programmatic configuration
|
|
121
|
+
|
|
122
|
+
Learn more about [configuring Serenity/JS programmatically](https://serenity-js.org/api/core/class/SerenityConfig).
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { configure } from '@serenity-js/core';
|
|
126
|
+
import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
127
|
+
|
|
128
|
+
configure({
|
|
129
|
+
crew: [
|
|
130
|
+
ConsoleReporter.withDefaultColourSupport(),
|
|
131
|
+
],
|
|
132
|
+
});
|
|
63
133
|
```
|
|
64
134
|
|
|
65
135
|
#### Colour Themes
|
|
66
136
|
|
|
67
|
-
Consult the API docs of the `ConsoleReporter` class
|
|
137
|
+
Consult the API docs of the [`ConsoleReporter`](/api/console-reporter/class/ConsoleReporter) class
|
|
138
|
+
to learn more about the supported colour themes.
|
package/lib/index.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
+
import { StageCrewMemberBuilder } from '@serenity-js/core';
|
|
2
|
+
import { ConsoleReporter, ConsoleReporterConfig } from './stage';
|
|
1
3
|
export * from './stage';
|
|
4
|
+
export default function create(config?: ConsoleReporterConfig): StageCrewMemberBuilder<ConsoleReporter>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEjE,cAAc,SAAS,CAAC;AAGxB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,MAAM,GAAE,qBAAiC,GAAG,sBAAsB,CAAC,eAAe,CAAC,CAEjH"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,5 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const stage_1 = require("./stage");
|
|
13
18
|
__exportStar(require("./stage"), exports);
|
|
19
|
+
// eslint-disable-next-line unicorn/no-useless-undefined
|
|
20
|
+
function create(config = undefined) {
|
|
21
|
+
return stage_1.ConsoleReporter.fromJSON(config || { theme: 'auto' });
|
|
22
|
+
}
|
|
23
|
+
exports.default = create;
|
|
14
24
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,mCAAiE;AAEjE,0CAAwB;AAExB,wDAAwD;AACxD,SAAwB,MAAM,CAAC,SAAgC,SAAS;IACpE,OAAO,uBAAe,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACjE,CAAC;AAFD,yBAEC"}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { ListensToDomainEvents, Stage, StageCrewMemberBuilder } from '@serenity-js/core';
|
|
2
2
|
import { DomainEvent } from '@serenity-js/core/lib/events';
|
|
3
|
+
import { ConsoleReporterConfig } from './ConsoleReporterConfig';
|
|
3
4
|
import { Printer } from './Printer';
|
|
4
5
|
import { TerminalTheme } from './themes';
|
|
5
6
|
/**
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
8
|
-
* to report on progress of your Serenity/JS acceptance tests.
|
|
7
|
+
* A {@apilink StageCrewMember} that uses [standard output](https://en.wikipedia.org/wiki/Standard_streams)
|
|
8
|
+
* to report on progress of your Serenity/JS acceptance tests.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* `ConsoleReporter` ships with colour themes for both dark and light terminals,
|
|
11
|
+
* as well as a monochromatic theme for those moments when you're in a noir mood
|
|
12
|
+
* (or have a terminal that doesn't support colours, like the good old `cmd.exe` on Windows).
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* ## Registering the reporter programmatically
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
15
17
|
* import { configure } from '@serenity-js/core';
|
|
16
18
|
* import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
17
19
|
*
|
|
18
20
|
* configure({
|
|
19
|
-
*
|
|
21
|
+
* crew: [
|
|
22
|
+
* ConsoleReporter.withDefaultColourSupport()
|
|
23
|
+
* ],
|
|
20
24
|
* });
|
|
25
|
+
* ```
|
|
21
26
|
*
|
|
22
|
-
*
|
|
27
|
+
* ## Redirecting output to a file
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
23
30
|
* import { configure } from '@serenity-js/core';
|
|
24
31
|
* import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
25
32
|
* import { createWriteStream } from 'fs';
|
|
@@ -28,27 +35,53 @@ import { TerminalTheme } from './themes';
|
|
|
28
35
|
* outputStream: createWriteStream('./output.log'),
|
|
29
36
|
* crew: [ ConsoleReporter.withDefaultColourSupport() ],
|
|
30
37
|
* });
|
|
38
|
+
* ```
|
|
39
|
+
* ## Registering the reporter with WebdriverIO
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* // wdio.conf.ts
|
|
43
|
+
* import { ConsoleReporter } from '@serenity-js/console-reporter';
|
|
44
|
+
* import { WebdriverIOConfig } from '@serenity-js/webdriverio';
|
|
45
|
+
*
|
|
46
|
+
* export const config: WebdriverIOConfig = {
|
|
47
|
+
*
|
|
48
|
+
* framework: '@serenity-js/webdriverio',
|
|
49
|
+
*
|
|
50
|
+
* serenity: {
|
|
51
|
+
* crew: [
|
|
52
|
+
* ConsoleReporter.forDarkTerminals(),
|
|
53
|
+
* ]
|
|
54
|
+
* // other Serenity/JS config
|
|
55
|
+
* },
|
|
56
|
+
*
|
|
57
|
+
* // other WebdriverIO config
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
31
60
|
*
|
|
32
|
-
*
|
|
33
|
-
* // protractor.conf.js
|
|
34
|
-
* const { ConsoleReporter } = require('@serenity-js/console-reporter');
|
|
61
|
+
* ## Registering the reporter with Protractor
|
|
35
62
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
63
|
+
* ```js
|
|
64
|
+
* // protractor.conf.js
|
|
65
|
+
* const { ConsoleReporter } = require('@serenity-js/console-reporter');
|
|
39
66
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* ],
|
|
44
|
-
* // other Serenity/JS config
|
|
45
|
-
* },
|
|
67
|
+
* exports.config = {
|
|
68
|
+
* framework: 'custom',
|
|
69
|
+
* frameworkPath: require.resolve('@serenity-js/protractor/adapter'),
|
|
46
70
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
71
|
+
* serenity: {
|
|
72
|
+
* crew: [
|
|
73
|
+
* ConsoleReporter.withDefaultColourSupport(),
|
|
74
|
+
* ],
|
|
75
|
+
* // other Serenity/JS config
|
|
76
|
+
* },
|
|
77
|
+
*
|
|
78
|
+
* // other Protractor config
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
49
81
|
*
|
|
50
82
|
* @public
|
|
51
|
-
*
|
|
83
|
+
*
|
|
84
|
+
* @group Stage
|
|
52
85
|
*/
|
|
53
86
|
export declare class ConsoleReporter implements ListensToDomainEvents {
|
|
54
87
|
private readonly printer;
|
|
@@ -57,68 +90,59 @@ export declare class ConsoleReporter implements ListensToDomainEvents {
|
|
|
57
90
|
private startTimes;
|
|
58
91
|
private artifacts;
|
|
59
92
|
private summary;
|
|
60
|
-
private
|
|
93
|
+
private readonly firstErrors;
|
|
61
94
|
private readonly summaryFormatter;
|
|
95
|
+
private readonly eventQueues;
|
|
96
|
+
static fromJSON(config: ConsoleReporterConfig): StageCrewMemberBuilder<ConsoleReporter>;
|
|
62
97
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* for dark terminals if successful.
|
|
67
|
-
*
|
|
68
|
-
* Please note that spawning your test process from another process
|
|
69
|
-
* (by using [npm-failsafe](https://www.npmjs.com/package/npm-failsafe), for example)
|
|
70
|
-
* causes the `ConsoleReporter` to use the monochromatic colour scheme,
|
|
71
|
-
* as colour support can't be detected in child processes.
|
|
72
|
-
*
|
|
73
|
-
* If the above describes your setup, use {@link ConsoleReporter#forDarkTerminals}
|
|
74
|
-
* or {@link ConsoleReporter#forLightTerminals} to make the sub-process produce colour output.
|
|
98
|
+
* Instantiates a `ConsoleReporter` that auto-detects
|
|
99
|
+
* your terminal's support for colours and uses a colour theme
|
|
100
|
+
* for dark terminals if successful.
|
|
75
101
|
*
|
|
76
|
-
*
|
|
102
|
+
* Please note that spawning your test process from another process
|
|
103
|
+
* (by using [npm-failsafe](https://www.npmjs.com/package/npm-failsafe), for example)
|
|
104
|
+
* causes the `ConsoleReporter` to use the monochromatic colour scheme,
|
|
105
|
+
* as colour support can't be detected in child processes.
|
|
77
106
|
*/
|
|
78
107
|
static withDefaultColourSupport(): StageCrewMemberBuilder<ConsoleReporter>;
|
|
79
108
|
/**
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* to avoid printing control characters.
|
|
85
|
-
*
|
|
86
|
-
* @returns {@serenity-js/core/lib/stage~StageCrewMemberBuilder}
|
|
109
|
+
* Instantiates a `ConsoleReporter` with a monochromatic colour theme.
|
|
110
|
+
* Good for terminals with no colour support (like the `cmd.exe` on Windows),
|
|
111
|
+
* or for times when you need to pipe the output to a text file and want
|
|
112
|
+
* to avoid printing control characters.
|
|
87
113
|
*/
|
|
88
114
|
static forMonochromaticTerminals(): StageCrewMemberBuilder<ConsoleReporter>;
|
|
89
115
|
/**
|
|
90
|
-
*
|
|
91
|
-
* Instantiates a `ConsoleReporter` with a colour theme optimised for terminals with dark backgrounds.
|
|
92
|
-
*
|
|
93
|
-
* @returns {@serenity-js/core/lib/stage~StageCrewMemberBuilder}
|
|
116
|
+
* Instantiates a `ConsoleReporter` with a colour theme optimised for terminals with dark backgrounds.
|
|
94
117
|
*/
|
|
95
118
|
static forDarkTerminals(): StageCrewMemberBuilder<ConsoleReporter>;
|
|
96
119
|
/**
|
|
97
|
-
*
|
|
98
|
-
* Instantiates a `ConsoleReporter` with a colour theme optimised for terminals with light backgrounds.
|
|
99
|
-
*
|
|
100
|
-
* @returns {@serenity-js/core/lib/stage~StageCrewMemberBuilder}
|
|
120
|
+
* Instantiates a `ConsoleReporter` with a colour theme optimised for terminals with light backgrounds.
|
|
101
121
|
*/
|
|
102
122
|
static forLightTerminals(): StageCrewMemberBuilder<ConsoleReporter>;
|
|
123
|
+
private static theme;
|
|
103
124
|
/**
|
|
104
125
|
* @param {Printer} printer
|
|
105
126
|
* @param {TerminalTheme} theme
|
|
106
|
-
* @param {
|
|
127
|
+
* @param {Stage} [stage=undefined]
|
|
107
128
|
*/
|
|
108
129
|
constructor(printer: Printer, theme: TerminalTheme, stage?: Stage);
|
|
109
130
|
/**
|
|
110
|
-
* @
|
|
111
|
-
* Handles {@link @serenity-js/core/lib/events~DomainEvent} objects emitted by the {@link @serenity-js/core/lib/stage~StageCrewMember}.
|
|
131
|
+
* Handles {@apilink DomainEvent} objects emitted by the {@apilink Stage}.
|
|
112
132
|
*
|
|
113
|
-
* @see {@
|
|
133
|
+
* @see {@apilink StageCrewMember}
|
|
114
134
|
*
|
|
115
|
-
* @listens {
|
|
135
|
+
* @listens {DomainEvent}
|
|
116
136
|
*
|
|
117
|
-
* @param {
|
|
118
|
-
* @returns {void}
|
|
137
|
+
* @param {DomainEvent} event
|
|
119
138
|
*/
|
|
120
139
|
notifyOf(event: DomainEvent): void;
|
|
140
|
+
private printTestRunErrorOutcome;
|
|
141
|
+
private printScene;
|
|
142
|
+
private printSummary;
|
|
143
|
+
private isSceneSpecific;
|
|
121
144
|
private formattedOutcome;
|
|
122
145
|
private deCamelCased;
|
|
123
146
|
private iconFrom;
|
|
124
147
|
}
|
|
148
|
+
//# sourceMappingURL=ConsoleReporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleReporter.d.ts","sourceRoot":"","sources":["../../../../src/stage/crew/console-reporter/ConsoleReporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,qBAAqB,EAAc,KAAK,EAAE,sBAAsB,EAAa,MAAM,mBAAmB,CAAC;AAEhK,OAAO,EAEH,WAAW,EASd,MAAM,8BAA8B,CAAC;AAkBtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAiF,MAAM,UAAU,CAAC;AAExH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,qBAAa,eAAgB,YAAW,qBAAqB;IAsErD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAtE3B,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2B;IAEvD,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,GAAG,sBAAsB,CAAC,eAAe,CAAC;IAIvF;;;;;;;;;OASG;IACH,MAAM,CAAC,wBAAwB,IAAI,sBAAsB,CAAC,eAAe,CAAC;IAI1E;;;;;OAKG;IACH,MAAM,CAAC,yBAAyB,IAAI,sBAAsB,CAAC,eAAe,CAAC;IAI3E;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,sBAAsB,CAAC,eAAe,CAAC;IAIlE;;OAEG;IACH,MAAM,CAAC,iBAAiB,IAAI,sBAAsB,CAAC,eAAe,CAAC;IAInE,OAAO,CAAC,MAAM,CAAC,KAAK;IAapB;;;;OAIG;gBAEkB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,aAAa,EACpB,KAAK,CAAC,EAAE,KAAK;IAQlC;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IA+BlC,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,UAAU;IAmIlB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,QAAQ;CAkBnB"}
|