html-reporter 9.2.2 → 9.3.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 +21 -0
- package/README.md +10 -2
- package/lib/constants/plugin-events.js +2 -1
- package/lib/gui/api/facade.js +2 -2
- package/lib/gui/api/index.js +2 -2
- package/lib/merge-reports/index.js +2 -0
- package/lib/plugin-adapter.js +6 -1
- package/lib/plugin-api.js +2 -2
- package/lib/static/gui.min.js +1 -1
- package/lib/static/report.min.js +1 -1
- package/lib/test-adapter.js +1 -1
- package/package.json +10 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
<a name="9.3.1"></a>
|
|
6
|
+
## [9.3.1](https://github.com/gemini-testing/html-reporter/compare/v9.3.0...v9.3.1) (2022-09-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* move static deps to dev and remove unused deps ([1f0fab5](https://github.com/gemini-testing/html-reporter/commit/1f0fab5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="9.3.0"></a>
|
|
16
|
+
# [9.3.0](https://github.com/gemini-testing/html-reporter/compare/v9.2.2...v9.3.0) (2022-09-15)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add REPORT_SAVED event ([cd16aa6](https://github.com/gemini-testing/html-reporter/commit/cd16aa6))
|
|
22
|
+
* use EventEmitter2 instead of AsyncEmitter from gemini-core ([3c41ab7](https://github.com/gemini-testing/html-reporter/commit/3c41ab7))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
5
26
|
<a name="9.2.2"></a>
|
|
6
27
|
## [9.2.2](https://github.com/gemini-testing/html-reporter/compare/v9.2.1...v9.2.2) (2022-08-23)
|
|
7
28
|
|
package/README.md
CHANGED
|
@@ -534,7 +534,8 @@ Property name | Description
|
|
|
534
534
|
Event | Description
|
|
535
535
|
------------------------- | -------------
|
|
536
536
|
`DATABASE_CREATED` | Will be triggered after sqlite database is created. The handler accepts a database instance. The event is synchronous.
|
|
537
|
-
`TEST_SCREENSHOTS_SAVED`
|
|
537
|
+
`TEST_SCREENSHOTS_SAVED` | Will be triggered after test screenshots were saved. The handler accepts test id and screenshots info. The event is asynchronous, so your handler can return a promise.
|
|
538
|
+
`REPORT_SAVED` | Will be triggered after all test files were saved. The event is asynchronous, so your handler can return a promise.
|
|
538
539
|
|
|
539
540
|
### events
|
|
540
541
|
|
|
@@ -558,7 +559,7 @@ module.exports = (hermione, opts) => {
|
|
|
558
559
|
Example of a subscription to an event `TEST_SCREENSHOTS_SAVED`:
|
|
559
560
|
|
|
560
561
|
```js
|
|
561
|
-
hermione.htmlReporter.on(hermione.htmlReporter.events.TEST_SCREENSHOTS_SAVED, ({testId, attempt, imagesInfo}) => {
|
|
562
|
+
hermione.htmlReporter.on(hermione.htmlReporter.events.TEST_SCREENSHOTS_SAVED, async ({testId, attempt, imagesInfo}) => {
|
|
562
563
|
console.log(`Screenshots for test "${testId}" (attempt #${attempt}) were saved:`, imagesInfo);
|
|
563
564
|
/* Expected output:
|
|
564
565
|
Screenshots for test "Feature Test.chrome-desktop" (attempt #0) were saved:
|
|
@@ -578,6 +579,13 @@ hermione.htmlReporter.on(hermione.htmlReporter.events.TEST_SCREENSHOTS_SAVED, ({
|
|
|
578
579
|
});
|
|
579
580
|
```
|
|
580
581
|
|
|
582
|
+
Example of a subscription to an event `REPORT_SAVED`:
|
|
583
|
+
```js
|
|
584
|
+
hermione.htmlReporter.on(hermione.htmlReporter.events.REPORT_SAVED, async ({reportPath}) => {
|
|
585
|
+
await uploadDirToS3(reportPath);
|
|
586
|
+
});
|
|
587
|
+
```
|
|
588
|
+
|
|
581
589
|
### addExtraItem
|
|
582
590
|
|
|
583
591
|
Adds item to html report as link:
|
package/lib/gui/api/facade.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const EventEmitter2 = require('eventemitter2');
|
|
4
4
|
const guiEvents = require('../constants/gui-events');
|
|
5
5
|
|
|
6
|
-
module.exports = class ApiFacade extends
|
|
6
|
+
module.exports = class ApiFacade extends EventEmitter2 {
|
|
7
7
|
static create() {
|
|
8
8
|
return new ApiFacade();
|
|
9
9
|
}
|
package/lib/gui/api/index.js
CHANGED
|
@@ -12,10 +12,10 @@ module.exports = class Api {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async initServer(server) {
|
|
15
|
-
await this._gui.
|
|
15
|
+
await this._gui.emitAsync(this._gui.events.SERVER_INIT, server);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
async serverReady(data) {
|
|
19
|
-
await this._gui.
|
|
19
|
+
await this._gui.emitAsync(this._gui.events.SERVER_READY, data);
|
|
20
20
|
}
|
|
21
21
|
};
|
|
@@ -9,6 +9,8 @@ module.exports = async (pluginConfig, hermione, srcPaths, {destination: destPath
|
|
|
9
9
|
serverUtils.saveStaticFilesToReportDir(hermione, pluginConfig, destPath),
|
|
10
10
|
serverUtils.writeDatabaseUrlsFile(destPath, srcPaths)
|
|
11
11
|
]);
|
|
12
|
+
|
|
13
|
+
await hermione.htmlReporter.emitAsync(hermione.htmlReporter.events.REPORT_SAVED, {reportPath: destPath});
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
function validateOpts(srcPaths, destPath) {
|
package/lib/plugin-adapter.js
CHANGED
|
@@ -55,7 +55,12 @@ module.exports = class PluginAdapter {
|
|
|
55
55
|
staticReportBuilder.saveStaticFiles(),
|
|
56
56
|
prepareData(this._hermione, staticReportBuilder, this._config)
|
|
57
57
|
])
|
|
58
|
-
.then(() => staticReportBuilder.finalize())
|
|
58
|
+
.then(() => staticReportBuilder.finalize())
|
|
59
|
+
.then(async () => {
|
|
60
|
+
const htmlReporter = this._hermione.htmlReporter;
|
|
61
|
+
|
|
62
|
+
await htmlReporter.emitAsync(htmlReporter.events.REPORT_SAVED, {reportPath: this._config.path});
|
|
63
|
+
});
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
async _run(prepareData) {
|
package/lib/plugin-api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const EventsEmitter2 = require('eventemitter2');
|
|
4
4
|
const pluginEvents = require('./constants/plugin-events');
|
|
5
5
|
const {downloadDatabases, mergeDatabases, getTestsTreeFromDatabase} = require('./db-utils/server');
|
|
6
6
|
|
|
7
|
-
module.exports = class HtmlReporter extends
|
|
7
|
+
module.exports = class HtmlReporter extends EventsEmitter2 {
|
|
8
8
|
static create(config) {
|
|
9
9
|
return new this(config);
|
|
10
10
|
}
|