html-reporter 8.0.0 → 8.2.0
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 +40 -0
- package/lib/gui/server.js +3 -2
- package/lib/gui/tool-runner/utils.js +3 -2
- package/lib/static/components/bottom-progress-bar/index.js +38 -0
- package/lib/static/components/gui.js +2 -0
- package/lib/static/components/report.js +2 -0
- package/lib/static/components/section/section-browser.js +1 -0
- package/lib/static/components/section/title/browser.js +3 -2
- package/lib/static/components/suites.js +39 -5
- package/lib/static/data.js +611 -0
- package/lib/static/databaseUrls.json +1 -0
- package/lib/static/gui.min.css +1 -1
- package/lib/static/gui.min.js +12 -12
- package/lib/static/modules/action-names.js +2 -1
- package/lib/static/modules/actions.js +1 -0
- package/lib/static/modules/default-state.js +4 -1
- package/lib/static/modules/reducers/bottom-progress-bar.js +16 -0
- package/lib/static/modules/reducers/index.js +3 -1
- package/lib/static/report.min.css +1 -1
- package/lib/static/report.min.js +12 -12
- package/lib/static/styles.css +41 -0
- package/package.json +1 -1
- package/sqlite.db +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
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="8.2.0"></a>
|
|
6
|
+
# [8.2.0](https://github.com/gemini-testing/html-reporter/compare/v8.1.0...v8.2.0) (2022-01-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* do not put space before title if there is no root suite ([f905879](https://github.com/gemini-testing/html-reporter/commit/f905879))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="8.1.0"></a>
|
|
16
|
+
# [8.1.0](https://github.com/gemini-testing/html-reporter/compare/v8.0.2...v8.1.0) (2022-01-13)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* implemented progress-bar of scroll ([49d5631](https://github.com/gemini-testing/html-reporter/commit/49d5631))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<a name="8.0.2"></a>
|
|
26
|
+
## [8.0.2](https://github.com/gemini-testing/html-reporter/compare/v8.0.1...v8.0.2) (2021-12-28)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* copy link for skipped test ([9d0df96](https://github.com/gemini-testing/html-reporter/commit/9d0df96))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<a name="8.0.1"></a>
|
|
36
|
+
## [8.0.1](https://github.com/gemini-testing/html-reporter/compare/v8.0.0...v8.0.1) (2021-12-01)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* **gui:** stop endlessly restarting tests ([#412](https://github.com/gemini-testing/html-reporter/issues/412)) ([fb8a397](https://github.com/gemini-testing/html-reporter/commit/fb8a397))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
5
45
|
<a name="8.0.0"></a>
|
|
6
46
|
# [8.0.0](https://github.com/gemini-testing/html-reporter/compare/v7.7.1...v8.0.0) (2021-11-25)
|
|
7
47
|
|
package/lib/gui/server.js
CHANGED
|
@@ -54,9 +54,10 @@ exports.start = async ({paths, hermione, guiApi, configs}) => {
|
|
|
54
54
|
res.json(app.data);
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
server.post('/run',
|
|
57
|
+
server.post('/run', (req, res) => {
|
|
58
58
|
try {
|
|
59
|
-
|
|
59
|
+
// do not wait for completion so that response does not hang and browser does not restart it by timeout
|
|
60
|
+
app.run(req.body);
|
|
60
61
|
res.sendStatus(OK);
|
|
61
62
|
} catch (e) {
|
|
62
63
|
res.status(INTERNAL_SERVER_ERROR).send(`Error while trying to run tests: ${e.message}`);
|
|
@@ -20,8 +20,9 @@ exports.getShortMD5 = (str) => {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
exports.mkFullTitle = ({suite, state}) => {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
return suite.path.length > 0
|
|
24
|
+
? `${suite.path.join(' ')} ${state.name}`
|
|
25
|
+
: state.name;
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
// 'databaseUrls.json' may contain many databases urls but html-reporter at gui mode can work with single databases file.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import {extend} from 'lodash';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import {connect} from 'react-redux';
|
|
6
|
+
|
|
7
|
+
import {getVisibleRootSuiteIds} from '../../modules/selectors/tree';
|
|
8
|
+
|
|
9
|
+
const BottomProgressBar = (props) => {
|
|
10
|
+
const {progressBar: {currentRootSuiteId}, visibleRootSuiteIds} = props;
|
|
11
|
+
const suiteIdsIndexMap = React.useMemo(
|
|
12
|
+
() => visibleRootSuiteIds.reduce((map, suiteId, idx) => extend(map, {[suiteId]: idx}), {}),
|
|
13
|
+
[visibleRootSuiteIds]
|
|
14
|
+
);
|
|
15
|
+
const currentRootSuiteIdx = suiteIdsIndexMap[currentRootSuiteId];
|
|
16
|
+
const percent = 100 / (visibleRootSuiteIds.length - 1) * currentRootSuiteIdx;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className="bottom-progress-bar">
|
|
20
|
+
<div className='bottom-progress-bar__progress-container'>
|
|
21
|
+
<div className='bottom-progress-bar__progress-bar' style={{width: `${percent}%`}}></div>
|
|
22
|
+
<div className='bottom-progress-bar__counter'>
|
|
23
|
+
{currentRootSuiteId}
|
|
24
|
+
<span>
|
|
25
|
+
{' '}(<strong>{currentRootSuiteIdx + 1}</strong> suite of <strong>{visibleRootSuiteIds.length}</strong>)
|
|
26
|
+
</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default connect(
|
|
34
|
+
(state) => ({
|
|
35
|
+
progressBar: state.progressBar,
|
|
36
|
+
visibleRootSuiteIds: getVisibleRootSuiteIds(state)
|
|
37
|
+
}),
|
|
38
|
+
)(BottomProgressBar);
|
|
@@ -16,6 +16,7 @@ import CustomScripts from './custom-scripts';
|
|
|
16
16
|
import clientEvents from '../../gui/constants/client-events';
|
|
17
17
|
import FaviconChanger from './favicon-changer';
|
|
18
18
|
import ExtensionPoint from './extension-point';
|
|
19
|
+
import BottomProgressBar from './bottom-progress-bar';
|
|
19
20
|
|
|
20
21
|
class Gui extends Component {
|
|
21
22
|
static propTypes = {
|
|
@@ -87,6 +88,7 @@ class Gui extends Component {
|
|
|
87
88
|
</main>
|
|
88
89
|
<Loading active={loading.active} content={loading.content} />
|
|
89
90
|
<ModalContainer />
|
|
91
|
+
<BottomProgressBar />
|
|
90
92
|
</ExtensionPoint>
|
|
91
93
|
</Fragment>
|
|
92
94
|
);
|
|
@@ -15,6 +15,7 @@ import MainTree from './main-tree';
|
|
|
15
15
|
import CustomScripts from './custom-scripts';
|
|
16
16
|
import FaviconChanger from './favicon-changer';
|
|
17
17
|
import ExtensionPoint from './extension-point';
|
|
18
|
+
import BottomProgressBar from './bottom-progress-bar';
|
|
18
19
|
|
|
19
20
|
class Report extends Component {
|
|
20
21
|
static propTypes = {
|
|
@@ -56,6 +57,7 @@ class Report extends Component {
|
|
|
56
57
|
<SkippedList />
|
|
57
58
|
<MainTree />
|
|
58
59
|
</main>
|
|
60
|
+
<BottomProgressBar />
|
|
59
61
|
</ExtensionPoint>
|
|
60
62
|
</Fragment>
|
|
61
63
|
);
|
|
@@ -14,6 +14,7 @@ class BrowserTitle extends Component {
|
|
|
14
14
|
static propTypes = {
|
|
15
15
|
title: PropTypes.node.isRequired,
|
|
16
16
|
browserId: PropTypes.string.isRequired,
|
|
17
|
+
browserName: PropTypes.string.isRequired,
|
|
17
18
|
lastResultId: PropTypes.string.isRequired,
|
|
18
19
|
handler: PropTypes.func.isRequired,
|
|
19
20
|
// from store
|
|
@@ -30,10 +31,10 @@ class BrowserTitle extends Component {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
_getTestUrl() {
|
|
33
|
-
const {
|
|
34
|
+
const {browserName, testName, retryIndex} = this.props;
|
|
34
35
|
|
|
35
36
|
return appendQuery(window.location.href, {
|
|
36
|
-
browser:
|
|
37
|
+
browser: browserName,
|
|
37
38
|
testNameFilter: testName,
|
|
38
39
|
strictMatchFilter: true,
|
|
39
40
|
retryIndex,
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, {Component} from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import {connect} from 'react-redux';
|
|
4
|
-
import {isEmpty, flatMap} from 'lodash';
|
|
4
|
+
import {isEmpty, flatMap, find, once, throttle} from 'lodash';
|
|
5
5
|
import {List, AutoSizer, CellMeasurer, CellMeasurerCache, WindowScroller} from 'react-virtualized';
|
|
6
6
|
import ResizeObserver from 'rc-resize-observer';
|
|
7
|
+
import {bindActionCreators} from 'redux';
|
|
7
8
|
|
|
9
|
+
import * as actions from '../modules/actions';
|
|
8
10
|
import SectionCommon from './section/section-common';
|
|
9
11
|
import viewModes from '../../constants/view-modes';
|
|
10
12
|
import {getVisibleRootSuiteIds} from '../modules/selectors/tree';
|
|
@@ -18,7 +20,7 @@ class Suites extends Component {
|
|
|
18
20
|
|
|
19
21
|
_suitesMeasurementCache = new CellMeasurerCache({
|
|
20
22
|
fixedWidth: true,
|
|
21
|
-
defaultHeight:
|
|
23
|
+
defaultHeight: 40
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
_renderRow = ({index, key, style, parent}) => {
|
|
@@ -39,7 +41,7 @@ class Suites extends Component {
|
|
|
39
41
|
rowIndex={index}
|
|
40
42
|
>
|
|
41
43
|
{({measure}) => (
|
|
42
|
-
<div key={key} style={style}>
|
|
44
|
+
<div key={key} style={style} className="virtualized__row">
|
|
43
45
|
<ResizeObserver onResize={measure}>
|
|
44
46
|
<SectionCommon {...sectionProps} />
|
|
45
47
|
</ResizeObserver>
|
|
@@ -49,6 +51,36 @@ class Suites extends Component {
|
|
|
49
51
|
);
|
|
50
52
|
}
|
|
51
53
|
|
|
54
|
+
_recalculateBottomProgressBar = throttle(() => {
|
|
55
|
+
const {actions} = this.props;
|
|
56
|
+
const nodes = Array.from(document.querySelectorAll('.virtualized__row'));
|
|
57
|
+
|
|
58
|
+
let visibleNode = find(nodes.slice().reverse(), (node) => {
|
|
59
|
+
const rect = node.getBoundingClientRect();
|
|
60
|
+
const bottomViewportWindow = document.documentElement.clientHeight - this._suitesMeasurementCache.defaultHeight;
|
|
61
|
+
|
|
62
|
+
return rect.top > 0 && rect.top <= bottomViewportWindow;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
if (!visibleNode) {
|
|
66
|
+
visibleNode = find(nodes, (node) => {
|
|
67
|
+
const rect = node.getBoundingClientRect();
|
|
68
|
+
|
|
69
|
+
return rect.bottom > 0;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (!visibleNode) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const suiteId = visibleNode.querySelector('.section__title').textContent;
|
|
78
|
+
|
|
79
|
+
actions.updateBottomProgressBar({currentRootSuiteId: suiteId});
|
|
80
|
+
}, 100)
|
|
81
|
+
|
|
82
|
+
_calculateInitialBottomProgressBar = once(() => setTimeout(this._recalculateBottomProgressBar, 0));
|
|
83
|
+
|
|
52
84
|
_getSelectedFiltersInfo() {
|
|
53
85
|
const {viewMode, filteredBrowsers, testNameFilter, strictMatchFilter} = this.props;
|
|
54
86
|
const msgs = [];
|
|
@@ -86,7 +118,7 @@ class Suites extends Component {
|
|
|
86
118
|
|
|
87
119
|
return (
|
|
88
120
|
<div className="sections">
|
|
89
|
-
<WindowScroller>
|
|
121
|
+
<WindowScroller onScroll={this._recalculateBottomProgressBar}>
|
|
90
122
|
{({height, isScrolling, onChildScroll, scrollTop}) => (
|
|
91
123
|
<AutoSizer disableHeight>
|
|
92
124
|
{({width}) => (
|
|
@@ -97,6 +129,7 @@ class Suites extends Component {
|
|
|
97
129
|
isScrolling={isScrolling}
|
|
98
130
|
onScroll={onChildScroll}
|
|
99
131
|
scrollTop={scrollTop}
|
|
132
|
+
onRowsRendered={this._calculateInitialBottomProgressBar}
|
|
100
133
|
deferredMeasurementCache={this._suitesMeasurementCache}
|
|
101
134
|
rowHeight={this._suitesMeasurementCache.rowHeight}
|
|
102
135
|
rowCount={visibleRootSuiteIds.length}
|
|
@@ -119,5 +152,6 @@ export default connect(
|
|
|
119
152
|
filteredBrowsers: state.view.filteredBrowsers,
|
|
120
153
|
testNameFilter: state.view.testNameFilter,
|
|
121
154
|
strictMatchFilter: state.view.strictMatchFilter
|
|
122
|
-
})
|
|
155
|
+
}),
|
|
156
|
+
(dispatch) => ({actions: bindActionCreators(actions, dispatch)})
|
|
123
157
|
)(Suites);
|