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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,41 @@
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.1.1"></a>
6
+ ## [9.1.1](https://github.com/gemini-testing/html-reporter/compare/v9.1.0...v9.1.1) (2022-08-04)
7
+
8
+
9
+
10
+ <a name="9.1.0"></a>
11
+ # [9.1.0](https://github.com/gemini-testing/html-reporter/compare/v9.0.0...v9.1.0) (2022-08-04)
12
+
13
+
14
+ ### Features
15
+
16
+ * add TEST_SCREENSHOTS_SAVED event ([e50ab0f](https://github.com/gemini-testing/html-reporter/commit/e50ab0f))
17
+
18
+
19
+
20
+ <a name="9.0.0"></a>
21
+ # [9.0.0](https://github.com/gemini-testing/html-reporter/compare/v8.4.4...v9.0.0) (2022-05-20)
22
+
23
+
24
+ ### Features
25
+
26
+ * add new modes to view image diffs ([318c3b4](https://github.com/gemini-testing/html-reporter/commit/318c3b4))
27
+
28
+
29
+ ### BREAKING CHANGES
30
+
31
+ * remove "scaleImages" option from config
32
+
33
+
34
+
35
+ <a name="8.4.4"></a>
36
+ ## [8.4.4](https://github.com/gemini-testing/html-reporter/compare/v8.4.3...v8.4.4) (2022-04-29)
37
+
38
+
39
+
5
40
  <a name="8.4.3"></a>
6
41
  ## [8.4.3](https://github.com/gemini-testing/html-reporter/compare/v8.4.2...v8.4.3) (2022-04-26)
7
42
 
package/README.md CHANGED
@@ -41,8 +41,16 @@ directory.
41
41
  * `all` - show all tests. Default value.
42
42
  * `failed` - show only failed tests.
43
43
 
44
+ * **diffMode** (optional) - `String` - default diff mode. Available values are:
45
+
46
+ * `3-up` - show all images (expected, actual, diff) in column. Default value;
47
+ * `3-up-scaled` - show all images in row (fit into page width);
48
+ * `only-diff` - show only diff image;
49
+ * `switch` - mode with ability to switch between expected and actual images (use click on mouse in images field to switch);
50
+ * `swipe` - mode with ability to move divider between expected and actual images;
51
+ * `onion-skin` - mode with ability to change the transparency of actual image.
52
+
44
53
  * **baseHost** (optional) - `String` - it changes original host for view in the browser; by default original host does not change
45
- * **scaleImages** (optional) – `Boolean` – fit images into page width; `false` by default.
46
54
  * **errorPatterns** (optional) - `Array` - error message patterns are used:
47
55
 
48
56
  * to show more understandable information about matched error;
@@ -526,6 +534,7 @@ Property name | Description
526
534
  Event | Description
527
535
  ------------------------- | -------------
528
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` | Will be triggered after test screenshots were saved. The handler accepts test id and screenshots info. The event is synchronous.
529
538
 
530
539
  ### events
531
540
 
@@ -546,6 +555,29 @@ module.exports = (hermione, opts) => {
546
555
  };
547
556
  ```
548
557
 
558
+ Example of a subscription to an event `TEST_SCREENSHOTS_SAVED`:
559
+
560
+ ```js
561
+ hermione.htmlReporter.on(hermione.htmlReporter.events.TEST_SCREENSHOTS_SAVED, ({testId, attempt, imagesInfo}) => {
562
+ console.log(`Screenshots for test "${testId}" (attempt #${attempt}) were saved:`, imagesInfo);
563
+ /* Expected output:
564
+ Screenshots for test "Feature Test.chrome-desktop" (attempt #0) were saved:
565
+ [
566
+ {
567
+ stateName: 'plain',
568
+ refImg: { path: '...', size: { width: 400, height: 200 } },
569
+ status: 'fail',
570
+ error: undefined,
571
+ diffClusters: [...],
572
+ expectedImg: { path: '...', size: { width: 400, height: 200 } }
573
+ actualImg: { path: '...', size: { width: 400, height: 200 } }
574
+ diffImg: { path: '...', size: { width: 400, height: 200 } }
575
+ }
576
+ ]
577
+ */
578
+ });
579
+ ```
580
+
549
581
  ### addExtraItem
550
582
 
551
583
  Adds item to html report as link:
@@ -6,6 +6,7 @@ const chalk = require('chalk');
6
6
 
7
7
  const {logger} = require('../common-utils');
8
8
  const {config: configDefaults} = require('../constants/defaults');
9
+ const diffModes = require('../constants/diff-modes');
9
10
  const saveFormats = require('../constants/save-formats');
10
11
  const {assertCustomGui} = require('./custom-gui-asserts');
11
12
 
@@ -114,6 +115,18 @@ const assertPluginDescription = (description) => {
114
115
  return true;
115
116
  };
116
117
 
118
+ const assertDiffMode = (diffMode) => {
119
+ if (!_.isString(diffMode)) {
120
+ throw new Error(`"diffMode" option must be a string, but got ${typeof diffMode}`);
121
+ }
122
+
123
+ const availableValues = Object.values(diffModes).map(v => v.id);
124
+
125
+ if (!availableValues.includes(diffMode)) {
126
+ throw new Error(`"diffMode" must be one of "${availableValues.join('", "')}", but got "${diffMode}"`);
127
+ }
128
+ };
129
+
117
130
  const mapErrorPatterns = (errorPatterns) => {
118
131
  return errorPatterns.map(patternInfo => {
119
132
  return _.isString(patternInfo)
@@ -156,16 +169,14 @@ const getParser = () => {
156
169
  defaultValue: configDefaults.defaultView,
157
170
  validate: assertString('defaultView')
158
171
  }),
172
+ diffMode: option({
173
+ defaultValue: configDefaults.diffMode,
174
+ validate: assertDiffMode
175
+ }),
159
176
  baseHost: option({
160
177
  defaultValue: configDefaults.baseHost,
161
178
  validate: assertString('baseHost')
162
179
  }),
163
- scaleImages: option({
164
- defaultValue: configDefaults.scaleImages,
165
- parseEnv: JSON.parse,
166
- parseCli: JSON.parse,
167
- validate: assertBoolean('scaleImages')
168
- }),
169
180
  lazyLoadOffset: option({
170
181
  defaultValue: configDefaults.lazyLoadOffset,
171
182
  validate: (value) => _.isNull(value) || deprecationWarning('lazyLoadOffset')
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const diffModes = require('./diff-modes');
3
4
  const viewModes = require('./view-modes');
4
5
 
5
6
  module.exports = {
@@ -8,8 +9,8 @@ module.exports = {
8
9
  saveErrorDetails: false,
9
10
  commandsWithShortHistory: [],
10
11
  defaultView: viewModes.ALL,
12
+ diffMode: diffModes.THREE_UP.id,
11
13
  baseHost: '',
12
- scaleImages: false,
13
14
  lazyLoadOffset: null,
14
15
  errorPatterns: [],
15
16
  metaInfoBaseUrls: {},
@@ -0,0 +1,32 @@
1
+ module.exports = {
2
+ THREE_UP: {
3
+ id: '3-up',
4
+ title: '3-up',
5
+ description: 'images in column'
6
+ },
7
+ THREE_UP_SCALED: {
8
+ id: '3-up-scaled',
9
+ title: '3-up scaled',
10
+ description: 'scaled images in row'
11
+ },
12
+ ONLY_DIFF: {
13
+ id: 'only-diff',
14
+ title: 'Only diff',
15
+ description: 'click on image to see area with diff'
16
+ },
17
+ SWITCH: {
18
+ id: 'switch',
19
+ title: 'Switch',
20
+ description: 'click on image to switch'
21
+ },
22
+ SWIPE: {
23
+ id: 'swipe',
24
+ title: 'Swipe',
25
+ description: 'move divider'
26
+ },
27
+ ONION_SKIN: {
28
+ id: 'onion-skin',
29
+ title: 'Onion skin',
30
+ description: 'move slider'
31
+ }
32
+ };
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const getSyncEvents = () => ({
4
- DATABASE_CREATED: 'databaseCreated'
4
+ DATABASE_CREATED: 'databaseCreated',
5
+ TEST_SCREENSHOTS_SAVED: 'testScreenshotsSaved'
5
6
  });
6
7
 
7
8
  const events = getSyncEvents();
@@ -180,8 +180,8 @@ function getConfigForStaticFile(pluginConfig) {
180
180
  pluginConfig,
181
181
  [
182
182
  'defaultView',
183
+ 'diffMode',
183
184
  'baseHost',
184
- 'scaleImages',
185
185
  'errorPatterns',
186
186
  'metaInfoBaseUrls',
187
187
  'customScripts',
@@ -1,13 +1,14 @@
1
- 'use strict';
2
1
  import React, {Component} from 'react';
3
2
  import {bindActionCreators} from 'redux';
4
3
  import {connect} from 'react-redux';
4
+ import {capitalize} from 'lodash';
5
5
  import * as actions from '../../modules/actions';
6
6
  import ControlButton from './control-button';
7
- import ViewSelect from './view-select';
7
+ import ControlSelect from './control-select';
8
8
  import BaseHostInput from './base-host-input';
9
9
  import MenuBar from './menu-bar';
10
10
  import viewModes from '../../../constants/view-modes';
11
+ import diffModes from '../../../constants/diff-modes';
11
12
  import {EXPAND_ALL, COLLAPSE_ALL, EXPAND_ERRORS, EXPAND_RETRIES} from '../../../constants/expand-modes';
12
13
 
13
14
  class ControlButtons extends Component {
@@ -16,10 +17,12 @@ class ControlButtons extends Component {
16
17
 
17
18
  return (
18
19
  <div className="common-controls">
19
- <ViewSelect options = {[
20
- {value: viewModes.ALL, text: 'Show all'},
21
- {value: viewModes.FAILED, text: 'Show only failed'}
22
- ]}/>
20
+ <ControlSelect
21
+ label="Show tests"
22
+ value={view.viewMode}
23
+ handler={actions.changeViewMode}
24
+ options = {Object.values(viewModes).map((value) => ({value, text: capitalize(value)}))}
25
+ />
23
26
  <div className="control-group">
24
27
  <ControlButton
25
28
  label="Expand all"
@@ -51,15 +54,14 @@ class ControlButtons extends Component {
51
54
  isActive={view.showSkipped}
52
55
  handler={actions.toggleSkipped}
53
56
  />
54
- <ControlButton
55
- label="Show only diff"
56
- isActive={view.showOnlyDiff}
57
- handler={actions.toggleOnlyDiff}
58
- />
59
- <ControlButton
60
- label="Scale images"
61
- isActive={view.scaleImages}
62
- handler={actions.toggleScaleImages}
57
+ <ControlSelect
58
+ label="Diff mode"
59
+ value={view.diffMode}
60
+ handler={actions.changeDiffMode}
61
+ options = {Object.values(diffModes).map((dm) => {
62
+ return {value: dm.id, text: dm.title};
63
+ })}
64
+ extendClassNames="diff-mode"
63
65
  />
64
66
  <ControlButton
65
67
  label="Group by error"
@@ -0,0 +1,50 @@
1
+ import React, {Component} from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import {Label, Dropdown} from 'semantic-ui-react';
4
+ import classNames from 'classnames';
5
+
6
+ import './index.styl';
7
+
8
+ export default class ControlSelect extends Component {
9
+ static propTypes = {
10
+ label: PropTypes.string.isRequired,
11
+ value: PropTypes.string.isRequired,
12
+ handler: PropTypes.func.isRequired,
13
+ options: PropTypes.arrayOf(PropTypes.shape({
14
+ value: PropTypes.string,
15
+ text: PropTypes.string
16
+ })).isRequired,
17
+ extendClassNames: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
18
+ }
19
+
20
+ _onChange = (_, dom) => {
21
+ this.props.handler(dom.value);
22
+ }
23
+
24
+ render() {
25
+ const {value, label, options, extendClassNames} = this.props;
26
+ const formattedOpts = options.map(({value, text}) => ({
27
+ value,
28
+ text,
29
+ key: value
30
+ }));
31
+
32
+ const className = classNames(
33
+ 'control-select',
34
+ extendClassNames
35
+ );
36
+
37
+ return (
38
+ <div className={className}>
39
+ <Label className="control-select__label">{label}</Label>
40
+ <Dropdown
41
+ className="control-select__dropdown"
42
+ selection
43
+ options={formattedOpts}
44
+ value={value}
45
+ onChange={this._onChange}
46
+ />
47
+ </div>
48
+ );
49
+ }
50
+ }
@@ -0,0 +1,44 @@
1
+ .control-select
2
+ display: inline-flex
3
+ margin-right: 15px
4
+ margin-bottom: 15px
5
+
6
+ .control-select__label
7
+ font-size: 11px
8
+ margin: 0
9
+ padding: 0 5px
10
+ line-height: 25px
11
+ background-color: #e7e7e7
12
+ border-radius: 2px
13
+ border-top-right-radius: 0
14
+ border-bottom-right-radius: 0
15
+
16
+ .control-select__dropdown.ui.dropdown
17
+ min-height: 25px
18
+ min-width: 60px
19
+ font-size: 11px
20
+ line-height: 13px
21
+ padding: 5px
22
+ border: 1px solid #ccc
23
+ border-radius: 2px
24
+ border-top-left-radius: 0
25
+ border-bottom-left-radius: 0
26
+
27
+ &:hover
28
+ border: 1px solid #555;
29
+
30
+ &.active
31
+ &:hover
32
+ .menu
33
+ border-color: #ffd947
34
+
35
+ .icon
36
+ top: 50%
37
+ right: 10px
38
+ padding: 0
39
+ margin: 0
40
+ transform: translateY(-50%)
41
+
42
+ &.diff-mode
43
+ .control-select__dropdown.ui.dropdown
44
+ min-width: 90px
@@ -62,34 +62,3 @@
62
62
  border-color: #555;
63
63
  }
64
64
  }
65
-
66
- .viewmode {
67
- width: 115px;
68
- display: inline-block;
69
- margin-right: 15px;
70
- margin-bottom: 15px;
71
- }
72
-
73
- .viewmode .ui.fluid.dropdown {
74
- font-size: 11px;
75
- }
76
-
77
- .viewmode .ui.selection.dropdown {
78
- padding: 6px;
79
- min-height: 25px;
80
- border: 1px solid #ccc;
81
- border-radius: 2px;
82
- }
83
-
84
- .viewmode .ui.selection.dropdown:hover {
85
- border: 1px solid #555;
86
- }
87
-
88
- .viewmode .ui.selection.dropdown>.dropdown.icon {
89
- top: 5px;
90
- }
91
-
92
- .viewmode .ui.selection.active.dropdown:hover,
93
- .viewmode .ui.selection.active.dropdown .menu {
94
- border-color: #ffd947;
95
- }
@@ -0,0 +1,24 @@
1
+ import React, {Component} from 'react';
2
+ import PropTypes from 'prop-types';
3
+
4
+ export default class ArrowsMove extends Component {
5
+ static propTypes = {
6
+ width: PropTypes.number,
7
+ height: PropTypes.number
8
+ }
9
+
10
+ static defaultProps = {
11
+ width: 100,
12
+ height: 100
13
+ }
14
+
15
+ render() {
16
+ const {width, height} = this.props;
17
+
18
+ return (
19
+ <svg className="arrows-move" width={width} height={height} viewBox={`-8 -3 16 6`} fill="none" xmlns="http://www.w3.org/2000/svg">
20
+ <path className="arrows-move__icon" d="M -5 -2 L -7 0 L -5 2 M 5 -2 L 7 0 L 5 2" fill="none" vectorEffect="non-scaling-stroke" />
21
+ </svg>
22
+ );
23
+ }
24
+ }
@@ -1,8 +1,7 @@
1
1
  import React, {Component, Fragment} from 'react';
2
2
  import {connect} from 'react-redux';
3
3
  import PropTypes from 'prop-types';
4
- import classNames from 'classnames';
5
- import Screenshot from '../../state/screenshot';
4
+ import ResizedScreenshot from '../../state/screenshot/resized';
6
5
  import StateFail from '../../state/state-fail';
7
6
  import {isNoRefImageError} from '../../../modules/utils';
8
7
 
@@ -16,20 +15,15 @@ class ScreenshotAccepterBody extends Component {
16
15
  error: PropTypes.object
17
16
  }),
18
17
  // from store
19
- scaleImages: PropTypes.bool.isRequired,
20
18
  testName: PropTypes.string,
21
19
  browserName: PropTypes.string
22
20
  }
23
21
 
24
22
  _renderImages() {
25
23
  const {image} = this.props;
26
- const className = classNames(
27
- 'image-box__container',
28
- {'image-box__container_scale': this.props.scaleImages}
29
- );
30
24
 
31
25
  return (
32
- <div className={className}>
26
+ <div className='image-box__container'>
33
27
  {
34
28
  isNoRefImageError(image.error)
35
29
  ? this._renderImageBox('No reference image', image.actualImg)
@@ -43,7 +37,7 @@ class ScreenshotAccepterBody extends Component {
43
37
  return (
44
38
  <div className="image-box__image">
45
39
  <div className="image-box__title">{label}</div>
46
- <Screenshot image={image} />
40
+ <ResizedScreenshot image={image} />
47
41
  </div>
48
42
  );
49
43
  }
@@ -80,13 +74,11 @@ class ScreenshotAccepterBody extends Component {
80
74
  }
81
75
 
82
76
  export default connect(
83
- ({tree, view}, {image}) => {
84
- const {scaleImages} = view;
77
+ ({tree}, {image}) => {
85
78
  const result = image ? tree.results.byId[image.parentId] : {};
86
79
  const browser = image ? tree.browsers.byId[result.parentId] : {};
87
80
 
88
81
  return {
89
- scaleImages,
90
82
  testName: browser.parentId,
91
83
  browserName: browser.name
92
84
  };
@@ -1,17 +1,14 @@
1
1
  import React, {Component, Fragment} from 'react';
2
- import {connect} from 'react-redux';
3
- import {bindActionCreators} from 'redux';
4
2
  import {GlobalHotKeys} from 'react-hotkeys';
5
3
  import PropTypes from 'prop-types';
6
4
  import {uniqBy} from 'lodash';
7
5
 
8
- import * as actions from '../../../modules/actions';
9
6
  import Arrow from '../../icons/arrow';
10
7
  import ArrowsClose from '../../icons/arrows-close';
11
8
  import ControlButton from '../../controls/control-button';
12
9
  import RetrySwitcher from '../../retry-switcher';
13
10
 
14
- class ScreenshotAccepterHeader extends Component {
11
+ export default class ScreenshotAccepterHeader extends Component {
15
12
  static propTypes = {
16
13
  images: PropTypes.arrayOf(PropTypes.shape({
17
14
  id: PropTypes.string,
@@ -23,10 +20,7 @@ class ScreenshotAccepterHeader extends Component {
23
20
  onClose: PropTypes.func.isRequired,
24
21
  onRetryChange: PropTypes.func.isRequired,
25
22
  onActiveImageChange: PropTypes.func.isRequired,
26
- onScreenshotAccept: PropTypes.func.isRequired,
27
- // from store
28
- showOnlyDiff: PropTypes.bool.isRequired,
29
- scaleImages: PropTypes.bool.isRequired
23
+ onScreenshotAccept: PropTypes.func.isRequired
30
24
  }
31
25
 
32
26
  constructor(props) {
@@ -38,8 +32,6 @@ class ScreenshotAccepterHeader extends Component {
38
32
  PREV_RETRY: ['left', 'a'],
39
33
  NEXT_RETRY: ['right', 'd'],
40
34
  ACCEPT_SCREENSHOT: ['space', 'enter'],
41
- SHOW_ONLY_DIFF: 'shift+d',
42
- SCALE_IMAGES: 'shift+s',
43
35
  CLOSE_MODAL: 'escape',
44
36
  IGNORE_META_UP: 'meta+up',
45
37
  IGNORE_META_DOWN: 'meta+down',
@@ -51,8 +43,6 @@ class ScreenshotAccepterHeader extends Component {
51
43
  PREV_RETRY: this.handlePrevRetry,
52
44
  NEXT_RETRY: this.handleNextRetry,
53
45
  ACCEPT_SCREENSHOT: this.handleScreenshotAccept,
54
- SHOW_ONLY_DIFF: this.props.actions.toggleOnlyDiff,
55
- SCALE_IMAGES: this.props.actions.toggleScaleImages,
56
46
  CLOSE_MODAL: this.props.onClose,
57
47
  IGNORE_META_UP: () => {},
58
48
  IGNORE_META_DOWN: () => {},
@@ -102,7 +92,7 @@ class ScreenshotAccepterHeader extends Component {
102
92
  }
103
93
 
104
94
  render() {
105
- const {images, stateNameImageIds, retryIndex, onClose, onRetryChange, scaleImages, showOnlyDiff} = this.props;
95
+ const {images, stateNameImageIds, retryIndex, onClose, onRetryChange} = this.props;
106
96
  const resultIds = uniqBy(images, 'id').map((image) => image.parentId);
107
97
  const isArrowControlDisabed = stateNameImageIds.length <= 1;
108
98
 
@@ -141,20 +131,6 @@ class ScreenshotAccepterHeader extends Component {
141
131
  retryIndex={retryIndex}
142
132
  onChange={onRetryChange}
143
133
  />
144
- <ControlButton
145
- label="Show only diff"
146
- title="Show only difference image (Shift+d)"
147
- isSuiteControl={true}
148
- isActive={showOnlyDiff}
149
- handler={this.props.actions.toggleOnlyDiff}
150
- />
151
- <ControlButton
152
- label="Scale images"
153
- title="Scale images in one line (Shift+s)"
154
- isSuiteControl={true}
155
- isActive={scaleImages}
156
- handler={this.props.actions.toggleScaleImages}
157
- />
158
134
  <ControlButton
159
135
  label={<Fragment>
160
136
  <ArrowsClose />
@@ -172,11 +148,6 @@ class ScreenshotAccepterHeader extends Component {
172
148
  }
173
149
  }
174
150
 
175
- export default connect(
176
- ({view: {showOnlyDiff, scaleImages}}) => ({showOnlyDiff, scaleImages}),
177
- (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
178
- )(ScreenshotAccepterHeader);
179
-
180
151
  function getPrevIndex(currIndex, arrLength) {
181
152
  return currIndex > 0 ? currIndex - 1 : arrLength - 1;
182
153
  }
@@ -25,7 +25,6 @@ class State extends Component {
25
25
  imageId: PropTypes.string,
26
26
  // from store
27
27
  gui: PropTypes.bool.isRequired,
28
- scaleImages: PropTypes.bool.isRequired,
29
28
  image: PropTypes.shape({
30
29
  status: PropTypes.string,
31
30
  error: PropTypes.object,
@@ -142,17 +141,12 @@ class State extends Component {
142
141
  : <StateFail image={image} />;
143
142
  }
144
143
 
145
- const className = classNames(
146
- 'image-box__container',
147
- {'image-box__container_scale': this.props.scaleImages}
148
- );
149
-
150
144
  return (
151
145
  <Fragment>
152
146
  <hr className="tab__separator"/>
153
147
  {this._getStateTitle()}
154
148
  {this._drawControlButtons()}
155
- {elem ? <div className={className}>{elem}</div> : null}
149
+ {elem ? <div className='image-box__container'>{elem}</div> : null}
156
150
  </Fragment>
157
151
  );
158
152
  }
@@ -163,7 +157,7 @@ export default connect(
163
157
  const getLastImageByStateName = mkGetLastImageByStateName();
164
158
 
165
159
  return (state, {imageId, result}) => {
166
- const {gui, tree, view: {scaleImages}} = state;
160
+ const {gui, tree} = state;
167
161
  const image = tree.images.byId[imageId] || {};
168
162
  const shouldImageBeOpened = image.stateName ? tree.images.stateById[imageId].shouldBeOpened : true;
169
163
  const node = imageId ? image : result;
@@ -176,7 +170,6 @@ export default connect(
176
170
 
177
171
  return {
178
172
  gui,
179
- scaleImages,
180
173
  image,
181
174
  node,
182
175
  shouldImageBeOpened,
@@ -3,7 +3,7 @@
3
3
  import React, {Component} from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import {keyframes} from 'styled-components';
6
- import {CIRCLE_RADIUS} from '../../../constants/defaults';
6
+ import {CIRCLE_RADIUS} from '../../../../constants/defaults';
7
7
 
8
8
  export default class DiffCircle extends Component {
9
9
  static propTypes = {
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ import React, {Component} from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import withEncodeUri from './with-encode-uri';
6
+
7
+ class FullScreenshot extends Component {
8
+ static propTypes = {
9
+ imgRef: PropTypes.shape({
10
+ current: PropTypes.instanceOf(Element)
11
+ }),
12
+ style: PropTypes.shape({
13
+ width: PropTypes.number,
14
+ opacity: PropTypes.number,
15
+ visibility: PropTypes.string
16
+ }),
17
+ // from withEncodeUri
18
+ imageUrl: PropTypes.string.isRequired
19
+ }
20
+
21
+ render() {
22
+ const {imageUrl, className, imgRef, style} = this.props;
23
+
24
+ return <img className={className} src={imageUrl} ref={imgRef} style={style} />;
25
+ }
26
+ }
27
+
28
+ export default withEncodeUri(FullScreenshot);