html-reporter 9.10.0 → 9.10.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/build/gemini.d.ts +2 -0
- package/{gemini.js → build/gemini.js} +1 -1
- package/build/gemini.js.map +1 -0
- package/build/hermione.d.ts +2 -0
- package/{hermione.js → build/hermione.js} +3 -21
- package/build/hermione.js.map +1 -0
- package/build/lib/cli-commands/gui.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/gui.js +5 -7
- package/build/lib/cli-commands/gui.js.map +1 -0
- package/build/lib/cli-commands/index.d.ts +3 -0
- package/{lib → build/lib}/cli-commands/index.js +1 -1
- package/build/lib/cli-commands/index.js.map +1 -0
- package/build/lib/cli-commands/merge-reports.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/merge-reports.js +11 -11
- package/build/lib/cli-commands/merge-reports.js.map +1 -0
- package/build/lib/cli-commands/remove-unused-screens/index.d.ts +2 -0
- package/{lib → build/lib}/cli-commands/remove-unused-screens/index.js +61 -110
- package/build/lib/cli-commands/remove-unused-screens/index.js.map +1 -0
- package/build/lib/cli-commands/remove-unused-screens/utils.d.ts +16 -0
- package/{lib → build/lib}/cli-commands/remove-unused-screens/utils.js +10 -48
- package/build/lib/cli-commands/remove-unused-screens/utils.js.map +1 -0
- package/build/lib/common-utils.d.ts +24 -0
- package/build/lib/common-utils.js +116 -0
- package/build/lib/common-utils.js.map +1 -0
- package/build/lib/config/custom-gui-asserts.d.ts +1 -0
- package/{lib → build/lib}/config/custom-gui-asserts.js +2 -12
- package/build/lib/config/custom-gui-asserts.js.map +1 -0
- package/build/lib/config/index.d.ts +21 -0
- package/{lib → build/lib}/config/index.js +7 -32
- package/build/lib/config/index.js.map +1 -0
- package/build/lib/constants/browser.d.ts +3 -0
- package/build/lib/constants/browser.js +5 -0
- package/build/lib/constants/browser.js.map +1 -0
- package/build/lib/constants/checked-statuses.d.ts +3 -0
- package/{lib → build/lib}/constants/checked-statuses.js +1 -1
- package/build/lib/constants/checked-statuses.js.map +1 -0
- package/build/lib/constants/database.d.ts +25 -0
- package/build/lib/constants/database.js +47 -0
- package/build/lib/constants/database.js.map +1 -0
- package/build/lib/constants/defaults.d.ts +18 -0
- package/{lib → build/lib}/constants/defaults.js +1 -2
- package/build/lib/constants/defaults.js.map +1 -0
- package/build/lib/constants/diff-modes.d.ts +53 -0
- package/{lib → build/lib}/constants/diff-modes.js +2 -0
- package/build/lib/constants/diff-modes.js.map +1 -0
- package/build/lib/constants/errors.d.ts +5 -0
- package/{lib → build/lib}/constants/errors.js +1 -1
- package/build/lib/constants/errors.js.map +1 -0
- package/build/lib/constants/expand-modes.d.ts +4 -0
- package/{lib → build/lib}/constants/expand-modes.js +1 -1
- package/build/lib/constants/expand-modes.js.map +1 -0
- package/build/lib/constants/extension-points.d.ts +4 -0
- package/build/lib/constants/extension-points.js +8 -0
- package/build/lib/constants/extension-points.js.map +1 -0
- package/build/lib/constants/group-tests.d.ts +7 -0
- package/{lib → build/lib}/constants/group-tests.js +2 -0
- package/build/lib/constants/group-tests.js.map +1 -0
- package/build/lib/constants/paths.d.ts +2 -0
- package/{lib → build/lib}/constants/paths.js +1 -1
- package/build/lib/constants/paths.js.map +1 -0
- package/build/lib/constants/plugin-events.d.ts +5 -0
- package/{lib → build/lib}/constants/plugin-events.js +2 -4
- package/build/lib/constants/plugin-events.js.map +1 -0
- package/build/lib/constants/save-formats.d.ts +1 -0
- package/{lib → build/lib}/constants/save-formats.js +1 -1
- package/build/lib/constants/save-formats.js.map +1 -0
- package/build/lib/constants/test-statuses.d.ts +8 -0
- package/{lib → build/lib}/constants/test-statuses.js +1 -1
- package/build/lib/constants/test-statuses.js.map +1 -0
- package/build/lib/constants/view-modes.d.ts +5 -0
- package/{lib → build/lib}/constants/view-modes.js +1 -1
- package/build/lib/constants/view-modes.js.map +1 -0
- package/build/lib/db-utils/client.d.ts +19 -0
- package/{lib → build/lib}/db-utils/client.js +18 -45
- package/build/lib/db-utils/client.js.map +1 -0
- package/build/lib/db-utils/common.d.ts +10 -0
- package/build/lib/db-utils/common.js +56 -0
- package/build/lib/db-utils/common.js.map +1 -0
- package/build/lib/db-utils/server.d.ts +16 -0
- package/{lib → build/lib}/db-utils/server.js +15 -41
- package/build/lib/db-utils/server.js.map +1 -0
- package/build/lib/gui/api/facade.d.ts +8 -0
- package/{lib → build/lib}/gui/api/facade.js +1 -4
- package/build/lib/gui/api/facade.js.map +1 -0
- package/build/lib/gui/api/index.d.ts +9 -0
- package/{lib → build/lib}/gui/api/index.js +1 -5
- package/build/lib/gui/api/index.js.map +1 -0
- package/build/lib/gui/app.d.ts +62 -0
- package/{lib → build/lib}/gui/app.js +2 -21
- package/build/lib/gui/app.js.map +1 -0
- package/build/lib/gui/constants/client-events.d.ts +6 -0
- package/{lib → build/lib}/gui/constants/client-events.js +1 -4
- package/build/lib/gui/constants/client-events.js.map +1 -0
- package/build/lib/gui/constants/custom-gui-control-types.d.ts +2 -0
- package/{lib → build/lib}/gui/constants/custom-gui-control-types.js +1 -1
- package/build/lib/gui/constants/custom-gui-control-types.js.map +1 -0
- package/build/lib/gui/constants/gui-events.d.ts +2 -0
- package/{lib → build/lib}/gui/constants/gui-events.js +1 -1
- package/build/lib/gui/constants/gui-events.js.map +1 -0
- package/build/lib/gui/constants/server.d.ts +3 -0
- package/{lib → build/lib}/gui/constants/server.js +1 -1
- package/build/lib/gui/constants/server.js.map +1 -0
- package/build/lib/gui/event-source.d.ts +6 -0
- package/{lib → build/lib}/gui/event-source.js +2 -5
- package/build/lib/gui/event-source.js.map +1 -0
- package/build/lib/gui/index.d.ts +12 -0
- package/build/lib/gui/index.js +22 -0
- package/build/lib/gui/index.js.map +1 -0
- package/build/lib/gui/routes/plugins.d.ts +2 -0
- package/{lib → build/lib}/gui/routes/plugins.js +9 -24
- package/build/lib/gui/routes/plugins.js.map +1 -0
- package/build/lib/gui/server.d.ts +8 -0
- package/{lib → build/lib}/gui/server.js +32 -51
- package/build/lib/gui/server.js.map +1 -0
- package/build/lib/gui/tool-runner/index.d.ts +123 -0
- package/{lib → build/lib}/gui/tool-runner/index.js +42 -122
- package/build/lib/gui/tool-runner/index.js.map +1 -0
- package/build/lib/gui/tool-runner/report-subscriber.d.ts +2 -0
- package/{lib → build/lib}/gui/tool-runner/report-subscriber.js +7 -30
- package/build/lib/gui/tool-runner/report-subscriber.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/all-test-runner.d.ts +4 -0
- package/{lib → build/lib}/gui/tool-runner/runner/all-test-runner.js +1 -3
- package/build/lib/gui/tool-runner/runner/all-test-runner.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/index.d.ts +3 -0
- package/{lib → build/lib}/gui/tool-runner/runner/index.js +1 -2
- package/build/lib/gui/tool-runner/runner/index.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/runner.d.ts +6 -0
- package/{lib → build/lib}/gui/tool-runner/runner/runner.js +1 -2
- package/build/lib/gui/tool-runner/runner/runner.js.map +1 -0
- package/build/lib/gui/tool-runner/runner/specific-test-runner.d.ts +7 -0
- package/{lib → build/lib}/gui/tool-runner/runner/specific-test-runner.js +2 -8
- package/build/lib/gui/tool-runner/runner/specific-test-runner.js.map +1 -0
- package/build/lib/gui/tool-runner/utils.d.ts +7 -0
- package/{lib → build/lib}/gui/tool-runner/utils.js +11 -35
- package/build/lib/gui/tool-runner/utils.js.map +1 -0
- package/build/lib/history-utils.d.ts +1 -0
- package/{lib → build/lib}/history-utils.js +5 -20
- package/build/lib/history-utils.js.map +1 -0
- package/build/lib/local-images-saver.d.ts +4 -0
- package/build/lib/local-images-saver.js +9 -0
- package/build/lib/local-images-saver.js.map +1 -0
- package/build/lib/merge-reports/index.d.ts +4 -0
- package/{lib → build/lib}/merge-reports/index.js +3 -8
- package/build/lib/merge-reports/index.js.map +1 -0
- package/build/lib/plugin-adapter.d.ts +32 -0
- package/{lib → build/lib}/plugin-adapter.js +8 -25
- package/build/lib/plugin-adapter.js.map +1 -0
- package/build/lib/plugin-api.d.ts +57 -0
- package/{lib → build/lib}/plugin-api.js +2 -20
- package/build/lib/plugin-api.js.map +1 -0
- package/build/lib/plugin-utils.d.ts +3 -0
- package/{lib → build/lib}/plugin-utils.js +3 -5
- package/build/lib/plugin-utils.js.map +1 -0
- package/build/lib/report-builder/gui.d.ts +73 -0
- package/{lib → build/lib}/report-builder/gui.js +33 -92
- package/build/lib/report-builder/gui.js.map +1 -0
- package/build/lib/report-builder/static.d.ts +32 -0
- package/{lib → build/lib}/report-builder/static.js +25 -64
- package/build/lib/report-builder/static.js.map +1 -0
- package/build/lib/reporter-helpers.d.ts +3 -0
- package/{lib → build/lib}/reporter-helpers.js +2 -11
- package/build/lib/reporter-helpers.js.map +1 -0
- package/build/lib/server-utils.d.ts +42 -0
- package/{lib → build/lib}/server-utils.js +37 -92
- package/build/lib/server-utils.js.map +1 -0
- package/build/lib/sqlite-adapter.d.ts +78 -0
- package/{lib → build/lib}/sqlite-adapter.js +15 -56
- package/build/lib/sqlite-adapter.js.map +1 -0
- package/build/lib/static/gui.min.js +124 -0
- package/build/lib/static/modules/utils.d.ts +31 -0
- package/{lib → build/lib}/static/modules/utils.js +16 -56
- package/build/lib/static/modules/utils.js.map +1 -0
- package/build/lib/static/report.min.js +124 -0
- package/build/lib/suite-adapter.d.ts +15 -0
- package/{lib → build/lib}/suite-adapter.js +2 -18
- package/build/lib/suite-adapter.js.map +1 -0
- package/build/lib/test-adapter.d.ts +118 -0
- package/{lib → build/lib}/test-adapter.js +38 -156
- package/build/lib/test-adapter.js.map +1 -0
- package/build/lib/tests-tree-builder/base.d.ts +70 -0
- package/{lib → build/lib}/tests-tree-builder/base.js +34 -74
- package/build/lib/tests-tree-builder/base.js.map +1 -0
- package/build/lib/tests-tree-builder/gui.d.ts +47 -0
- package/{lib → build/lib}/tests-tree-builder/gui.js +12 -63
- package/build/lib/tests-tree-builder/gui.js.map +1 -0
- package/build/lib/tests-tree-builder/static.d.ts +55 -0
- package/{lib → build/lib}/tests-tree-builder/static.js +11 -42
- package/build/lib/tests-tree-builder/static.js.map +1 -0
- package/build/lib/workers/create-workers.d.ts +2 -0
- package/{lib → build/lib}/workers/create-workers.js +1 -2
- package/build/lib/workers/create-workers.js.map +1 -0
- package/build/lib/workers/worker.d.ts +1 -0
- package/build/lib/workers/worker.js +13 -0
- package/build/lib/workers/worker.js.map +1 -0
- package/build/package.json +178 -0
- package/package.json +44 -23
- package/CHANGELOG.md +0 -2896
- package/docs/en/html-reporter-api.md +0 -198
- package/docs/en/html-reporter-commands.md +0 -96
- package/docs/en/html-reporter-custom-gui.md +0 -99
- package/docs/en/html-reporter-events.md +0 -125
- package/docs/en/html-reporter-plugins.md +0 -265
- package/docs/en/html-reporter-setup.md +0 -378
- package/docs/en/html-reporter.md +0 -8
- package/docs/ru/html-reporter-api.md +0 -198
- package/docs/ru/html-reporter-commands.md +0 -96
- package/docs/ru/html-reporter-custom-gui.md +0 -99
- package/docs/ru/html-reporter-events.md +0 -125
- package/docs/ru/html-reporter-plugins.md +0 -265
- package/docs/ru/html-reporter-setup.md +0 -378
- package/docs/ru/html-reporter.md +0 -8
- package/lib/common-utils.js +0 -123
- package/lib/constants/browser.js +0 -3
- package/lib/constants/database.js +0 -49
- package/lib/constants/extension-points.js +0 -6
- package/lib/db-utils/common.js +0 -76
- package/lib/gui/index.js +0 -19
- package/lib/local-images-saver.js +0 -11
- package/lib/static/components/bottom-progress-bar/index.js +0 -42
- package/lib/static/components/bullet.js +0 -30
- package/lib/static/components/controls/accept-opened-button.js +0 -39
- package/lib/static/components/controls/base-host-input.js +0 -39
- package/lib/static/components/controls/browser-list/index.js +0 -239
- package/lib/static/components/controls/browser-list/index.styl +0 -52
- package/lib/static/components/controls/browser-list/label.js +0 -60
- package/lib/static/components/controls/browser-list/label.styl +0 -18
- package/lib/static/components/controls/browser-list/utils.js +0 -43
- package/lib/static/components/controls/common-controls.js +0 -75
- package/lib/static/components/controls/common-filters.js +0 -34
- package/lib/static/components/controls/control-button.js +0 -54
- package/lib/static/components/controls/controls.less +0 -109
- package/lib/static/components/controls/custom-gui-controls.js +0 -70
- package/lib/static/components/controls/find-same-diffs-button.js +0 -47
- package/lib/static/components/controls/gui-controls.js +0 -46
- package/lib/static/components/controls/menu-bar.js +0 -47
- package/lib/static/components/controls/report-controls.js +0 -21
- package/lib/static/components/controls/report-info.js +0 -31
- package/lib/static/components/controls/run-button/index.js +0 -129
- package/lib/static/components/controls/run-button/index.styl +0 -49
- package/lib/static/components/controls/selects/control.js +0 -51
- package/lib/static/components/controls/selects/group-tests.js +0 -94
- package/lib/static/components/controls/selects/index.styl +0 -57
- package/lib/static/components/controls/show-checkboxes-input.js +0 -24
- package/lib/static/components/controls/strict-match-filter-input.js +0 -39
- package/lib/static/components/controls/test-name-filter-input.js +0 -42
- package/lib/static/components/custom-scripts.js +0 -23
- package/lib/static/components/details.js +0 -58
- package/lib/static/components/error-boundary.js +0 -26
- package/lib/static/components/extension-point.js +0 -106
- package/lib/static/components/favicon-changer.js +0 -56
- package/lib/static/components/group-tests/item.js +0 -66
- package/lib/static/components/group-tests/list.js +0 -71
- package/lib/static/components/group-tests/prop-types.js +0 -12
- package/lib/static/components/gui.js +0 -105
- package/lib/static/components/header/header.css +0 -5
- package/lib/static/components/header/index.js +0 -26
- package/lib/static/components/header/summary/dbBtn.js +0 -36
- package/lib/static/components/header/summary/dbSummary.js +0 -49
- package/lib/static/components/header/summary/index.js +0 -43
- package/lib/static/components/header/summary/item.js +0 -28
- package/lib/static/components/header/summary/summary.css +0 -77
- package/lib/static/components/icons/arrow.js +0 -24
- package/lib/static/components/icons/arrows-close.js +0 -25
- package/lib/static/components/icons/arrows-move.js +0 -24
- package/lib/static/components/icons/arrows-open.js +0 -25
- package/lib/static/components/icons/view-in-browser/index.js +0 -59
- package/lib/static/components/icons/view-in-browser/index.styl +0 -28
- package/lib/static/components/loading.js +0 -25
- package/lib/static/components/main-tree.js +0 -23
- package/lib/static/components/modals/find-same-diffs.js +0 -34
- package/lib/static/components/modals/index.js +0 -6
- package/lib/static/components/modals/modal.css +0 -3
- package/lib/static/components/modals/modal.js +0 -27
- package/lib/static/components/modals/screenshot-accepter/body.js +0 -88
- package/lib/static/components/modals/screenshot-accepter/header.js +0 -192
- package/lib/static/components/modals/screenshot-accepter/index.js +0 -228
- package/lib/static/components/modals/screenshot-accepter/meta.js +0 -32
- package/lib/static/components/modals/screenshot-accepter/style.css +0 -115
- package/lib/static/components/popup/index.js +0 -89
- package/lib/static/components/popup/index.styl +0 -43
- package/lib/static/components/progress-bar/index.js +0 -13
- package/lib/static/components/progress-bar/index.styl +0 -24
- package/lib/static/components/report.js +0 -72
- package/lib/static/components/retry-switcher/index.js +0 -36
- package/lib/static/components/retry-switcher/item.js +0 -55
- package/lib/static/components/section/body/description.js +0 -24
- package/lib/static/components/section/body/history/index.js +0 -29
- package/lib/static/components/section/body/history/index.styl +0 -4
- package/lib/static/components/section/body/index.js +0 -114
- package/lib/static/components/section/body/meta-info/content.js +0 -114
- package/lib/static/components/section/body/meta-info/index.js +0 -33
- package/lib/static/components/section/body/result.js +0 -41
- package/lib/static/components/section/body/tabs.js +0 -52
- package/lib/static/components/section/section-browser.js +0 -113
- package/lib/static/components/section/section-common.js +0 -100
- package/lib/static/components/section/section-wrapper.js +0 -20
- package/lib/static/components/section/title/browser-skipped.js +0 -39
- package/lib/static/components/section/title/browser.js +0 -81
- package/lib/static/components/section/title/simple.js +0 -86
- package/lib/static/components/state/error-details.js +0 -18
- package/lib/static/components/state/index.js +0 -208
- package/lib/static/components/state/screenshot/diff-circle.js +0 -66
- package/lib/static/components/state/screenshot/full.js +0 -28
- package/lib/static/components/state/screenshot/resized.js +0 -90
- package/lib/static/components/state/screenshot/with-encode-uri.js +0 -44
- package/lib/static/components/state/screenshot/with-synced-scale.js +0 -116
- package/lib/static/components/state/state-error.js +0 -140
- package/lib/static/components/state/state-fail/index.js +0 -161
- package/lib/static/components/state/state-fail/index.styl +0 -31
- package/lib/static/components/state/state-fail/onion-skin-diff/index.js +0 -43
- package/lib/static/components/state/state-fail/onion-skin-diff/index.styl +0 -19
- package/lib/static/components/state/state-fail/prop-types.js +0 -16
- package/lib/static/components/state/state-fail/swipe-diff/index.js +0 -138
- package/lib/static/components/state/state-fail/swipe-diff/index.styl +0 -82
- package/lib/static/components/state/state-fail/switch-diff/index.js +0 -36
- package/lib/static/components/state/state-fail/switch-diff/index.styl +0 -12
- package/lib/static/components/state/state-fail/useFitImages.js +0 -63
- package/lib/static/components/state/state-success.js +0 -23
- package/lib/static/components/sticky-header/gui.js +0 -12
- package/lib/static/components/sticky-header/index.js +0 -36
- package/lib/static/components/sticky-header/index.styl +0 -37
- package/lib/static/components/sticky-header/report.js +0 -14
- package/lib/static/components/suites.js +0 -157
- package/lib/static/containers/array/array.styl +0 -32
- package/lib/static/containers/array/index.js +0 -61
- package/lib/static/containers/modal.js +0 -43
- package/lib/static/gui.css +0 -177
- package/lib/static/gui.js +0 -14
- package/lib/static/gui.min.js +0 -124
- package/lib/static/hooks/useElementSize.js +0 -30
- package/lib/static/hooks/useEventListener.js +0 -25
- package/lib/static/hooks/useLocalStorage.js +0 -39
- package/lib/static/hooks/useWindowSize.js +0 -25
- package/lib/static/index.js +0 -14
- package/lib/static/modules/action-names.js +0 -60
- package/lib/static/modules/actions.js +0 -335
- package/lib/static/modules/custom-queries.js +0 -27
- package/lib/static/modules/default-state.js +0 -84
- package/lib/static/modules/load-plugin.js +0 -109
- package/lib/static/modules/local-storage-wrapper.js +0 -54
- package/lib/static/modules/middlewares/local-storage.js +0 -30
- package/lib/static/modules/middlewares/metrika.js +0 -121
- package/lib/static/modules/plugins.js +0 -52
- package/lib/static/modules/query-params.js +0 -98
- package/lib/static/modules/reducers/api-values.js +0 -25
- package/lib/static/modules/reducers/auto-run.js +0 -14
- package/lib/static/modules/reducers/bottom-progress-bar.js +0 -16
- package/lib/static/modules/reducers/browsers.js +0 -43
- package/lib/static/modules/reducers/close-ids.js +0 -12
- package/lib/static/modules/reducers/config.js +0 -48
- package/lib/static/modules/reducers/date.js +0 -16
- package/lib/static/modules/reducers/db.js +0 -30
- package/lib/static/modules/reducers/fetch-db-details.js +0 -13
- package/lib/static/modules/reducers/grouped-tests/by/meta.js +0 -31
- package/lib/static/modules/reducers/grouped-tests/by/result.js +0 -57
- package/lib/static/modules/reducers/grouped-tests/helpers.js +0 -91
- package/lib/static/modules/reducers/grouped-tests/index.js +0 -52
- package/lib/static/modules/reducers/gui.js +0 -16
- package/lib/static/modules/reducers/index.js +0 -56
- package/lib/static/modules/reducers/loading.js +0 -12
- package/lib/static/modules/reducers/modals.js +0 -16
- package/lib/static/modules/reducers/notifications.js +0 -12
- package/lib/static/modules/reducers/plugins.js +0 -25
- package/lib/static/modules/reducers/processing.js +0 -21
- package/lib/static/modules/reducers/running.js +0 -19
- package/lib/static/modules/reducers/skips.js +0 -15
- package/lib/static/modules/reducers/stats.js +0 -21
- package/lib/static/modules/reducers/stopping.js +0 -16
- package/lib/static/modules/reducers/tree/helpers.js +0 -44
- package/lib/static/modules/reducers/tree/index.js +0 -369
- package/lib/static/modules/reducers/tree/nodes/browsers.js +0 -116
- package/lib/static/modules/reducers/tree/nodes/images.js +0 -59
- package/lib/static/modules/reducers/tree/nodes/results.js +0 -39
- package/lib/static/modules/reducers/tree/nodes/suites.js +0 -271
- package/lib/static/modules/reducers/view.js +0 -93
- package/lib/static/modules/selectors/grouped-tests.js +0 -8
- package/lib/static/modules/selectors/index.js +0 -3
- package/lib/static/modules/selectors/stats.js +0 -33
- package/lib/static/modules/selectors/tree.js +0 -269
- package/lib/static/modules/selectors/view.js +0 -5
- package/lib/static/modules/store.js +0 -25
- package/lib/static/modules/web-vitals.js +0 -13
- package/lib/static/modules/yandex-metrika.js +0 -50
- package/lib/static/report.min.js +0 -124
- package/lib/static/styles.css +0 -937
- package/lib/static/template.html +0 -13
- package/lib/workers/worker.js +0 -15
- package/webpack.common.js +0 -95
- package/webpack.dev.js +0 -25
- package/webpack.prod.js +0 -19
- /package/{lib → build/lib}/static/gui.html +0 -0
- /package/{lib → build/lib}/static/gui.min.css +0 -0
- /package/{lib → build/lib}/static/icons/favicon-failure.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon-running.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon-success.png +0 -0
- /package/{lib → build/lib}/static/icons/favicon.png +0 -0
- /package/{lib → build/lib}/static/index.html +0 -0
- /package/{lib → build/lib}/static/report.min.css +0 -0
|
@@ -1,49 +1,38 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
2
|
const path = require('path');
|
|
4
3
|
const express = require('express');
|
|
5
4
|
const onExit = require('signal-exit');
|
|
6
5
|
const Promise = require('bluebird');
|
|
7
6
|
const bodyParser = require('body-parser');
|
|
8
|
-
const {INTERNAL_SERVER_ERROR, OK} = require('http-codes');
|
|
9
|
-
|
|
7
|
+
const { INTERNAL_SERVER_ERROR, OK } = require('http-codes');
|
|
10
8
|
const App = require('./app');
|
|
11
|
-
const {MAX_REQUEST_SIZE, KEEP_ALIVE_TIMEOUT, HEADERS_TIMEOUT} = require('./constants/server');
|
|
12
|
-
const {initializeCustomGui, runCustomGuiAction} = require('../server-utils');
|
|
13
|
-
const {logger} = require('../common-utils');
|
|
9
|
+
const { MAX_REQUEST_SIZE, KEEP_ALIVE_TIMEOUT, HEADERS_TIMEOUT } = require('./constants/server');
|
|
10
|
+
const { initializeCustomGui, runCustomGuiAction } = require('../server-utils');
|
|
11
|
+
const { logger } = require('../common-utils');
|
|
14
12
|
const initPluginsRoutes = require('./routes/plugins');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const {options, pluginConfig} = configs;
|
|
13
|
+
exports.start = async ({ paths, hermione, guiApi, configs }) => {
|
|
14
|
+
const { options, pluginConfig } = configs;
|
|
18
15
|
const app = App.create(paths, hermione, configs);
|
|
19
16
|
const server = express();
|
|
20
|
-
|
|
21
|
-
server.use(bodyParser.json({limit: MAX_REQUEST_SIZE}));
|
|
22
|
-
|
|
17
|
+
server.use(bodyParser.json({ limit: MAX_REQUEST_SIZE }));
|
|
23
18
|
await guiApi.initServer(server);
|
|
24
|
-
|
|
25
19
|
// allow plugins to precede default server routes
|
|
26
20
|
server.use(initPluginsRoutes(express.Router(), pluginConfig));
|
|
27
|
-
|
|
28
|
-
server.use(express.static(path.join(__dirname, '../static'), {index: 'gui.html'}));
|
|
21
|
+
server.use(express.static(path.join(__dirname, '../static'), { index: 'gui.html' }));
|
|
29
22
|
server.use(express.static(path.join(process.cwd(), pluginConfig.path)));
|
|
30
|
-
|
|
31
23
|
server.get('/', (req, res) => res.sendFile(path.join(__dirname, '../static', 'gui.html')));
|
|
32
|
-
|
|
33
24
|
server.get('/events', (req, res) => {
|
|
34
|
-
res.writeHead(OK, {'Content-Type': 'text/event-stream'});
|
|
35
|
-
|
|
25
|
+
res.writeHead(OK, { 'Content-Type': 'text/event-stream' });
|
|
36
26
|
app.addClient(res);
|
|
37
27
|
});
|
|
38
|
-
|
|
39
28
|
server.set('json replacer', (key, val) => {
|
|
40
29
|
return typeof val === 'function' ? val.toString() : val;
|
|
41
30
|
});
|
|
42
|
-
|
|
43
31
|
server.get('/init', async (req, res) => {
|
|
44
32
|
try {
|
|
45
33
|
await initializeCustomGui(hermione, pluginConfig);
|
|
46
|
-
}
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
47
36
|
app.data.customGuiError = {
|
|
48
37
|
response: {
|
|
49
38
|
status: INTERNAL_SERVER_ERROR,
|
|
@@ -51,95 +40,87 @@ exports.start = async ({paths, hermione, guiApi, configs}) => {
|
|
|
51
40
|
}
|
|
52
41
|
};
|
|
53
42
|
}
|
|
54
|
-
|
|
55
43
|
res.json(app.data);
|
|
56
44
|
});
|
|
57
|
-
|
|
58
45
|
server.post('/run', (req, res) => {
|
|
59
46
|
try {
|
|
60
47
|
// do not wait for completion so that response does not hang and browser does not restart it by timeout
|
|
61
48
|
app.run(req.body);
|
|
62
49
|
res.sendStatus(OK);
|
|
63
|
-
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
64
52
|
res.status(INTERNAL_SERVER_ERROR).send(`Error while trying to run tests: ${e.message}`);
|
|
65
53
|
}
|
|
66
54
|
});
|
|
67
|
-
|
|
68
|
-
server.post('/run-custom-gui-action', async ({body: payload}, res) => {
|
|
55
|
+
server.post('/run-custom-gui-action', async ({ body: payload }, res) => {
|
|
69
56
|
try {
|
|
70
57
|
await runCustomGuiAction(hermione, pluginConfig, payload);
|
|
71
58
|
res.sendStatus(OK);
|
|
72
|
-
}
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
73
61
|
res.status(INTERNAL_SERVER_ERROR).send(`Error while running custom gui action: ${e.message}`);
|
|
74
62
|
}
|
|
75
63
|
});
|
|
76
|
-
|
|
77
64
|
server.post('/reference-data-to-update', (req, res) => {
|
|
78
65
|
try {
|
|
79
66
|
const data = app.getTestsDataToUpdateRefs(req.body);
|
|
80
67
|
res.json(data);
|
|
81
|
-
}
|
|
82
|
-
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
res.status(INTERNAL_SERVER_ERROR).send({ error: error.message });
|
|
83
71
|
}
|
|
84
72
|
});
|
|
85
|
-
|
|
86
73
|
server.post('/update-reference', (req, res) => {
|
|
87
74
|
app.updateReferenceImage(req.body)
|
|
88
75
|
.then((updatedTests) => res.json(updatedTests))
|
|
89
|
-
.catch(({message}) => res.status(INTERNAL_SERVER_ERROR).send({error: message}));
|
|
76
|
+
.catch(({ message }) => res.status(INTERNAL_SERVER_ERROR).send({ error: message }));
|
|
90
77
|
});
|
|
91
|
-
|
|
92
78
|
server.post('/undo-accept-images', (req, res) => {
|
|
93
79
|
app.undoAcceptImages(req.body)
|
|
94
80
|
.then((updated) => res.json(updated))
|
|
95
|
-
.catch(({message}) => res.status(INTERNAL_SERVER_ERROR).send({error: message}));
|
|
81
|
+
.catch(({ message }) => res.status(INTERNAL_SERVER_ERROR).send({ error: message }));
|
|
96
82
|
});
|
|
97
|
-
|
|
98
83
|
server.post('/get-find-equal-diffs-data', (req, res) => {
|
|
99
84
|
try {
|
|
100
85
|
const data = app.getImageDataToFindEqualDiffs(req.body);
|
|
101
86
|
res.json(data);
|
|
102
|
-
}
|
|
103
|
-
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
res.status(INTERNAL_SERVER_ERROR).send({ error: error.message });
|
|
104
90
|
}
|
|
105
91
|
});
|
|
106
|
-
|
|
107
92
|
server.post('/find-equal-diffs', async (req, res) => {
|
|
108
93
|
try {
|
|
109
94
|
const result = await app.findEqualDiffs(req.body);
|
|
110
95
|
res.json(result);
|
|
111
|
-
}
|
|
112
|
-
|
|
96
|
+
}
|
|
97
|
+
catch ({ message }) {
|
|
98
|
+
res.status(INTERNAL_SERVER_ERROR).send({ error: message });
|
|
113
99
|
}
|
|
114
100
|
});
|
|
115
|
-
|
|
116
101
|
onExit(() => {
|
|
117
102
|
app.finalize();
|
|
118
103
|
logger.log('server shutting down');
|
|
119
104
|
});
|
|
120
|
-
|
|
121
105
|
server.post('/stop', (req, res) => {
|
|
122
106
|
try {
|
|
123
107
|
// pass 0 to prevent terminating hermione process
|
|
124
108
|
hermione.halt('Tests were stopped by the user', 0);
|
|
125
109
|
res.sendStatus(OK);
|
|
126
|
-
}
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
127
112
|
res.status(INTERNAL_SERVER_ERROR).send(`Error while stopping tests: ${e.message}`);
|
|
128
113
|
}
|
|
129
114
|
});
|
|
130
|
-
|
|
131
115
|
await app.initialize();
|
|
132
|
-
|
|
133
|
-
const {port, hostname} = options;
|
|
116
|
+
const { port, hostname } = options;
|
|
134
117
|
await Promise.fromCallback((callback) => {
|
|
135
118
|
const httpServer = server.listen(port, hostname, callback);
|
|
136
119
|
httpServer.keepAliveTimeout = KEEP_ALIVE_TIMEOUT;
|
|
137
120
|
httpServer.headersTimeout = HEADERS_TIMEOUT;
|
|
138
121
|
});
|
|
139
|
-
|
|
140
|
-
const data = {url: `http://${hostname}:${port}`};
|
|
141
|
-
|
|
122
|
+
const data = { url: `http://${hostname}:${port}` };
|
|
142
123
|
await guiApi.serverReady(data);
|
|
143
|
-
|
|
144
124
|
return data;
|
|
145
125
|
};
|
|
126
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../lib/gui/server.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACtC,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAC1C,MAAM,EAAC,qBAAqB,EAAE,EAAE,EAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAE1D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7B,MAAM,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAC9F,MAAM,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC7E,MAAM,EAAC,MAAM,EAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEtD,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAC,EAAE,EAAE;IACzD,MAAM,EAAC,OAAO,EAAE,YAAY,EAAC,GAAG,OAAO,CAAC;IACxC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EA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R,GAAG,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;SACtF;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;IAEvB,MAAM,EAAC,IAAI,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC;IACjC,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,EAAE;QACpC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC3D,UAAU,CAAC,gBAAgB,GAAG,kBAAkB,CAAC;QACjD,UAAU,CAAC,cAAc,GAAG,eAAe,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,EAAC,GAAG,EAAE,UAAU,QAAQ,IAAI,IAAI,EAAE,EAAC,CAAC;IAEjD,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export = ToolRunner;
|
|
2
|
+
declare class ToolRunner {
|
|
3
|
+
static create(paths: any, hermione: any, configs: any): import(".");
|
|
4
|
+
constructor(paths: any, hermione: any, { program: globalOpts, pluginConfig, options: guiOpts }: {
|
|
5
|
+
program: any;
|
|
6
|
+
pluginConfig: any;
|
|
7
|
+
options: any;
|
|
8
|
+
});
|
|
9
|
+
_testFiles: never[];
|
|
10
|
+
_hermione: any;
|
|
11
|
+
_tree: {
|
|
12
|
+
autoRun: any;
|
|
13
|
+
tree: {
|
|
14
|
+
suites: {
|
|
15
|
+
byId: {};
|
|
16
|
+
allIds: never[];
|
|
17
|
+
allRootIds: never[];
|
|
18
|
+
};
|
|
19
|
+
browsers: {
|
|
20
|
+
byId: {};
|
|
21
|
+
allIds: never[];
|
|
22
|
+
};
|
|
23
|
+
results: {
|
|
24
|
+
byId: {};
|
|
25
|
+
allIds: never[];
|
|
26
|
+
};
|
|
27
|
+
images: {
|
|
28
|
+
byId: {};
|
|
29
|
+
allIds: never[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
skips: any[];
|
|
33
|
+
config: {
|
|
34
|
+
customGui: any;
|
|
35
|
+
defaultView: any;
|
|
36
|
+
diffMode: any;
|
|
37
|
+
baseHost: any;
|
|
38
|
+
errorPatterns: any;
|
|
39
|
+
metaInfoBaseUrls: any;
|
|
40
|
+
customScripts: any;
|
|
41
|
+
yandexMetrika: any;
|
|
42
|
+
pluginsEnabled: any;
|
|
43
|
+
plugins: any;
|
|
44
|
+
};
|
|
45
|
+
date: string;
|
|
46
|
+
apiValues: {};
|
|
47
|
+
} | null;
|
|
48
|
+
_collection: any;
|
|
49
|
+
_globalOpts: any;
|
|
50
|
+
_guiOpts: any;
|
|
51
|
+
_reportPath: any;
|
|
52
|
+
_pluginConfig: any;
|
|
53
|
+
_eventSource: EventSource;
|
|
54
|
+
_reportBuilder: GuiReportBuilder | null;
|
|
55
|
+
_tests: {};
|
|
56
|
+
get config(): any;
|
|
57
|
+
get tree(): {
|
|
58
|
+
autoRun: any;
|
|
59
|
+
tree: {
|
|
60
|
+
suites: {
|
|
61
|
+
byId: {};
|
|
62
|
+
allIds: never[];
|
|
63
|
+
allRootIds: never[];
|
|
64
|
+
};
|
|
65
|
+
browsers: {
|
|
66
|
+
byId: {};
|
|
67
|
+
allIds: never[];
|
|
68
|
+
};
|
|
69
|
+
results: {
|
|
70
|
+
byId: {};
|
|
71
|
+
allIds: never[];
|
|
72
|
+
};
|
|
73
|
+
images: {
|
|
74
|
+
byId: {};
|
|
75
|
+
allIds: never[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
skips: any[];
|
|
79
|
+
config: {
|
|
80
|
+
customGui: any;
|
|
81
|
+
defaultView: any;
|
|
82
|
+
diffMode: any;
|
|
83
|
+
baseHost: any;
|
|
84
|
+
errorPatterns: any;
|
|
85
|
+
metaInfoBaseUrls: any;
|
|
86
|
+
customScripts: any;
|
|
87
|
+
yandexMetrika: any;
|
|
88
|
+
pluginsEnabled: any;
|
|
89
|
+
plugins: any;
|
|
90
|
+
};
|
|
91
|
+
date: string;
|
|
92
|
+
apiValues: {};
|
|
93
|
+
} | null;
|
|
94
|
+
initialize(): Promise<void>;
|
|
95
|
+
_readTests(): Promise<any>;
|
|
96
|
+
finalize(): Promise<void>;
|
|
97
|
+
addClient(connection: any): void;
|
|
98
|
+
sendClientEvent(event: any, data: any): void;
|
|
99
|
+
getTestsDataToUpdateRefs(imageIds: any): any;
|
|
100
|
+
getImageDataToFindEqualDiffs(imageIds: any): any[];
|
|
101
|
+
updateReferenceImage(tests: any): any;
|
|
102
|
+
undoAcceptImages(tests: any): Promise<{
|
|
103
|
+
updatedImages: any[];
|
|
104
|
+
removedResults: any[];
|
|
105
|
+
}>;
|
|
106
|
+
findEqualDiffs(images: any): Promise<any>;
|
|
107
|
+
run(tests?: any[]): any;
|
|
108
|
+
_handleRunnableCollection(): Promise<void>;
|
|
109
|
+
_isSilentlySkipped({ silentSkip, parent }: {
|
|
110
|
+
silentSkip: any;
|
|
111
|
+
parent: any;
|
|
112
|
+
}): any;
|
|
113
|
+
_subscribeOnEvents(): void;
|
|
114
|
+
_prepareTestResult(test: any): any;
|
|
115
|
+
_emitUpdateReference({ refImg }: {
|
|
116
|
+
refImg: any;
|
|
117
|
+
}, state: any): void;
|
|
118
|
+
_fillTestsTree(): Promise<void>;
|
|
119
|
+
_loadDataFromDatabase(): Promise<any>;
|
|
120
|
+
_resolveImgPath(imgPath: any): string;
|
|
121
|
+
}
|
|
122
|
+
import EventSource = require("../event-source");
|
|
123
|
+
import GuiReportBuilder = require("../../report-builder/gui");
|
|
@@ -1,293 +1,213 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
2
|
const _ = require('lodash');
|
|
4
3
|
const fs = require('fs-extra');
|
|
5
4
|
const path = require('path');
|
|
6
5
|
const chalk = require('chalk');
|
|
7
6
|
const Promise = require('bluebird');
|
|
8
7
|
const looksSame = require('looks-same');
|
|
9
|
-
|
|
10
8
|
const Runner = require('./runner');
|
|
11
9
|
const subscribeOnToolEvents = require('./report-subscriber');
|
|
12
10
|
const GuiReportBuilder = require('../../report-builder/gui');
|
|
13
11
|
const EventSource = require('../event-source');
|
|
14
|
-
const {logger} = require('../../common-utils');
|
|
12
|
+
const { logger } = require('../../common-utils');
|
|
15
13
|
const reporterHelper = require('../../reporter-helpers');
|
|
16
|
-
const {UPDATED} = require('../../constants/test-statuses');
|
|
17
|
-
const {DATABASE_URLS_JSON_NAME, LOCAL_DATABASE_NAME} = require('../../constants/database');
|
|
18
|
-
const {getShortMD5} = require('../../common-utils');
|
|
19
|
-
const {formatId, mkFullTitle, mergeDatabasesForReuse, filterByEqualDiffSizes} = require('./utils');
|
|
20
|
-
const {getTestsTreeFromDatabase} = require('../../db-utils/server');
|
|
21
|
-
|
|
14
|
+
const { UPDATED } = require('../../constants/test-statuses');
|
|
15
|
+
const { DATABASE_URLS_JSON_NAME, LOCAL_DATABASE_NAME } = require('../../constants/database');
|
|
16
|
+
const { getShortMD5 } = require('../../common-utils');
|
|
17
|
+
const { formatId, mkFullTitle, mergeDatabasesForReuse, filterByEqualDiffSizes } = require('./utils');
|
|
18
|
+
const { getTestsTreeFromDatabase } = require('../../db-utils/server');
|
|
22
19
|
module.exports = class ToolRunner {
|
|
23
20
|
static create(paths, hermione, configs) {
|
|
24
21
|
return new this(paths, hermione, configs);
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
constructor(paths, hermione, {program: globalOpts, pluginConfig, options: guiOpts}) {
|
|
23
|
+
constructor(paths, hermione, { program: globalOpts, pluginConfig, options: guiOpts }) {
|
|
28
24
|
this._testFiles = [].concat(paths);
|
|
29
25
|
this._hermione = hermione;
|
|
30
26
|
this._tree = null;
|
|
31
27
|
this._collection = null;
|
|
32
|
-
|
|
33
28
|
this._globalOpts = globalOpts;
|
|
34
29
|
this._guiOpts = guiOpts;
|
|
35
30
|
this._reportPath = pluginConfig.path;
|
|
36
31
|
this._pluginConfig = pluginConfig;
|
|
37
|
-
|
|
38
32
|
this._eventSource = new EventSource();
|
|
39
33
|
this._reportBuilder = null;
|
|
40
|
-
|
|
41
34
|
this._tests = {};
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
get config() {
|
|
45
37
|
return this._hermione.config;
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
get tree() {
|
|
49
40
|
return this._tree;
|
|
50
41
|
}
|
|
51
|
-
|
|
52
42
|
async initialize() {
|
|
53
43
|
await mergeDatabasesForReuse(this._reportPath);
|
|
54
|
-
|
|
55
|
-
this._reportBuilder = GuiReportBuilder.create(this._hermione, this._pluginConfig, {reuse: true});
|
|
44
|
+
this._reportBuilder = GuiReportBuilder.create(this._hermione, this._pluginConfig, { reuse: true });
|
|
56
45
|
this._subscribeOnEvents();
|
|
57
|
-
|
|
58
46
|
this._collection = await this._readTests();
|
|
59
|
-
|
|
60
47
|
await this._reportBuilder.init();
|
|
61
48
|
await this._reportBuilder.saveStaticFiles();
|
|
62
|
-
|
|
63
49
|
this._reportBuilder.setApiValues(this._hermione.htmlReporter.values);
|
|
64
50
|
await this._handleRunnableCollection();
|
|
65
51
|
}
|
|
66
|
-
|
|
67
52
|
async _readTests() {
|
|
68
|
-
const {grep, set: sets, browser: browsers} = this._globalOpts;
|
|
69
|
-
|
|
70
|
-
return await this._hermione.readTests(this._testFiles, {grep, sets, browsers});
|
|
53
|
+
const { grep, set: sets, browser: browsers } = this._globalOpts;
|
|
54
|
+
return await this._hermione.readTests(this._testFiles, { grep, sets, browsers });
|
|
71
55
|
}
|
|
72
|
-
|
|
73
56
|
finalize() {
|
|
74
57
|
return this._reportBuilder.finalize();
|
|
75
58
|
}
|
|
76
|
-
|
|
77
59
|
addClient(connection) {
|
|
78
60
|
this._eventSource.addConnection(connection);
|
|
79
61
|
}
|
|
80
|
-
|
|
81
62
|
sendClientEvent(event, data) {
|
|
82
63
|
this._eventSource.emit(event, data);
|
|
83
64
|
}
|
|
84
|
-
|
|
85
65
|
getTestsDataToUpdateRefs(imageIds) {
|
|
86
66
|
return this._reportBuilder.getTestsDataToUpdateRefs(imageIds);
|
|
87
67
|
}
|
|
88
|
-
|
|
89
68
|
getImageDataToFindEqualDiffs(imageIds) {
|
|
90
69
|
const [selectedImage, ...comparedImages] = this._reportBuilder.getImageDataToFindEqualDiffs(imageIds);
|
|
91
|
-
|
|
92
70
|
const imagesWithEqualBrowserName = comparedImages.filter((image) => image.browserName === selectedImage.browserName);
|
|
93
71
|
const imagesWithEqualDiffSizes = filterByEqualDiffSizes(imagesWithEqualBrowserName, selectedImage.diffClusters);
|
|
94
|
-
|
|
95
72
|
return _.isEmpty(imagesWithEqualDiffSizes) ? [] : [selectedImage].concat(imagesWithEqualDiffSizes);
|
|
96
73
|
}
|
|
97
|
-
|
|
98
74
|
updateReferenceImage(tests) {
|
|
99
75
|
return Promise.map(tests, (test) => {
|
|
100
76
|
const updateResult = this._prepareTestResult(test);
|
|
101
77
|
const formattedResult = this._reportBuilder.format(updateResult, UPDATED);
|
|
102
78
|
const failResultId = formattedResult.id;
|
|
103
79
|
const updateAttempt = this._reportBuilder.getUpdatedAttempt(formattedResult);
|
|
104
|
-
|
|
105
80
|
formattedResult.attempt = updateAttempt;
|
|
106
81
|
updateResult.attempt = updateAttempt;
|
|
107
|
-
|
|
108
82
|
return Promise.map(updateResult.imagesInfo, (imageInfo) => {
|
|
109
|
-
const {stateName} = imageInfo;
|
|
110
|
-
|
|
83
|
+
const { stateName } = imageInfo;
|
|
111
84
|
return reporterHelper.updateReferenceImage(formattedResult, this._reportPath, stateName)
|
|
112
85
|
.then(() => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
86
|
+
const result = _.extend(updateResult, { refImg: imageInfo.expectedImg });
|
|
87
|
+
this._emitUpdateReference(result, stateName);
|
|
88
|
+
});
|
|
116
89
|
})
|
|
117
90
|
.then(() => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
91
|
+
this._reportBuilder.addUpdated(updateResult, failResultId);
|
|
92
|
+
return this._reportBuilder.getTestBranch(formattedResult.id);
|
|
93
|
+
});
|
|
121
94
|
});
|
|
122
95
|
}
|
|
123
|
-
|
|
124
96
|
async undoAcceptImages(tests) {
|
|
125
97
|
const updatedImages = [], removedResults = [];
|
|
126
|
-
|
|
127
98
|
await Promise.map(tests, async (test) => {
|
|
128
99
|
const updateResult = this._prepareTestResult(test);
|
|
129
100
|
const formattedResult = this._reportBuilder.format(updateResult);
|
|
130
|
-
|
|
131
101
|
formattedResult.attempt = updateResult.attempt;
|
|
132
|
-
|
|
133
102
|
await Promise.map(updateResult.imagesInfo, async (imageInfo) => {
|
|
134
|
-
const {stateName} = imageInfo;
|
|
135
|
-
const {
|
|
136
|
-
updatedImage,
|
|
137
|
-
removedResult,
|
|
138
|
-
previousExpectedPath,
|
|
139
|
-
shouldRemoveReference,
|
|
140
|
-
shouldRevertReference
|
|
141
|
-
} = await this._reportBuilder.undoAcceptImage(formattedResult, stateName);
|
|
142
|
-
|
|
103
|
+
const { stateName } = imageInfo;
|
|
104
|
+
const { updatedImage, removedResult, previousExpectedPath, shouldRemoveReference, shouldRevertReference } = await this._reportBuilder.undoAcceptImage(formattedResult, stateName);
|
|
143
105
|
updatedImage && updatedImages.push(updatedImage);
|
|
144
106
|
removedResult && removedResults.push(removedResult);
|
|
145
|
-
|
|
146
107
|
if (shouldRemoveReference) {
|
|
147
108
|
await reporterHelper.removeReferenceImage(formattedResult, stateName);
|
|
148
109
|
}
|
|
149
|
-
|
|
150
110
|
if (shouldRevertReference) {
|
|
151
111
|
await reporterHelper.revertReferenceImage(formattedResult, stateName);
|
|
152
112
|
}
|
|
153
|
-
|
|
154
113
|
if (previousExpectedPath) {
|
|
155
114
|
formattedResult.updateCacheExpectedPath(stateName, previousExpectedPath);
|
|
156
115
|
}
|
|
157
116
|
});
|
|
158
117
|
});
|
|
159
|
-
|
|
160
|
-
return {updatedImages, removedResults};
|
|
118
|
+
return { updatedImages, removedResults };
|
|
161
119
|
}
|
|
162
|
-
|
|
163
120
|
async findEqualDiffs(images) {
|
|
164
121
|
const [selectedImage, ...comparedImages] = images;
|
|
165
|
-
const {tolerance, antialiasingTolerance} = this.config;
|
|
166
|
-
const compareOpts = {tolerance, antialiasingTolerance, stopOnFirstFail: true, shouldCluster: false};
|
|
122
|
+
const { tolerance, antialiasingTolerance } = this.config;
|
|
123
|
+
const compareOpts = { tolerance, antialiasingTolerance, stopOnFirstFail: true, shouldCluster: false };
|
|
167
124
|
const equalImages = await Promise.filter(comparedImages, async (image) => {
|
|
168
125
|
try {
|
|
169
126
|
await Promise.mapSeries(image.diffClusters, async (diffCluster, i) => {
|
|
170
|
-
const refComparisonRes = await looksSame(
|
|
171
|
-
{source: this._resolveImgPath(selectedImage.expectedImg.path), boundingBox: selectedImage.diffClusters[i]},
|
|
172
|
-
{source: this._resolveImgPath(image.expectedImg.path), boundingBox: diffCluster},
|
|
173
|
-
compareOpts
|
|
174
|
-
);
|
|
175
|
-
|
|
127
|
+
const refComparisonRes = await looksSame({ source: this._resolveImgPath(selectedImage.expectedImg.path), boundingBox: selectedImage.diffClusters[i] }, { source: this._resolveImgPath(image.expectedImg.path), boundingBox: diffCluster }, compareOpts);
|
|
176
128
|
if (!refComparisonRes.equal) {
|
|
177
129
|
return Promise.reject(false);
|
|
178
130
|
}
|
|
179
|
-
|
|
180
|
-
const actComparisonRes = await looksSame(
|
|
181
|
-
{source: this._resolveImgPath(selectedImage.actualImg.path), boundingBox: selectedImage.diffClusters[i]},
|
|
182
|
-
{source: this._resolveImgPath(image.actualImg.path), boundingBox: diffCluster},
|
|
183
|
-
compareOpts
|
|
184
|
-
);
|
|
185
|
-
|
|
131
|
+
const actComparisonRes = await looksSame({ source: this._resolveImgPath(selectedImage.actualImg.path), boundingBox: selectedImage.diffClusters[i] }, { source: this._resolveImgPath(image.actualImg.path), boundingBox: diffCluster }, compareOpts);
|
|
186
132
|
if (!actComparisonRes.equal) {
|
|
187
133
|
return Promise.reject(false);
|
|
188
134
|
}
|
|
189
135
|
});
|
|
190
|
-
|
|
191
136
|
return true;
|
|
192
|
-
}
|
|
137
|
+
}
|
|
138
|
+
catch (err) {
|
|
193
139
|
return err === false ? err : Promise.reject(err);
|
|
194
140
|
}
|
|
195
141
|
});
|
|
196
|
-
|
|
197
142
|
return equalImages.map((image) => image.id);
|
|
198
143
|
}
|
|
199
|
-
|
|
200
144
|
run(tests = []) {
|
|
201
|
-
const {grep, set: sets, browser: browsers} = this._globalOpts;
|
|
202
|
-
|
|
145
|
+
const { grep, set: sets, browser: browsers } = this._globalOpts;
|
|
203
146
|
return Runner.create(this._collection, tests)
|
|
204
|
-
.run((collection) => this._hermione.run(collection, {grep, sets, browsers}));
|
|
147
|
+
.run((collection) => this._hermione.run(collection, { grep, sets, browsers }));
|
|
205
148
|
}
|
|
206
|
-
|
|
207
149
|
async _handleRunnableCollection() {
|
|
208
150
|
this._collection.eachTest((test, browserId) => {
|
|
209
151
|
if (test.disabled || this._isSilentlySkipped(test)) {
|
|
210
152
|
return;
|
|
211
153
|
}
|
|
212
|
-
|
|
213
154
|
// TODO: remove toString after publish major version
|
|
214
155
|
const testId = formatId(test.id.toString(), browserId);
|
|
215
|
-
this._tests[testId] = _.extend(test, {browserId});
|
|
216
|
-
|
|
156
|
+
this._tests[testId] = _.extend(test, { browserId });
|
|
217
157
|
test.pending
|
|
218
158
|
? this._reportBuilder.addSkipped(test)
|
|
219
159
|
: this._reportBuilder.addIdle(test);
|
|
220
160
|
});
|
|
221
|
-
|
|
222
161
|
await this._fillTestsTree();
|
|
223
162
|
}
|
|
224
|
-
|
|
225
|
-
_isSilentlySkipped({silentSkip, parent}) {
|
|
163
|
+
_isSilentlySkipped({ silentSkip, parent }) {
|
|
226
164
|
return silentSkip || parent && this._isSilentlySkipped(parent);
|
|
227
165
|
}
|
|
228
|
-
|
|
229
166
|
_subscribeOnEvents() {
|
|
230
167
|
subscribeOnToolEvents(this._hermione, this._reportBuilder, this._eventSource, this._reportPath);
|
|
231
168
|
}
|
|
232
|
-
|
|
233
169
|
_prepareTestResult(test) {
|
|
234
|
-
const {browserId, attempt} = test;
|
|
170
|
+
const { browserId, attempt } = test;
|
|
235
171
|
const fullTitle = mkFullTitle(test);
|
|
236
172
|
const testId = formatId(getShortMD5(fullTitle), browserId);
|
|
237
173
|
const rawTest = this._tests[testId];
|
|
238
|
-
const {sessionId, url} = test.metaInfo;
|
|
174
|
+
const { sessionId, url } = test.metaInfo;
|
|
239
175
|
const assertViewResults = [];
|
|
240
|
-
|
|
241
176
|
const imagesInfo = test.imagesInfo.map((imageInfo) => {
|
|
242
|
-
const {stateName, actualImg} = imageInfo;
|
|
177
|
+
const { stateName, actualImg } = imageInfo;
|
|
243
178
|
const path = this._hermione.config.browsers[browserId].getScreenshotPath(rawTest, stateName);
|
|
244
|
-
const refImg = {path, size: actualImg.size};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return _.extend(imageInfo, {expectedImg: refImg});
|
|
179
|
+
const refImg = { path, size: actualImg.size };
|
|
180
|
+
assertViewResults.push({ stateName, refImg, currImg: actualImg });
|
|
181
|
+
return _.extend(imageInfo, { expectedImg: refImg });
|
|
249
182
|
});
|
|
250
|
-
|
|
251
|
-
const res = _.merge({}, rawTest, {assertViewResults, imagesInfo, sessionId, attempt, origAttempt: attempt, meta: {url}, updated: true});
|
|
252
|
-
|
|
183
|
+
const res = _.merge({}, rawTest, { assertViewResults, imagesInfo, sessionId, attempt, origAttempt: attempt, meta: { url }, updated: true });
|
|
253
184
|
// _.merge can't fully clone test object since hermione@7+
|
|
254
185
|
// TODO: use separate object to represent test results. Do not extend test object with test results
|
|
255
186
|
return rawTest && rawTest.clone
|
|
256
187
|
? Object.assign(rawTest.clone(), res)
|
|
257
188
|
: res;
|
|
258
189
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
this._hermione.emit(
|
|
262
|
-
this._hermione.events.UPDATE_REFERENCE,
|
|
263
|
-
{refImg, state}
|
|
264
|
-
);
|
|
190
|
+
_emitUpdateReference({ refImg }, state) {
|
|
191
|
+
this._hermione.emit(this._hermione.events.UPDATE_REFERENCE, { refImg, state });
|
|
265
192
|
}
|
|
266
|
-
|
|
267
193
|
async _fillTestsTree() {
|
|
268
|
-
const {autoRun} = this._guiOpts;
|
|
194
|
+
const { autoRun } = this._guiOpts;
|
|
269
195
|
const testsTree = await this._loadDataFromDatabase();
|
|
270
|
-
|
|
271
196
|
if (!_.isEmpty(testsTree)) {
|
|
272
197
|
this._reportBuilder.reuseTestsTree(testsTree);
|
|
273
198
|
}
|
|
274
|
-
|
|
275
|
-
this._tree = {...this._reportBuilder.getResult(), autoRun};
|
|
199
|
+
this._tree = { ...this._reportBuilder.getResult(), autoRun };
|
|
276
200
|
}
|
|
277
|
-
|
|
278
201
|
async _loadDataFromDatabase() {
|
|
279
202
|
const dbPath = path.resolve(this._reportPath, LOCAL_DATABASE_NAME);
|
|
280
|
-
|
|
281
203
|
if (await fs.pathExists(dbPath)) {
|
|
282
204
|
return getTestsTreeFromDatabase(dbPath);
|
|
283
205
|
}
|
|
284
|
-
|
|
285
206
|
logger.warn(chalk.yellow(`Nothing to reuse in ${this._reportPath}: can not load data from ${DATABASE_URLS_JSON_NAME}`));
|
|
286
|
-
|
|
287
207
|
return {};
|
|
288
208
|
}
|
|
289
|
-
|
|
290
209
|
_resolveImgPath(imgPath) {
|
|
291
210
|
return path.resolve(process.cwd(), this._pluginConfig.path, imgPath);
|
|
292
211
|
}
|
|
293
212
|
};
|
|
213
|
+
//# sourceMappingURL=index.js.map
|