html-reporter 8.4.3 → 9.1.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +33 -1
  3. package/lib/config/index.js +17 -6
  4. package/lib/constants/defaults.js +2 -1
  5. package/lib/constants/diff-modes.js +32 -0
  6. package/lib/constants/plugin-events.js +2 -1
  7. package/lib/server-utils.js +1 -1
  8. package/lib/static/components/controls/common-controls.js +17 -15
  9. package/lib/static/components/controls/control-select/index.js +50 -0
  10. package/lib/static/components/controls/control-select/index.styl +44 -0
  11. package/lib/static/components/controls/controls.less +0 -31
  12. package/lib/static/components/icons/arrows-move.js +24 -0
  13. package/lib/static/components/modals/screenshot-accepter/body.js +4 -12
  14. package/lib/static/components/modals/screenshot-accepter/header.js +3 -32
  15. package/lib/static/components/state/index.js +2 -9
  16. package/lib/static/components/state/{diff-circle.js → screenshot/diff-circle.js} +1 -1
  17. package/lib/static/components/state/screenshot/full.js +28 -0
  18. package/lib/static/components/state/{screenshot.js → screenshot/resized.js} +28 -30
  19. package/lib/static/components/state/screenshot/with-encode-uri.js +44 -0
  20. package/lib/static/components/state/screenshot/with-synced-scale.js +116 -0
  21. package/lib/static/components/state/state-error.js +3 -3
  22. package/lib/static/components/state/state-fail/index.js +142 -0
  23. package/lib/static/components/state/state-fail/index.styl +31 -0
  24. package/lib/static/components/state/state-fail/onion-skin-diff/index.js +43 -0
  25. package/lib/static/components/state/state-fail/onion-skin-diff/index.styl +19 -0
  26. package/lib/static/components/state/state-fail/prop-types.js +16 -0
  27. package/lib/static/components/state/state-fail/swipe-diff/index.js +138 -0
  28. package/lib/static/components/state/state-fail/swipe-diff/index.styl +82 -0
  29. package/lib/static/components/state/state-fail/switch-diff/index.js +36 -0
  30. package/lib/static/components/state/state-fail/switch-diff/index.styl +12 -0
  31. package/lib/static/components/state/state-success.js +2 -2
  32. package/lib/static/gui.html +13 -0
  33. package/lib/static/gui.min.css +678 -0
  34. package/lib/static/gui.min.js +106 -0
  35. package/lib/static/index.html +13 -0
  36. package/lib/static/modules/action-names.js +6 -2
  37. package/lib/static/modules/actions.js +27 -3
  38. package/lib/static/modules/default-state.js +2 -2
  39. package/lib/static/modules/middlewares/local-storage.js +1 -2
  40. package/lib/static/modules/middlewares/metrika.js +6 -2
  41. package/lib/static/modules/reducers/view.js +27 -12
  42. package/lib/static/report.min.css +678 -0
  43. package/lib/static/report.min.js +106 -0
  44. package/lib/static/styles.css +3 -11
  45. package/lib/test-adapter.js +11 -2
  46. package/package.json +4 -2
  47. package/webpack.common.js +7 -0
  48. package/lib/static/components/controls/view-select.js +0 -50
  49. package/lib/static/components/state/state-fail.js +0 -56
@@ -257,25 +257,21 @@ main.container {
257
257
 
258
258
  .image-box__container,
259
259
  .image-box__screenshot-container {
260
+ display: flex;
261
+ flex-direction: column;
260
262
  margin-top: 10px;
261
263
  }
262
264
 
263
- .image-box__container:not(.image-box__container_scale) .image-box__image:not(:last-child) {
265
+ .image-box__container .image-box__image:not(:last-child) {
264
266
  margin-bottom: 5px;
265
267
  }
266
268
 
267
- .image-box__container_scale {
268
- display: flex;
269
- flex-flow: row wrap;
270
- }
271
-
272
269
  .report_show-only-errors .section_status_success,
273
270
  .report_show-only-errors .section_status_skipped {
274
271
  display: none;
275
272
  }
276
273
 
277
274
  .image-box__image {
278
- padding-right: 10px;
279
275
  display: inline-block;
280
276
  vertical-align: top;
281
277
  flex-basis: 33.333%;
@@ -284,10 +280,6 @@ main.container {
284
280
  max-width: 100%;
285
281
  }
286
282
 
287
- .image-box__image:last-child {
288
- margin-right: -10px;
289
- }
290
-
291
283
  .image-box__image.image-box__image_single {
292
284
  display: block;
293
285
  padding-right: 0px;
@@ -330,8 +330,8 @@ module.exports = class TestAdapter {
330
330
  await fs.writeFile(detailsFilePath, detailsData);
331
331
  }
332
332
 
333
- saveTestImages(reportPath, workers) {
334
- return Promise.map(this.assertViewResults, async (assertResult) => {
333
+ async saveTestImages(reportPath, workers) {
334
+ const result = await Promise.map(this.assertViewResults, async (assertResult) => {
335
335
  const {stateName} = assertResult;
336
336
  const destRefPath = utils.getReferencePath(this, stateName);
337
337
  const srcRefPath = this.getRefImg(stateName).path;
@@ -363,6 +363,15 @@ module.exports = class TestAdapter {
363
363
 
364
364
  return Promise.all(actions);
365
365
  });
366
+
367
+ const htmlReporter = this._hermione.htmlReporter;
368
+ htmlReporter.emit(htmlReporter.events.TEST_SCREENSHOTS_SAVED, {
369
+ testId: this._testId,
370
+ attempt: this.attempt,
371
+ imagesInfo: this.getImagesInfo()
372
+ });
373
+
374
+ return result;
366
375
  }
367
376
 
368
377
  //parallelize and cache of 'gemini-core.Image.buildDiff' (because it is very slow)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-reporter",
3
- "version": "8.4.3",
3
+ "version": "9.1.1",
4
4
  "description": "Plugin for hermione which is intended to aggregate the results of tests running into html report",
5
5
  "scripts": {
6
6
  "coverage": "nyc npm run test-unit",
@@ -71,7 +71,7 @@
71
71
  "react-html-parser": "^2.0.2",
72
72
  "react-markdown": "^3.2.0",
73
73
  "reapop": "2.1.0",
74
- "reapop-theme-wybo": "1.0.2",
74
+ "reapop-theme-wybo": "^1.1.0",
75
75
  "reduce-reducers": "^1.0.4",
76
76
  "reselect": "^4.0.0",
77
77
  "resolve": "^1.5.0",
@@ -149,6 +149,8 @@
149
149
  "standard-version": "^4.0.0",
150
150
  "style-loader": "^0.19.0",
151
151
  "styled-components": "^3.4.10",
152
+ "stylus": "^0.57.0",
153
+ "stylus-loader": "^3.0.2",
152
154
  "url-loader": "^1.1.2",
153
155
  "webpack": "^3.6.0",
154
156
  "webpack-dev-server": "^2.11.5",
package/webpack.common.js CHANGED
@@ -38,6 +38,13 @@ module.exports = {
38
38
  use: ['css-loader', 'less-loader']
39
39
  })
40
40
  },
41
+ {
42
+ test: /\.styl$/,
43
+ loader: ExtractTextPlugin.extract({
44
+ fallback: 'style-loader',
45
+ use: ['css-loader', 'stylus-loader']
46
+ })
47
+ },
41
48
  {
42
49
  test: /\.js$/,
43
50
  use: 'babel-loader',
@@ -1,50 +0,0 @@
1
- 'use strict';
2
-
3
- import React, {Component} from 'react';
4
- import PropTypes from 'prop-types';
5
- import {bindActionCreators} from 'redux';
6
- import {connect} from 'react-redux';
7
- import {Dropdown} from 'semantic-ui-react';
8
- import * as actions from '../../modules/actions';
9
-
10
- class ViewSelect extends Component {
11
- static propTypes = {
12
- viewMode: PropTypes.string.isRequired,
13
- actions: PropTypes.object.isRequired,
14
- options: PropTypes.array.isRequired
15
- }
16
-
17
- constructor(props) {
18
- super(props);
19
- }
20
-
21
- _onChange = (_, dom) => {
22
- this.props.actions.changeViewMode(dom.value);
23
- }
24
-
25
- render() {
26
- const {viewMode, options} = this.props;
27
- const formatedOpts = options.map(({value, text}) => ({
28
- value,
29
- text,
30
- key: value
31
- }));
32
-
33
- return (
34
- <div className="viewmode">
35
- <Dropdown
36
- fluid
37
- selection
38
- options={formatedOpts}
39
- value={viewMode}
40
- onChange={this._onChange}
41
- />
42
- </div>
43
- );
44
- }
45
- }
46
-
47
- export default connect(
48
- ({view}) => ({viewMode: view.viewMode}),
49
- (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
50
- )(ViewSelect);
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- import React, {Component, Fragment} from 'react';
4
- import {connect} from 'react-redux';
5
- import PropTypes from 'prop-types';
6
- import Screenshot from './screenshot';
7
-
8
- class StateFail extends Component {
9
- static propTypes = {
10
- image: PropTypes.shape({
11
- expectedImg: PropTypes.object.isRequired,
12
- actualImg: PropTypes.object.isRequired,
13
- diffImg: PropTypes.object.isRequired,
14
- diffClusters: PropTypes.array
15
- }).isRequired,
16
- // from store
17
- showOnlyDiff: PropTypes.bool.isRequired
18
- }
19
-
20
- render() {
21
- const {image: {expectedImg, actualImg, diffImg, diffClusters}} = this.props;
22
-
23
- return (
24
- <Fragment>
25
- {this._drawExpectedAndActual(expectedImg, actualImg)}
26
- {this._drawImageBox('Diff', diffImg, diffClusters)}
27
- </Fragment>
28
- );
29
- }
30
-
31
- _drawExpectedAndActual(expectedImg, actualImg) {
32
- if (this.props.showOnlyDiff) {
33
- return null;
34
- }
35
-
36
- return (
37
- <Fragment>
38
- {this._drawImageBox('Expected', expectedImg)}
39
- {this._drawImageBox('Actual', actualImg)}
40
- </Fragment>
41
- );
42
- }
43
-
44
- _drawImageBox(label, diffImg, diffClusters) {
45
- return (
46
- <div className="image-box__image">
47
- <div className="image-box__title">{label}</div>
48
- <Screenshot image={diffImg} diffClusters={diffClusters}/>
49
- </div>
50
- );
51
- }
52
- }
53
-
54
- export default connect(
55
- ({view: {showOnlyDiff}}) => ({showOnlyDiff})
56
- )(StateFail);