html-reporter 9.10.0 → 9.10.2
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.css +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.css +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.css +0 -1
- 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.css +0 -1
- 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/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
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import {getSuiteResults} from '../../../selectors/tree';
|
|
3
|
-
import {isNodeFailed} from '../../../utils';
|
|
4
|
-
import {determineStatus, isFailStatus} from '../../../../../common-utils';
|
|
5
|
-
import {changeNodeState, getShownCheckedChildCount, shouldNodeBeOpened} from '../helpers';
|
|
6
|
-
import {EXPAND_RETRIES} from '../../../../../constants/expand-modes';
|
|
7
|
-
import {FAIL} from '../../../../../constants/test-statuses';
|
|
8
|
-
import {INDETERMINATE, UNCHECKED} from '../../../../../constants/checked-statuses';
|
|
9
|
-
|
|
10
|
-
export function initSuitesState(tree, view) {
|
|
11
|
-
changeAllSuitesState(tree, {checkStatus: UNCHECKED});
|
|
12
|
-
|
|
13
|
-
if (view.keyToGroupTestsBy) {
|
|
14
|
-
changeAllSuitesState(tree, {shouldBeShown: false});
|
|
15
|
-
} else {
|
|
16
|
-
calcSuitesShowness(tree);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
calcSuitesOpenness(tree, view.expand);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function changeAllSuitesState(tree, state) {
|
|
23
|
-
tree.suites.allIds.forEach((suiteId) => {
|
|
24
|
-
changeSuiteState(tree, suiteId, state);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function changeSuiteState(tree, suiteId, state) {
|
|
29
|
-
changeNodeState(tree.suites.stateById, suiteId, state);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function updateSuitesStatus(tree, suites) {
|
|
33
|
-
suites.forEach(({id, status}) => {
|
|
34
|
-
if (tree.suites.byId[id].status !== status) {
|
|
35
|
-
tree.suites.byId[id].status = status;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function updateParentsChecked(tree, parentIds) {
|
|
41
|
-
const youngerSuites = [].concat(parentIds)
|
|
42
|
-
.filter(parentId => parentId)
|
|
43
|
-
.map((suiteId) => tree.suites.byId[suiteId]);
|
|
44
|
-
|
|
45
|
-
const changeParentSuiteCb = (parentSuite) => {
|
|
46
|
-
changeSuiteState(tree, parentSuite.id, {checkStatus: shouldSuiteBeChecked(parentSuite, tree)});
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
youngerSuites.forEach(changeParentSuiteCb);
|
|
50
|
-
|
|
51
|
-
calcParentSuitesState(youngerSuites, tree, changeParentSuiteCb);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function getFailedRootSuiteIds(suites) {
|
|
55
|
-
return suites.allRootIds.filter((rootId) => {
|
|
56
|
-
return isNodeFailed(suites.byId[rootId]);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function updateAllSuitesStatus(tree, filteredBrowsers) {
|
|
61
|
-
const childSuitesIds = _(tree.browsers.allIds)
|
|
62
|
-
.map((browserId) => tree.browsers.byId[browserId].parentId)
|
|
63
|
-
.uniq()
|
|
64
|
-
.value();
|
|
65
|
-
|
|
66
|
-
return updateParentSuitesStatus(tree, childSuitesIds, filteredBrowsers);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function calcSuitesShowness(tree, suiteIds) {
|
|
70
|
-
const youngestSuites = _.isEmpty(suiteIds)
|
|
71
|
-
? getYoungestSuites(tree)
|
|
72
|
-
: [].concat(suiteIds).map((suiteId) => tree.suites.byId[suiteId]);
|
|
73
|
-
|
|
74
|
-
youngestSuites.forEach((suite) => {
|
|
75
|
-
const shouldBeShown = suite.browserIds
|
|
76
|
-
.some((browserId) => tree.browsers.stateById[browserId].shouldBeShown);
|
|
77
|
-
const checkStatus = shouldSuiteBeChecked(suite, tree);
|
|
78
|
-
|
|
79
|
-
changeSuiteState(tree, suite.id, {shouldBeShown, checkStatus});
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
const changeParentSuiteCb = (parentSuite) => {
|
|
83
|
-
changeSuiteState(tree, parentSuite.id, {
|
|
84
|
-
shouldBeShown: shouldSuiteBeShown(parentSuite, tree),
|
|
85
|
-
checkStatus: shouldSuiteBeChecked(parentSuite, tree)
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
calcParentSuitesState(youngestSuites, tree, changeParentSuiteCb);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export function calcSuitesOpenness(tree, expand, suiteIds) {
|
|
93
|
-
if (expand !== EXPAND_RETRIES) {
|
|
94
|
-
if (_.isEmpty(suiteIds)) {
|
|
95
|
-
suiteIds = tree.suites.allIds;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
[].concat(suiteIds).forEach((suiteId) => {
|
|
99
|
-
const suite = tree.suites.byId[suiteId];
|
|
100
|
-
const shouldBeOpened = calcSuiteOpenness(suite, expand, tree);
|
|
101
|
-
|
|
102
|
-
changeSuiteState(tree, suiteId, {shouldBeOpened});
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const youngestSuites = _.isEmpty(suiteIds)
|
|
109
|
-
? getYoungestSuites(tree)
|
|
110
|
-
: [].concat(suiteIds).map((suiteId) => tree.suites.byId[suiteId]);
|
|
111
|
-
|
|
112
|
-
youngestSuites.forEach((suite) => {
|
|
113
|
-
const shouldBeOpened = calcSuiteOpenness(suite, expand, tree);
|
|
114
|
-
changeSuiteState(tree, suite.id, {shouldBeOpened});
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const changeParentSuiteCb = (parentSuite) => {
|
|
118
|
-
changeSuiteState(tree, parentSuite.id, {shouldBeOpened: shouldSuiteBeOpened(parentSuite, tree)});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
calcParentSuitesState(youngestSuites, tree, changeParentSuiteCb);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function failSuites(tree, suiteIds) {
|
|
125
|
-
const processingSuiteIds = [].concat(suiteIds);
|
|
126
|
-
|
|
127
|
-
while (!_.isEmpty(processingSuiteIds)) {
|
|
128
|
-
const suiteId = processingSuiteIds.pop();
|
|
129
|
-
const suite = tree.suites.byId[suiteId];
|
|
130
|
-
|
|
131
|
-
if (isFailStatus(suite.status)) {
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
suite.status = FAIL;
|
|
136
|
-
|
|
137
|
-
if (!suite.parentId) {
|
|
138
|
-
tree.suites.failedRootIds.push(suite.id);
|
|
139
|
-
} else {
|
|
140
|
-
processingSuiteIds.push(suite.parentId);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function calcParentSuitesState(youngerSuites, tree, callback) {
|
|
146
|
-
const closestParentSuites = new Set();
|
|
147
|
-
const closestParentSuiteIds = [];
|
|
148
|
-
|
|
149
|
-
sortSuitesByNesting([...youngerSuites]).forEach((suite) => {
|
|
150
|
-
if (!suite.parentId) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const parentSuite = tree.suites.byId[suite.parentId];
|
|
155
|
-
const uniqParentSuiteId = parentSuite.suitePath.join('|') + '|';
|
|
156
|
-
|
|
157
|
-
if (closestParentSuiteIds.some((parentId) => parentId.startsWith(uniqParentSuiteId))) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
closestParentSuites.add(parentSuite);
|
|
162
|
-
closestParentSuiteIds.push(uniqParentSuiteId);
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
if (_.isEmpty(closestParentSuites)) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
for (const parentSuite of closestParentSuites) {
|
|
170
|
-
callback(parentSuite);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
calcParentSuitesState(closestParentSuites, tree, callback);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function sortSuitesByNesting(suites) {
|
|
177
|
-
return suites.sort((a, b) => b.suitePath.length - a.suitePath.length);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function getYoungestSuites(tree) {
|
|
181
|
-
return tree.suites.allIds
|
|
182
|
-
.filter((suiteId) => {
|
|
183
|
-
const suite = tree.suites.byId[suiteId];
|
|
184
|
-
return _.isEmpty(suite.suiteIds) && !_.isEmpty(suite.browserIds);
|
|
185
|
-
})
|
|
186
|
-
.map((suiteId) => tree.suites.byId[suiteId]);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function calcSuiteOpenness(suite, expand, tree) {
|
|
190
|
-
const errorsCb = () => isNodeFailed(suite);
|
|
191
|
-
const retriesCb = () => {
|
|
192
|
-
const preparedTree = {suites: tree.suites.byId, browsers: tree.browsers.byId, results: tree.results.byId};
|
|
193
|
-
const retries = getSuiteResults(suite, preparedTree, _.initial);
|
|
194
|
-
|
|
195
|
-
return retries.some((retry) => isNodeFailed(retry));
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
return shouldNodeBeOpened(expand, {errorsCb, retriesCb});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function shouldSuiteBeShown(suite, tree) {
|
|
202
|
-
return shouldSuiteBe(suite, tree, 'shouldBeShown');
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function shouldSuiteBeOpened(suite, tree) {
|
|
206
|
-
return shouldSuiteBe(suite, tree, 'shouldBeOpened');
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function shouldSuiteBeChecked(suite, tree) {
|
|
210
|
-
const shownChildSuiteCount = (tree.suites.byId[suite.id].suiteIds || [])
|
|
211
|
-
.reduce((count, childSuiteId) => count + tree.suites.stateById[childSuiteId].shouldBeShown, 0);
|
|
212
|
-
const shownChildBrowserCount = (tree.suites.byId[suite.id].browserIds || [])
|
|
213
|
-
.reduce((count, childBrowserId) => count + tree.browsers.stateById[childBrowserId].shouldBeShown, 0);
|
|
214
|
-
const childCount = shownChildSuiteCount + shownChildBrowserCount;
|
|
215
|
-
const checkedChildCount = getShownCheckedChildCount(tree, suite.id);
|
|
216
|
-
|
|
217
|
-
return Number((checkedChildCount === childCount) || (checkedChildCount && INDETERMINATE));
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function shouldSuiteBe(suite, tree, field) {
|
|
221
|
-
return (suite.suiteIds || []).some((suiteId) => tree.suites.stateById[suiteId][field])
|
|
222
|
-
|| (suite.browserIds || []).some((browserId) => tree.browsers.stateById[browserId][field]);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function updateParentSuitesStatus(tree, suitesIds = [], filteredBrowsers) {
|
|
226
|
-
if (!suitesIds || !suitesIds.length) {
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const suites = [].concat(suitesIds).map((id) => tree.suites.byId[id]);
|
|
231
|
-
const parentsToUpdate = new Set();
|
|
232
|
-
|
|
233
|
-
suites.forEach((s) => {
|
|
234
|
-
const newStatus = getChildSuitesStatus(tree, s, filteredBrowsers);
|
|
235
|
-
if (newStatus === s.status) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
s.status = newStatus;
|
|
240
|
-
if (s.parentId) {
|
|
241
|
-
parentsToUpdate.add(s.parentId);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
updateParentSuitesStatus(tree, Array.from(parentsToUpdate), filteredBrowsers);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function getChildSuitesStatus(tree, suite, filteredBrowsers) {
|
|
249
|
-
let childStatuses = [];
|
|
250
|
-
|
|
251
|
-
if (suite.suiteIds) {
|
|
252
|
-
childStatuses = suite.suiteIds.map((id) => tree.suites.byId[id].status);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
if (suite.browserIds) {
|
|
256
|
-
const suiteBrowsers = suite.browserIds
|
|
257
|
-
.map((id) => tree.browsers.byId[id])
|
|
258
|
-
.filter(({name, version}) => {
|
|
259
|
-
const res = filteredBrowsers.some(({id: filteredName, versions: filteredVersions}) => {
|
|
260
|
-
return filteredName === name && (filteredVersions.includes(version) || !filteredVersions.length);
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
return res;
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
const suiteBrowserStatuses = suiteBrowsers.map(({resultIds}) => tree.results.byId[_.last(resultIds)].status);
|
|
267
|
-
childStatuses = childStatuses.concat(suiteBrowserStatuses);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return determineStatus(childStatuses);
|
|
271
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import url from 'url';
|
|
2
|
-
import {isEmpty} from 'lodash';
|
|
3
|
-
import {getViewQuery} from '../custom-queries';
|
|
4
|
-
import * as localStorageWrapper from '../local-storage-wrapper';
|
|
5
|
-
import actionNames from '../action-names';
|
|
6
|
-
import diffModes from '../../../constants/diff-modes';
|
|
7
|
-
import {EXPAND_ALL, COLLAPSE_ALL, EXPAND_ERRORS, EXPAND_RETRIES} from '../../../constants/expand-modes';
|
|
8
|
-
|
|
9
|
-
export default (state, action) => {
|
|
10
|
-
switch (action.type) {
|
|
11
|
-
case actionNames.INIT_GUI_REPORT:
|
|
12
|
-
case actionNames.INIT_STATIC_REPORT: {
|
|
13
|
-
const {baseHost, defaultView: viewMode, diffMode} = state.config;
|
|
14
|
-
const viewQuery = getViewQuery(window.location.search);
|
|
15
|
-
const lsView = localStorageWrapper.getItem('view', {});
|
|
16
|
-
|
|
17
|
-
if (isEmpty(viewQuery.filteredBrowsers)) {
|
|
18
|
-
viewQuery.filteredBrowsers = state.browsers;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return {...state, view: {...state.view, viewMode, diffMode, baseHost, ...lsView, ...viewQuery}};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
case actionNames.VIEW_UPDATE_BASE_HOST: {
|
|
25
|
-
const baseHost = action.host;
|
|
26
|
-
const parsedHost = parseHost(baseHost);
|
|
27
|
-
|
|
28
|
-
return {...state, view: {...state.view, baseHost, parsedHost}};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
case actionNames.VIEW_EXPAND_ALL:
|
|
32
|
-
return {...state, view: {...state.view, expand: EXPAND_ALL}};
|
|
33
|
-
|
|
34
|
-
case actionNames.VIEW_EXPAND_ERRORS:
|
|
35
|
-
return {...state, view: {...state.view, expand: EXPAND_ERRORS}};
|
|
36
|
-
|
|
37
|
-
case actionNames.VIEW_EXPAND_RETRIES:
|
|
38
|
-
return {...state, view: {...state.view, expand: EXPAND_RETRIES}};
|
|
39
|
-
|
|
40
|
-
case actionNames.VIEW_COLLAPSE_ALL:
|
|
41
|
-
return {...state, view: {...state.view, expand: COLLAPSE_ALL}};
|
|
42
|
-
|
|
43
|
-
case actionNames.CHANGE_VIEW_MODE:
|
|
44
|
-
return {...state, view: {...state.view, viewMode: action.payload}};
|
|
45
|
-
|
|
46
|
-
case actionNames.VIEW_UPDATE_FILTER_BY_NAME:
|
|
47
|
-
return {...state, view: {...state.view, testNameFilter: action.testNameFilter}};
|
|
48
|
-
|
|
49
|
-
case actionNames.VIEW_SET_STRICT_MATCH_FILTER:
|
|
50
|
-
return {...state, view: {...state.view, strictMatchFilter: action.strictMatchFilter}};
|
|
51
|
-
|
|
52
|
-
case actionNames.GROUP_TESTS_BY_KEY:
|
|
53
|
-
return {...state, view: {...state.view, keyToGroupTestsBy: action.payload}};
|
|
54
|
-
|
|
55
|
-
case actionNames.BROWSERS_SELECTED:
|
|
56
|
-
return {...state, view: {...state.view, filteredBrowsers: action.payload.browsers}};
|
|
57
|
-
|
|
58
|
-
case actionNames.VIEW_THREE_UP_DIFF:
|
|
59
|
-
return {...state, view: {...state.view, diffMode: diffModes.THREE_UP.id}};
|
|
60
|
-
|
|
61
|
-
case actionNames.VIEW_THREE_UP_SCALED_DIFF:
|
|
62
|
-
return {...state, view: {...state.view, diffMode: diffModes.THREE_UP_SCALED.id}};
|
|
63
|
-
|
|
64
|
-
case actionNames.VIEW_THREE_UP_SCALED_TO_FIT_DIFF:
|
|
65
|
-
return {...state, view: {...state.view, diffMode: diffModes.THREE_UP_SCALED_TO_FIT.id}};
|
|
66
|
-
|
|
67
|
-
case actionNames.VIEW_ONLY_DIFF:
|
|
68
|
-
return {...state, view: {...state.view, diffMode: diffModes.ONLY_DIFF.id}};
|
|
69
|
-
|
|
70
|
-
case actionNames.VIEW_SWITCH_DIFF:
|
|
71
|
-
return {...state, view: {...state.view, diffMode: diffModes.SWITCH.id}};
|
|
72
|
-
|
|
73
|
-
case actionNames.VIEW_SWIPE_DIFF:
|
|
74
|
-
return {...state, view: {...state.view, diffMode: diffModes.SWIPE.id}};
|
|
75
|
-
|
|
76
|
-
case actionNames.VIEW_ONION_SKIN_DIFF:
|
|
77
|
-
return {...state, view: {...state.view, diffMode: diffModes.ONION_SKIN.id}};
|
|
78
|
-
|
|
79
|
-
default:
|
|
80
|
-
return state;
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
function parseHost(baseHost) {
|
|
85
|
-
const parsedHost = url.parse(baseHost, false, true);
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
host: parsedHost.slashes ? parsedHost.host : baseHost,
|
|
89
|
-
protocol: parsedHost.slashes ? parsedHost.protocol : null,
|
|
90
|
-
hostname: null,
|
|
91
|
-
port: null
|
|
92
|
-
};
|
|
93
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import {createSelector} from 'reselect';
|
|
2
|
-
import {getKeyToGroupTestsBy} from './view';
|
|
3
|
-
import {parseKeyToGroupTestsBy} from '../utils';
|
|
4
|
-
|
|
5
|
-
export const getParsedKeyToGroupTestsBy = createSelector(
|
|
6
|
-
getKeyToGroupTestsBy,
|
|
7
|
-
(keyToGroupTestsBy) => keyToGroupTestsBy ? parseKeyToGroupTestsBy(keyToGroupTestsBy) : []
|
|
8
|
-
);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {createSelector} from 'reselect';
|
|
2
|
-
import {isEmpty, keys, flatten, forEach} from 'lodash';
|
|
3
|
-
import {getFilteredBrowsers} from './view';
|
|
4
|
-
|
|
5
|
-
const getStats = (state) => state.stats;
|
|
6
|
-
|
|
7
|
-
export const getStatsFilteredByBrowsers = createSelector(
|
|
8
|
-
getStats, getFilteredBrowsers,
|
|
9
|
-
(stats, filteredBrowsers) => {
|
|
10
|
-
if (isEmpty(filteredBrowsers) || isEmpty(stats.perBrowser)) {
|
|
11
|
-
return stats.all;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const resStats = {};
|
|
15
|
-
const rows = filteredBrowsers.map((browserToFilterBy) => {
|
|
16
|
-
const {id, versions} = browserToFilterBy;
|
|
17
|
-
|
|
18
|
-
return isEmpty(versions)
|
|
19
|
-
? keys(stats.perBrowser[id]).map((ver) => stats.perBrowser[id][ver])
|
|
20
|
-
: versions.map((ver) => stats.perBrowser[id][ver]);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
flatten(rows).forEach((stats) => {
|
|
24
|
-
forEach(stats, (value, stat) => {
|
|
25
|
-
resStats[stat] = resStats[stat] === undefined
|
|
26
|
-
? value
|
|
27
|
-
: resStats[stat] + value;
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return resStats;
|
|
32
|
-
}
|
|
33
|
-
);
|
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import {last, identity, flatMap, compact, findLast} from 'lodash';
|
|
2
|
-
import {createSelector} from 'reselect';
|
|
3
|
-
import {getViewMode} from './view';
|
|
4
|
-
import viewModes from '../../../constants/view-modes';
|
|
5
|
-
import {isIdleStatus} from '../../../common-utils';
|
|
6
|
-
import {isNodeFailed, isNodeSuccessful, isAcceptable, iterateSuites} from '../utils';
|
|
7
|
-
|
|
8
|
-
const getSuites = (state) => state.tree.suites.byId;
|
|
9
|
-
const getSuitesStates = (state) => state.tree.suites.stateById;
|
|
10
|
-
const getBrowsers = (state) => state.tree.browsers.byId;
|
|
11
|
-
const getBrowserIds = (state) => state.tree.browsers.allIds;
|
|
12
|
-
const getBrowsersStates = (state) => state.tree.browsers.stateById;
|
|
13
|
-
const getResults = (state) => state.tree.results.byId;
|
|
14
|
-
const getImages = (state) => state.tree.images.byId;
|
|
15
|
-
const getImagesStates = (state) => state.tree.images.stateById;
|
|
16
|
-
const getAllRootSuiteIds = (state) => state.tree.suites.allRootIds;
|
|
17
|
-
const getFailedRootSuiteIds = (state) => state.tree.suites.failedRootIds;
|
|
18
|
-
const getRootSuiteIds = (state) => {
|
|
19
|
-
const viewMode = getViewMode(state);
|
|
20
|
-
return viewMode === viewModes.FAILED ? state.tree.suites.failedRootIds : state.tree.suites.allRootIds;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getSuiteById = (state, {suiteId}) => state.tree.suites.byId[suiteId];
|
|
24
|
-
const getImageById = (state, {imageId}) => state.tree.images.byId[imageId];
|
|
25
|
-
|
|
26
|
-
export const mkGetTestsBySuiteId = () => createSelector(
|
|
27
|
-
getSuiteById, getSuites, getBrowsers,
|
|
28
|
-
(suite, suites, browsers) => {
|
|
29
|
-
const suiteBrowsers = getSuiteBrowsers(suite, {suites, browsers});
|
|
30
|
-
|
|
31
|
-
return suiteBrowsers.map(({parentId, name}) => ({testName: parentId, browserName: name}));
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export const mkGetLastImageByStateName = () => createSelector(
|
|
36
|
-
getImageById, getBrowsers, getResults, getImages,
|
|
37
|
-
getLastImageByStateName
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
export const getFailedTests = createSelector(
|
|
41
|
-
getSuites, getBrowsers, getResults, getFailedRootSuiteIds,
|
|
42
|
-
(suites, browsers, results, failedRootSuiteIds) => {
|
|
43
|
-
const lastResults = flatMap(failedRootSuiteIds, (suiteId) => getSuiteResults(suites[suiteId], {suites, browsers, results}, last));
|
|
44
|
-
const failedLastResults = lastResults.filter((result) => isNodeFailed(result));
|
|
45
|
-
|
|
46
|
-
return failedLastResults.map((result) => {
|
|
47
|
-
const browserId = result.parentId;
|
|
48
|
-
const {parentId: testName, name: browserName} = browsers[browserId];
|
|
49
|
-
|
|
50
|
-
return {testName, browserName, metaInfo: result.metaInfo};
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export const getCheckedTests = createSelector(
|
|
56
|
-
getBrowserIds, getBrowsers, getBrowsersStates,
|
|
57
|
-
(browserIds, browsers, browsersStates) => {
|
|
58
|
-
const checkedBrowsers = browserIds.filter((browserId) => browsersStates[browserId].checkStatus);
|
|
59
|
-
|
|
60
|
-
return checkedBrowsers.map((browserId) => ({
|
|
61
|
-
testName: browsers[browserId].parentId,
|
|
62
|
-
browserName: browsers[browserId].name
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
export const getAcceptableImagesByStateName = createSelector(
|
|
68
|
-
getBrowsersStates, getBrowsers, getResults, getImages,
|
|
69
|
-
(browsersStates, browsers, results, images) => {
|
|
70
|
-
const getImageInfo = (image) => {
|
|
71
|
-
const browser = getImageBrowser(image, browsers, results);
|
|
72
|
-
|
|
73
|
-
return {suiteId: browser.parentId, browserName: browser.name};
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const sortImages = (imgA, imgB) => {
|
|
77
|
-
const {suiteId: suiteIdA, browserName: browserNameA} = getImageInfo(imgA);
|
|
78
|
-
const {suiteId: suiteIdB, browserName: browserNameB} = getImageInfo(imgB);
|
|
79
|
-
|
|
80
|
-
const compareSuiteIdsRes = suiteIdA.localeCompare(suiteIdB);
|
|
81
|
-
|
|
82
|
-
return compareSuiteIdsRes === 0
|
|
83
|
-
? browserNameA.localeCompare(browserNameB)
|
|
84
|
-
: compareSuiteIdsRes;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const matchedBrowsers = Object.keys(browsersStates)
|
|
88
|
-
.filter((browserId) => browsersStates[browserId].shouldBeShown)
|
|
89
|
-
.map((browserId) => browsers[browserId]);
|
|
90
|
-
|
|
91
|
-
const preparedImages = flatMap(matchedBrowsers, (browser) => getBrowserImages(browser, {results, images}))
|
|
92
|
-
.filter(isAcceptable)
|
|
93
|
-
.sort(sortImages);
|
|
94
|
-
|
|
95
|
-
return preparedImages.reduce((acc, image) => {
|
|
96
|
-
const lastImage = getLastImageByStateName(image, browsers, results, images);
|
|
97
|
-
|
|
98
|
-
if (isNodeSuccessful(lastImage)) {
|
|
99
|
-
return acc;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const result = results[image.parentId];
|
|
103
|
-
const stateNameId = `${result.parentId} ${image.stateName}`;
|
|
104
|
-
|
|
105
|
-
if (acc[stateNameId]) {
|
|
106
|
-
acc[stateNameId].push(image);
|
|
107
|
-
} else {
|
|
108
|
-
acc[stateNameId] = [image];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return acc;
|
|
112
|
-
}, {});
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
const getActiveTestSuites = createSelector(
|
|
117
|
-
getAllRootSuiteIds, getSuites, getSuitesStates,
|
|
118
|
-
(rootSuiteIds, suites, suitesStates) => {
|
|
119
|
-
const filterFn = (suite) => {
|
|
120
|
-
const {shouldBeShown, shouldBeOpened} = suitesStates[suite.id];
|
|
121
|
-
|
|
122
|
-
return shouldBeShown && shouldBeOpened;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const activeRootSuites = rootSuiteIds
|
|
126
|
-
.map((rootSuiteId) => suites[rootSuiteId])
|
|
127
|
-
.filter(filterFn);
|
|
128
|
-
|
|
129
|
-
return flatMap(activeRootSuites, (rootSuite) => getTestSuites(rootSuite, {suites}, filterFn));
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const getActiveBrowsers = createSelector(
|
|
134
|
-
getActiveTestSuites, getBrowsers, getBrowsersStates, getActiveTestSuites,
|
|
135
|
-
(activeYoungestSuites, browsers, browsersStates) => {
|
|
136
|
-
return flatMap(activeYoungestSuites, (suite) => suite.browserIds)
|
|
137
|
-
.filter((browserId) => {
|
|
138
|
-
const {shouldBeShown, shouldBeOpened} = browsersStates[browserId];
|
|
139
|
-
return shouldBeShown && shouldBeOpened;
|
|
140
|
-
})
|
|
141
|
-
.map((browserId) => browsers[browserId]);
|
|
142
|
-
}
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
const getActiveResults = createSelector(
|
|
146
|
-
getActiveBrowsers, getBrowsersStates, getResults,
|
|
147
|
-
(activeBrowsers, browsersStates, results) => {
|
|
148
|
-
return activeBrowsers.map((browser) => {
|
|
149
|
-
const {retryIndex} = browsersStates[browser.id];
|
|
150
|
-
const resultId = browser.resultIds[retryIndex];
|
|
151
|
-
|
|
152
|
-
return results[resultId];
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
);
|
|
156
|
-
|
|
157
|
-
const getActiveImages = createSelector(
|
|
158
|
-
getActiveResults, getImages, getImagesStates,
|
|
159
|
-
(activeResults, images, imagesStates) => {
|
|
160
|
-
return flatMap(activeResults, (result) => {
|
|
161
|
-
return result.imageIds
|
|
162
|
-
.filter((imageId) => imagesStates[imageId].shouldBeOpened)
|
|
163
|
-
.map((imageId) => images[imageId]);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
export const getAcceptableOpenedImageIds = createSelector(
|
|
169
|
-
getActiveImages,
|
|
170
|
-
(activeImages) => activeImages.filter(isAcceptable).map((image) => image.id)
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
export const getFailedOpenedImageIds = createSelector(
|
|
174
|
-
getActiveImages,
|
|
175
|
-
(activeImages) => activeImages.filter(isNodeFailed).map((image) => image.id)
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
export const getVisibleRootSuiteIds = createSelector(
|
|
179
|
-
getRootSuiteIds, getSuitesStates,
|
|
180
|
-
(rootSuiteIds, suitesStates) => rootSuiteIds.filter((suiteId) => suitesStates[suiteId].shouldBeShown)
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
export function getSuiteResults(node, tree, filterFn = identity) {
|
|
184
|
-
const {suites, browsers, results} = tree;
|
|
185
|
-
|
|
186
|
-
return iterateSuites(node, {
|
|
187
|
-
suiteCb: (suiteId) => getSuiteResults(suites[suiteId], tree, filterFn),
|
|
188
|
-
browserCb: (browserId) => {
|
|
189
|
-
return [].concat(filterFn(browsers[browserId].resultIds)).map((resultId) => results[resultId]);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function getTestSuites(suite, tree, filterFn = identity) {
|
|
195
|
-
if (!filterFn(suite)) {
|
|
196
|
-
return [];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return iterateSuites(suite, {
|
|
200
|
-
suiteCb: (suiteId) => getTestSuites(tree.suites[suiteId], tree, filterFn),
|
|
201
|
-
browserIdsCb: (_, parent) => [parent]
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function getSuiteBrowsers(suite, tree) {
|
|
206
|
-
const {suites, browsers} = tree;
|
|
207
|
-
|
|
208
|
-
if (suite.browserIds) {
|
|
209
|
-
return suite.browserIds.map((browserId) => browsers[browserId]);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return flatMap(suite.suiteIds, (suiteId) => getSuiteBrowsers(suites[suiteId], tree));
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
function getBrowserImages(node, tree) {
|
|
216
|
-
const {results, images} = tree;
|
|
217
|
-
|
|
218
|
-
if (node.imageIds) {
|
|
219
|
-
return [].concat(node.imageIds).map((imageId) => images[imageId]);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return flatMap(node.resultIds, (resultId) => {
|
|
223
|
-
return getBrowserImages(results[resultId], tree);
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export function getFailedSuiteResults(tree) {
|
|
228
|
-
const failedRootSuites = tree.suites.failedRootIds.map((suiteId) => tree.suites.byId[suiteId]);
|
|
229
|
-
const failedTestSuites = compact(flatMap(failedRootSuites, (failedRootSuite) => getFailedTestSuites(failedRootSuite, tree.suites.byId)));
|
|
230
|
-
|
|
231
|
-
return flatMap(failedTestSuites, (suite) => iterateSuites(suite, {
|
|
232
|
-
browserCb: (browserId) => {
|
|
233
|
-
const browser = tree.browsers.byId[browserId];
|
|
234
|
-
return browser.resultIds.map((resultId) => tree.results.byId[resultId]);
|
|
235
|
-
}
|
|
236
|
-
}));
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
function getFailedTestSuites(suite, suites) {
|
|
240
|
-
if (!isNodeFailed(suite)) {
|
|
241
|
-
return [];
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return iterateSuites(suite, {
|
|
245
|
-
suiteCb: (suiteId) => getFailedTestSuites(suites[suiteId], suites),
|
|
246
|
-
browserIdsCb: (_, parent) => [parent]
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function getLastImageByStateName(image, browsers, results, images) {
|
|
251
|
-
const browser = getImageBrowser(image, browsers, results);
|
|
252
|
-
const allBrowserImages = flatMap(browser.resultIds, (resultId) => {
|
|
253
|
-
return results[resultId].imageIds.map((imgId) => images[imgId]);
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
return findLast(allBrowserImages, {stateName: image.stateName});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function getImageBrowser(image, browsers, results) {
|
|
260
|
-
const result = results[image.parentId];
|
|
261
|
-
return browsers[result.parentId];
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export const areAllRootSuitesIdle = createSelector(
|
|
265
|
-
getAllRootSuiteIds, getSuites,
|
|
266
|
-
(allRootSuiteIds, suites) => {
|
|
267
|
-
return !allRootSuiteIds.some((id) => !isIdleStatus(suites[id].status));
|
|
268
|
-
}
|
|
269
|
-
);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const getFilteredBrowsers = (state) => state.view.filteredBrowsers;
|
|
2
|
-
export const getTestNameFilter = (state) => state.view.testNameFilter;
|
|
3
|
-
export const getStrictMatchFilter = (state) => state.view.strictMatchFilter;
|
|
4
|
-
export const getViewMode = (state) => state.view.viewMode;
|
|
5
|
-
export const getKeyToGroupTestsBy = (state) => state.view.keyToGroupTestsBy;
|