@allurereport/web-awesome 3.0.0-beta.3
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/.babelrc.js +46 -0
- package/.eslintrc.cjs +15 -0
- package/README.md +27 -0
- package/dist/multi/141.app-b6362ca0.js +1 -0
- package/dist/multi/222.app-b6362ca0.js +1 -0
- package/dist/multi/335.app-b6362ca0.js +1 -0
- package/dist/multi/34.app-b6362ca0.js +1 -0
- package/dist/multi/349.app-b6362ca0.js +1 -0
- package/dist/multi/378.app-b6362ca0.js +1 -0
- package/dist/multi/406.app-b6362ca0.js +1 -0
- package/dist/multi/476.app-b6362ca0.js +1 -0
- package/dist/multi/53.app-b6362ca0.js +1 -0
- package/dist/multi/584.app-b6362ca0.js +1 -0
- package/dist/multi/690.app-b6362ca0.js +1 -0
- package/dist/multi/747.app-b6362ca0.js +1 -0
- package/dist/multi/767.app-b6362ca0.js +1 -0
- package/dist/multi/816.app-b6362ca0.js +1 -0
- package/dist/multi/83.app-b6362ca0.js +1 -0
- package/dist/multi/873.app-b6362ca0.js +1 -0
- package/dist/multi/920.app-b6362ca0.js +1 -0
- package/dist/multi/991.app-b6362ca0.js +1 -0
- package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
- package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
- package/dist/multi/app-b6362ca0.js +2 -0
- package/dist/multi/app-b6362ca0.js.LICENSE.txt +16 -0
- package/dist/multi/manifest.json +26 -0
- package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
- package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
- package/dist/multi/styles-b6362ca0.css +363 -0
- package/dist/single/app-57ae0a60.js +2 -0
- package/dist/single/app-57ae0a60.js.LICENSE.txt +16 -0
- package/dist/single/manifest.json +3 -0
- package/package.json +93 -0
- package/postcss.config.js +5 -0
- package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
- package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
- package/src/assets/scss/_common.scss +134 -0
- package/src/assets/scss/code.css +71 -0
- package/src/assets/scss/day.scss +51 -0
- package/src/assets/scss/fonts.scss +21 -0
- package/src/assets/scss/index.scss +9 -0
- package/src/assets/scss/mixins.scss +26 -0
- package/src/assets/scss/night.scss +61 -0
- package/src/assets/scss/palette.scss +393 -0
- package/src/assets/scss/theme.scss +117 -0
- package/src/assets/scss/typography.scss +218 -0
- package/src/assets/scss/vars.scss +8 -0
- package/src/assets/svg/arrows-chevron-down.svg +5 -0
- package/src/assets/svg/github.svg +5 -0
- package/src/assets/svg/line-alerts-notification-box.svg +3 -0
- package/src/assets/svg/line-arrows-chevron-down-double.svg +3 -0
- package/src/assets/svg/line-arrows-chevron-down.svg +3 -0
- package/src/assets/svg/line-arrows-chevron-right.svg +3 -0
- package/src/assets/svg/line-arrows-chevron-up-double.svg +3 -0
- package/src/assets/svg/line-arrows-chevron-up.svg +3 -0
- package/src/assets/svg/line-arrows-corner-down-right.svg +3 -0
- package/src/assets/svg/line-arrows-expand-3.svg +3 -0
- package/src/assets/svg/line-arrows-refresh-ccw-1.svg +3 -0
- package/src/assets/svg/line-arrows-sort-line-asc.svg +3 -0
- package/src/assets/svg/line-arrows-sort-line-desc.svg +3 -0
- package/src/assets/svg/line-arrows-switch-vertical-1.svg +3 -0
- package/src/assets/svg/line-dev-bug-2.svg +3 -0
- package/src/assets/svg/line-dev-code-square.svg +3 -0
- package/src/assets/svg/line-files-file-attachment-2.svg +3 -0
- package/src/assets/svg/line-general-check.svg +3 -0
- package/src/assets/svg/line-general-checklist3.svg +3 -0
- package/src/assets/svg/line-general-copy-3.svg +3 -0
- package/src/assets/svg/line-general-download-cloud.svg +3 -0
- package/src/assets/svg/line-general-equal.svg +3 -0
- package/src/assets/svg/line-general-home-line.svg +3 -0
- package/src/assets/svg/line-general-link-1.svg +3 -0
- package/src/assets/svg/line-general-link-external.svg +3 -0
- package/src/assets/svg/line-general-search-md.svg +3 -0
- package/src/assets/svg/line-general-settings-1.svg +3 -0
- package/src/assets/svg/line-general-x-close.svg +3 -0
- package/src/assets/svg/line-general-zap.svg +3 -0
- package/src/assets/svg/line-helpers-flag.svg +4 -0
- package/src/assets/svg/line-helpers-play-circle.svg +4 -0
- package/src/assets/svg/line-images-image.svg +3 -0
- package/src/assets/svg/line-security-key.svg +3 -0
- package/src/assets/svg/line-shapes-dot-circle.svg +3 -0
- package/src/assets/svg/line-shapes-moon.svg +3 -0
- package/src/assets/svg/line-shapes-sun.svg +3 -0
- package/src/assets/svg/line-time-clock-stopwatch.svg +3 -0
- package/src/assets/svg/report-logo.svg +64 -0
- package/src/assets/svg/solid-alert-circle.svg +3 -0
- package/src/assets/svg/solid-check-circle.svg +3 -0
- package/src/assets/svg/solid-help-circle.svg +3 -0
- package/src/assets/svg/solid-minus-circle.svg +3 -0
- package/src/assets/svg/solid-x-circle.svg +3 -0
- package/src/assets/svg/spinner.svg +18 -0
- package/src/assets/svg/view-off.svg +12 -0
- package/src/assets/svg/view.svg +11 -0
- package/src/components/app/ArrowButton/index.tsx +36 -0
- package/src/components/app/ArrowButton/styles.scss +32 -0
- package/src/components/app/BaseLayout/index.tsx +60 -0
- package/src/components/app/BaseLayout/styles.scss +60 -0
- package/src/components/app/Footer/FooterLogo.tsx +16 -0
- package/src/components/app/Footer/FooterVersion.tsx +27 -0
- package/src/components/app/Footer/index.tsx +13 -0
- package/src/components/app/Footer/styles.scss +14 -0
- package/src/components/app/Header/index.tsx +17 -0
- package/src/components/app/Header/styles.scss +26 -0
- package/src/components/app/LanguagePicker/index.tsx +41 -0
- package/src/components/app/MainReport/index.tsx +19 -0
- package/src/components/app/Metadata/index.tsx +114 -0
- package/src/components/app/Metadata/styles.scss +146 -0
- package/src/components/app/MetadataButton/index.tsx +33 -0
- package/src/components/app/MetadataButton/styles.scss +53 -0
- package/src/components/app/Modal/index.tsx +184 -0
- package/src/components/app/Modal/styles.scss +126 -0
- package/src/components/app/ReportBody/Filters.tsx +94 -0
- package/src/components/app/ReportBody/HeaderActions.tsx +21 -0
- package/src/components/app/ReportBody/SortBy.tsx +134 -0
- package/src/components/app/ReportBody/context.tsx +107 -0
- package/src/components/app/ReportBody/index.tsx +71 -0
- package/src/components/app/ReportBody/styles.scss +64 -0
- package/src/components/app/ReportHeader/ReportHeaderLabelList.tsx +12 -0
- package/src/components/app/ReportHeader/ReportHeaderLogo.tsx +10 -0
- package/src/components/app/ReportHeader/ReportHeaderPie.tsx +14 -0
- package/src/components/app/ReportHeader/index.tsx +33 -0
- package/src/components/app/ReportHeader/styles.scss +49 -0
- package/src/components/app/ReportLogo/index.tsx +17 -0
- package/src/components/app/ReportLogo/styles.scss +20 -0
- package/src/components/app/ReportLogoFull/index.tsx +21 -0
- package/src/components/app/ReportLogoFull/styles.scss +7 -0
- package/src/components/app/ReportMetadata/MetadataItem.tsx +45 -0
- package/src/components/app/ReportMetadata/MetadataSummary.tsx +79 -0
- package/src/components/app/ReportMetadata/MetadataTestType.tsx +16 -0
- package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +25 -0
- package/src/components/app/ReportMetadata/index.tsx +46 -0
- package/src/components/app/ReportMetadata/styles.scss +99 -0
- package/src/components/app/Tabs/index.tsx +58 -0
- package/src/components/app/Tabs/styles.scss +56 -0
- package/src/components/app/TestResult/TestResultAttachmentsView/index.tsx +27 -0
- package/src/components/app/TestResult/TestResultAttachmentsView/styles.scss +12 -0
- package/src/components/app/TestResult/TestResultDescription/index.tsx +27 -0
- package/src/components/app/TestResult/TestResultDescription/styles.scss +12 -0
- package/src/components/app/TestResult/TestResultDropdown/index.tsx +19 -0
- package/src/components/app/TestResult/TestResultDropdown/styles.scss +34 -0
- package/src/components/app/TestResult/TestResultEmpty/index.tsx +34 -0
- package/src/components/app/TestResult/TestResultEmpty/styles.scss +25 -0
- package/src/components/app/TestResult/TestResultError/index.tsx +51 -0
- package/src/components/app/TestResult/TestResultError/styles.scss +40 -0
- package/src/components/app/TestResult/TestResultHeader/index.tsx +55 -0
- package/src/components/app/TestResult/TestResultHeader/styles.scss +43 -0
- package/src/components/app/TestResult/TestResultHistory/TestResultHistoryItem.tsx +57 -0
- package/src/components/app/TestResult/TestResultHistory/index.tsx +26 -0
- package/src/components/app/TestResult/TestResultHistory/styles.scss +63 -0
- package/src/components/app/TestResult/TestResultInfo/index.tsx +79 -0
- package/src/components/app/TestResult/TestResultInfo/styles.scss +33 -0
- package/src/components/app/TestResult/TestResultLinks/index.tsx +60 -0
- package/src/components/app/TestResult/TestResultLinks/styles.scss +30 -0
- package/src/components/app/TestResult/TestResultMetadata/index.tsx +27 -0
- package/src/components/app/TestResult/TestResultMetadata/styles.scss +8 -0
- package/src/components/app/TestResult/TestResultNavigation/index.tsx +89 -0
- package/src/components/app/TestResult/TestResultNavigation/styles.scss +48 -0
- package/src/components/app/TestResult/TestResultOverview.tsx +40 -0
- package/src/components/app/TestResult/TestResultParameters/index.tsx +30 -0
- package/src/components/app/TestResult/TestResultParameters/styles.scss +8 -0
- package/src/components/app/TestResult/TestResultPrevStatuses/index.tsx +52 -0
- package/src/components/app/TestResult/TestResultPrevStatuses/styles.scss +57 -0
- package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +50 -0
- package/src/components/app/TestResult/TestResultRetriesView/index.tsx +24 -0
- package/src/components/app/TestResult/TestResultRetriesView/styles.scss +69 -0
- package/src/components/app/TestResult/TestResultSetup/index.tsx +50 -0
- package/src/components/app/TestResult/TestResultSeverity/index.tsx +34 -0
- package/src/components/app/TestResult/TestResultSeverity/styles.scss +29 -0
- package/src/components/app/TestResult/TestResultStatus/index.tsx +26 -0
- package/src/components/app/TestResult/TestResultStatus/styles.scss +36 -0
- package/src/components/app/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
- package/src/components/app/TestResult/TestResultSteps/attachment.tsx +70 -0
- package/src/components/app/TestResult/TestResultSteps/attachmentCode.tsx +15 -0
- package/src/components/app/TestResult/TestResultSteps/attachmentImage.tsx +29 -0
- package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +12 -0
- package/src/components/app/TestResult/TestResultSteps/index.tsx +49 -0
- package/src/components/app/TestResult/TestResultSteps/styles.scss +225 -0
- package/src/components/app/TestResult/TestResultSteps/testResultAttachment.tsx +79 -0
- package/src/components/app/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +87 -0
- package/src/components/app/TestResult/TestResultSteps/testResultStep.tsx +71 -0
- package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +33 -0
- package/src/components/app/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
- package/src/components/app/TestResult/TestResultTabs/index.tsx +59 -0
- package/src/components/app/TestResult/TestResultTabs/styles.scss +76 -0
- package/src/components/app/TestResult/TestResultTeardown/index.tsx +49 -0
- package/src/components/app/TestResult/index.tsx +56 -0
- package/src/components/app/ThemeButton/ThemeButton.tsx +22 -0
- package/src/components/app/Tree/Tree.tsx +122 -0
- package/src/components/app/Tree/TreeHeader.tsx +81 -0
- package/src/components/app/Tree/TreeItem.tsx +31 -0
- package/src/components/app/Tree/TreeItemIcon.tsx +35 -0
- package/src/components/app/Tree/index.tsx +40 -0
- package/src/components/app/Tree/styles.scss +170 -0
- package/src/components/commons/Button/index.tsx +176 -0
- package/src/components/commons/Button/styles.scss +558 -0
- package/src/components/commons/Counter/index.tsx +29 -0
- package/src/components/commons/Counter/styles.scss +21 -0
- package/src/components/commons/Label/index.tsx +11 -0
- package/src/components/commons/Label/styles.scss +7 -0
- package/src/components/commons/Link/index.tsx +20 -0
- package/src/components/commons/Link/styles.scss +46 -0
- package/src/components/commons/Loadable/index.tsx +32 -0
- package/src/components/commons/Menu/index.tsx +173 -0
- package/src/components/commons/Menu/styles.scss +94 -0
- package/src/components/commons/PageLoader/index.tsx +10 -0
- package/src/components/commons/PageLoader/styles.scss +29 -0
- package/src/components/commons/SearchBox/index.tsx +61 -0
- package/src/components/commons/SearchBox/styles.scss +58 -0
- package/src/components/commons/Spinner/index.tsx +8 -0
- package/src/components/commons/SuccessRatePieChart/index.tsx +52 -0
- package/src/components/commons/SuccessRatePieChart/styles.scss +12 -0
- package/src/components/commons/SvgIcon/index.tsx +46 -0
- package/src/components/commons/SvgIcon/styles.scss +26 -0
- package/src/components/commons/Toggle/index.tsx +29 -0
- package/src/components/commons/Toggle/styles.scss +48 -0
- package/src/components/commons/Tooltip/index.tsx +123 -0
- package/src/components/commons/Tooltip/styles.scss +38 -0
- package/src/components/commons/Typography/index.tsx +99 -0
- package/src/hooks/useDebouncedCallback.ts +31 -0
- package/src/i18n/constants.ts +105 -0
- package/src/i18n/locales/am.json +115 -0
- package/src/i18n/locales/az.json +115 -0
- package/src/i18n/locales/de.json +115 -0
- package/src/i18n/locales/en.json +115 -0
- package/src/i18n/locales/es.json +114 -0
- package/src/i18n/locales/fr.json +115 -0
- package/src/i18n/locales/he.json +115 -0
- package/src/i18n/locales/it.json +115 -0
- package/src/i18n/locales/ja.json +115 -0
- package/src/i18n/locales/ka.json +115 -0
- package/src/i18n/locales/kr.json +115 -0
- package/src/i18n/locales/nl.json +115 -0
- package/src/i18n/locales/pl.json +113 -0
- package/src/i18n/locales/pt.json +115 -0
- package/src/i18n/locales/ru.json +113 -0
- package/src/i18n/locales/sv.json +115 -0
- package/src/i18n/locales/tr.json +115 -0
- package/src/i18n/locales/zh.json +115 -0
- package/src/index.html +35 -0
- package/src/index.tsx +48 -0
- package/src/stores/chart.ts +32 -0
- package/src/stores/envInfo.ts +34 -0
- package/src/stores/index.ts +4 -0
- package/src/stores/locale.ts +79 -0
- package/src/stores/stats.ts +36 -0
- package/src/stores/testResults.ts +40 -0
- package/src/stores/theme.ts +33 -0
- package/src/stores/tree.ts +33 -0
- package/src/stores/types.ts +5 -0
- package/src/types/globals.d.ts +8 -0
- package/src/types/window.d.ts +8 -0
- package/src/utils/attachments.ts +156 -0
- package/src/utils/capitalize.ts +4 -0
- package/src/utils/copyToClipboard.ts +3 -0
- package/src/utils/isMac.ts +7 -0
- package/src/utils/statuses.ts +55 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/treeFilters.ts +150 -0
- package/tsconfig.json +25 -0
- package/types.d.ts +53 -0
- package/webpack.config.js +108 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
.test-result-steps {
|
|
2
|
+
padding-right: 24px;
|
|
3
|
+
|
|
4
|
+
&:not(:first-child) {
|
|
5
|
+
border-top: 1px solid var(--on-border-muted);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.test-result-steps-root {
|
|
10
|
+
padding-left: 30px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.test-result-step {
|
|
14
|
+
&:not(:first-child) {
|
|
15
|
+
border-top: 1px solid var(--on-border-muted);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.test-result-step-content {
|
|
20
|
+
padding-left: 24px;
|
|
21
|
+
margin-bottom: 12px;
|
|
22
|
+
border-top: 1px solid var(--on-border-muted);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.test-result-attachment-content {
|
|
26
|
+
max-height: 450px;
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
border-top: 1px solid var(--on-border-muted);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.test-result-attachment-content-wrapper {
|
|
32
|
+
padding-left: 16px;
|
|
33
|
+
margin-left: 11px;
|
|
34
|
+
max-height: 450px;
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.test-result-step-root {
|
|
39
|
+
padding-left: 12px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.test-result-step-header {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 4px;
|
|
46
|
+
transition: background-color 300ms;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
padding: 4px 8px 4px 6px;
|
|
49
|
+
min-height: 32px;
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background: var(--bg-control-flat-medium);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.test-result-header-text {
|
|
57
|
+
padding-left: 4px;
|
|
58
|
+
word-break: break-word;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.test-result-step-button {
|
|
62
|
+
padding: 2px;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
margin-right: 2px;
|
|
65
|
+
margin-left: 2px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.test-result-step-number {
|
|
69
|
+
color: var(--on-text-hint);
|
|
70
|
+
min-width: 16px;
|
|
71
|
+
text-align: center;
|
|
72
|
+
box-sizing: content-box;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item-time {
|
|
76
|
+
flex: none;
|
|
77
|
+
margin-left: auto;
|
|
78
|
+
color: var(--on-text-hint);
|
|
79
|
+
line-height: 20px;
|
|
80
|
+
min-width: 56px;
|
|
81
|
+
text-align: right;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.item-info {
|
|
85
|
+
margin-left: auto;
|
|
86
|
+
display: flex;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
color: var(--on-text-secondary);
|
|
89
|
+
align-items: center;
|
|
90
|
+
flex: 0 0 auto;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.item-buttons {
|
|
94
|
+
display: flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
gap: 4px;
|
|
97
|
+
color: var(--on-icon-secondary);
|
|
98
|
+
min-width: 52px;
|
|
99
|
+
justify-content: flex-end;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.item-info-step {
|
|
103
|
+
display: flex;
|
|
104
|
+
gap: 4px;
|
|
105
|
+
align-items: center;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.item-info-step-icon {
|
|
109
|
+
color: var(--on-icon-secondary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.test-result-step-chevron {
|
|
113
|
+
width: 12px;
|
|
114
|
+
height: 12px;
|
|
115
|
+
transform: rotate(-90deg);
|
|
116
|
+
transition: transform 200ms;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.test-result-step-chevron-open {
|
|
120
|
+
transform: rotate(0deg);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.test-result-attachment-header {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
gap: 4px;
|
|
127
|
+
transition: background-color 300ms;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
padding: 4px 8px 4px 6px;
|
|
130
|
+
|
|
131
|
+
&:hover {
|
|
132
|
+
background: var(--bg-control-flat-medium);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.test-result-attachment-arrow {
|
|
137
|
+
transform: rotate(-90deg);
|
|
138
|
+
transition: transform 200ms;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.test-result-attachment-arrow-opened {
|
|
142
|
+
transform: rotate(0);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.test-result-attachment-icon {
|
|
146
|
+
color: var(--on-icon-secondary);
|
|
147
|
+
padding: 2px 4px;
|
|
148
|
+
height: max-content;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.test-result-attachment-text {
|
|
152
|
+
padding-left: 4px;
|
|
153
|
+
word-break: break-word;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.test-result-attachment-image {
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
padding: 4px 0;
|
|
160
|
+
position: relative;
|
|
161
|
+
width: 100%;
|
|
162
|
+
height: 100%;
|
|
163
|
+
|
|
164
|
+
img {
|
|
165
|
+
width: 100%;
|
|
166
|
+
height: 100%;
|
|
167
|
+
object-fit: scale-down;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.test-result-parameters {
|
|
172
|
+
padding-left: 62px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.attachment-background {
|
|
176
|
+
filter: blur(40px) brightness(0.4);
|
|
177
|
+
background-position: 50%;
|
|
178
|
+
background-size: cover;
|
|
179
|
+
position: absolute;
|
|
180
|
+
inset: -100px;
|
|
181
|
+
z-index: -1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.test-result-attachment-error {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.test-result-visibility-hidden {
|
|
191
|
+
visibility: hidden;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.item-button {
|
|
195
|
+
color: var(--bg-control-flat);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.wrong-attachment-sign {
|
|
199
|
+
display: flex;
|
|
200
|
+
justify-content: center;
|
|
201
|
+
align-items: center;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.test-result-attachment-missed {
|
|
205
|
+
color: var(--on-text-secondary);
|
|
206
|
+
line-height: 20px;
|
|
207
|
+
margin-right: auto;
|
|
208
|
+
padding-top: 2px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.test-result-spinner {
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
width: 100%;
|
|
216
|
+
min-height: 32px;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.test-result-strut {
|
|
220
|
+
width: 24px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.html-attachment-preview {
|
|
224
|
+
padding: 0 16px;
|
|
225
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import type { FunctionComponent } from "preact";
|
|
3
|
+
import { useState } from "preact/hooks";
|
|
4
|
+
import arrowsChevronDown from "@/assets/svg/arrows-chevron-down.svg";
|
|
5
|
+
import LineFilesFileAttachment from "@/assets/svg/line-files-file-attachment-2.svg";
|
|
6
|
+
import LineImagesImage from "@/assets/svg/line-images-image.svg";
|
|
7
|
+
import { ArrowButton } from "@/components/app/ArrowButton";
|
|
8
|
+
import { Attachment } from "@/components/app/TestResult/TestResultSteps/attachment";
|
|
9
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
10
|
+
import { TestResultAttachmentInfo } from "@/components/app/TestResult/TestResultSteps/testResultAttachmentInfo";
|
|
11
|
+
import { SvgIcon } from "@/components/commons/SvgIcon";
|
|
12
|
+
import { Code, Text } from "@/components/commons/Typography";
|
|
13
|
+
import { attachmentType } from "@/utils/attachments";
|
|
14
|
+
|
|
15
|
+
const iconMap = {
|
|
16
|
+
"text/plain": LineFilesFileAttachment.id,
|
|
17
|
+
"application/xml": LineFilesFileAttachment.id,
|
|
18
|
+
"text/html": LineFilesFileAttachment.id,
|
|
19
|
+
"text/csv": LineFilesFileAttachment.id,
|
|
20
|
+
"text/tab-separated-values": LineFilesFileAttachment.id,
|
|
21
|
+
"text/css": LineFilesFileAttachment.id,
|
|
22
|
+
"text/uri-list": LineFilesFileAttachment.id,
|
|
23
|
+
"image/svg+xml": LineImagesImage.id,
|
|
24
|
+
"image/png": LineImagesImage.id,
|
|
25
|
+
"application/json": LineFilesFileAttachment.id,
|
|
26
|
+
"application/zip": LineFilesFileAttachment.id,
|
|
27
|
+
"video/webm": LineImagesImage.id,
|
|
28
|
+
"image/jpeg": LineImagesImage.id,
|
|
29
|
+
"video/mp4": LineImagesImage.id,
|
|
30
|
+
"application/vnd.allure.image.diff": LineImagesImage.id,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const TestResultAttachment: FunctionComponent<{
|
|
34
|
+
item: AttachmentTestStepResult;
|
|
35
|
+
stepIndex?: number;
|
|
36
|
+
className?: string;
|
|
37
|
+
}> = ({ item, stepIndex }) => {
|
|
38
|
+
const [isOpened, setIsOpen] = useState(false);
|
|
39
|
+
const { link } = item;
|
|
40
|
+
const { missed } = link;
|
|
41
|
+
const componentType = attachmentType(link.contentType);
|
|
42
|
+
const isValidComponentType = !["archive", null].includes(componentType.type as string);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className={styles["test-result-step"]}>
|
|
46
|
+
<div
|
|
47
|
+
className={styles["test-result-attachment-header"]}
|
|
48
|
+
onClick={(e) => {
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
setIsOpen((prev) => !prev);
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<ArrowButton isOpened={isOpened} icon={arrowsChevronDown.id} />
|
|
54
|
+
<div className={styles["test-result-attachment-icon"]}>
|
|
55
|
+
<SvgIcon size="s" id={iconMap[link.contentType] || LineFilesFileAttachment.id} />
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<Code size="s" className={styles["test-result-step-number"]}>
|
|
59
|
+
{stepIndex}
|
|
60
|
+
</Code>
|
|
61
|
+
|
|
62
|
+
<Text className={styles["test-result-attachment-text"]}>{link.name || link.originalFileName}</Text>
|
|
63
|
+
{missed && (
|
|
64
|
+
<Text size={"s"} className={styles["test-result-attachment-missed"]}>
|
|
65
|
+
missed
|
|
66
|
+
</Text>
|
|
67
|
+
)}
|
|
68
|
+
<TestResultAttachmentInfo item={item} shouldExpand={isValidComponentType} />
|
|
69
|
+
</div>
|
|
70
|
+
{isOpened && isValidComponentType && (
|
|
71
|
+
<div className={styles["test-result-attachment-content-wrapper"]}>
|
|
72
|
+
<div className={styles["test-result-attachment-content"]}>
|
|
73
|
+
<Attachment item={item} />
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { filesize } from "filesize";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import { useEffect } from "preact/hooks";
|
|
5
|
+
import LineArrowsExpand from "@/assets/svg/line-arrows-expand-3.svg";
|
|
6
|
+
import LineGeneralDownloadCloud from "@/assets/svg/line-general-download-cloud.svg";
|
|
7
|
+
import { isModalOpen, openModal } from "@/components/app/Modal";
|
|
8
|
+
import { Attachment } from "@/components/app/TestResult/TestResultSteps/attachment";
|
|
9
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
10
|
+
import { IconButton } from "@/components/commons/Button";
|
|
11
|
+
import { TooltipWrapper } from "@/components/commons/Tooltip";
|
|
12
|
+
import { Text } from "@/components/commons/Typography";
|
|
13
|
+
import { useI18n } from "@/stores";
|
|
14
|
+
import { downloadAttachment } from "@/utils/attachments";
|
|
15
|
+
|
|
16
|
+
interface TestResultAttachmentInfoProps {
|
|
17
|
+
item?: AttachmentTestStepResult;
|
|
18
|
+
shouldExpand?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentInfoProps> = ({
|
|
22
|
+
item,
|
|
23
|
+
shouldExpand,
|
|
24
|
+
}) => {
|
|
25
|
+
const { id, ext, contentType } = item.link;
|
|
26
|
+
const { t: tooltip } = useI18n("controls");
|
|
27
|
+
const contentLength = item.link.missed === false ? item.link.contentLength : undefined;
|
|
28
|
+
const contentSize = contentLength
|
|
29
|
+
? filesize(contentLength as number, {
|
|
30
|
+
base: 2,
|
|
31
|
+
round: 1,
|
|
32
|
+
})
|
|
33
|
+
: "-";
|
|
34
|
+
|
|
35
|
+
const expandAttachment = (event: Event) => {
|
|
36
|
+
event.stopPropagation();
|
|
37
|
+
openModal({
|
|
38
|
+
data: item,
|
|
39
|
+
component: <Attachment item={item} previewable={true} />,
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (isModalOpen.value) {
|
|
45
|
+
openModal({
|
|
46
|
+
data: item,
|
|
47
|
+
component: <Attachment item={item} />,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const downloadData = async (e: MouseEvent) => {
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
await downloadAttachment(id, ext, contentType);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div className={styles["item-info"]}>
|
|
59
|
+
{Boolean(contentType) && <Text size={"s"}>{contentType}</Text>}
|
|
60
|
+
{Boolean(contentSize) && <Text size={"s"}>{contentSize}</Text>}
|
|
61
|
+
<div className={styles["item-buttons"]}>
|
|
62
|
+
{shouldExpand && (
|
|
63
|
+
<TooltipWrapper tooltipText={tooltip("expand")}>
|
|
64
|
+
<IconButton
|
|
65
|
+
className={styles["item-button"]}
|
|
66
|
+
style={"ghost"}
|
|
67
|
+
size={"s"}
|
|
68
|
+
iconSize={"s"}
|
|
69
|
+
icon={LineArrowsExpand.id}
|
|
70
|
+
onClick={expandAttachment}
|
|
71
|
+
/>
|
|
72
|
+
</TooltipWrapper>
|
|
73
|
+
)}
|
|
74
|
+
<TooltipWrapper tooltipText={tooltip("downloadAttachment")}>
|
|
75
|
+
<IconButton
|
|
76
|
+
style={"ghost"}
|
|
77
|
+
size={"s"}
|
|
78
|
+
iconSize={"s"}
|
|
79
|
+
className={styles["item-button"]}
|
|
80
|
+
icon={LineGeneralDownloadCloud.id}
|
|
81
|
+
onClick={(e: MouseEvent) => downloadData(e)}
|
|
82
|
+
/>
|
|
83
|
+
</TooltipWrapper>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { DefaultTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import type { FunctionComponent } from "preact";
|
|
3
|
+
import { useState } from "preact/hooks";
|
|
4
|
+
import arrowsChevronDown from "@/assets/svg/arrows-chevron-down.svg";
|
|
5
|
+
import { ArrowButton } from "@/components/app/ArrowButton";
|
|
6
|
+
import { MetadataList } from "@/components/app/Metadata";
|
|
7
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
8
|
+
import { TestResultAttachment } from "@/components/app/TestResult/TestResultSteps/testResultAttachment";
|
|
9
|
+
import { TestResultStepInfo } from "@/components/app/TestResult/TestResultSteps/testResultStepInfo";
|
|
10
|
+
import TreeItemIcon from "@/components/app/Tree/TreeItemIcon";
|
|
11
|
+
import { Code, Text } from "@/components/commons/Typography";
|
|
12
|
+
|
|
13
|
+
export const TestResultStepParameters = ({ parameters }) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className={styles["test-result-parameters"]}>
|
|
16
|
+
<MetadataList size={"s"} envInfo={parameters} columns={1} />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
export const TestResultStepsContent = ({ item }) => {
|
|
21
|
+
const typeMap = {
|
|
22
|
+
step: TestResultStep,
|
|
23
|
+
attachment: TestResultAttachment,
|
|
24
|
+
};
|
|
25
|
+
return (
|
|
26
|
+
<div className={styles["test-result-step-content"]}>
|
|
27
|
+
{Boolean(item?.parameters?.length) && <TestResultStepParameters parameters={item.parameters} />}
|
|
28
|
+
{Boolean(item?.steps?.length) && (
|
|
29
|
+
<>
|
|
30
|
+
{item.steps?.map((subItem, key) => {
|
|
31
|
+
const StepComponent = typeMap[subItem.type];
|
|
32
|
+
return <StepComponent stepIndex={key + 1} key={key} item={subItem} />;
|
|
33
|
+
})}
|
|
34
|
+
</>
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const TestResultStep: FunctionComponent<{
|
|
41
|
+
item: DefaultTestStepResult;
|
|
42
|
+
stepIndex?: number;
|
|
43
|
+
className?: string;
|
|
44
|
+
}> = ({ item, stepIndex }) => {
|
|
45
|
+
const [isOpened, setIsOpen] = useState(false);
|
|
46
|
+
const hasContent = Boolean(item?.steps?.length || item?.parameters?.length);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className={styles["test-result-step"]}>
|
|
50
|
+
<div className={styles["test-result-step-header"]} onClick={() => setIsOpen(!isOpened)}>
|
|
51
|
+
{!hasContent ? (
|
|
52
|
+
<div className={styles["test-result-strut"]} />
|
|
53
|
+
) : (
|
|
54
|
+
<ArrowButton
|
|
55
|
+
isOpened={isOpened}
|
|
56
|
+
icon={arrowsChevronDown.id}
|
|
57
|
+
iconSize={"xs"}
|
|
58
|
+
className={!hasContent ? styles["test-result-visibility-hidden"] : ""}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
<TreeItemIcon status={item.status} />
|
|
62
|
+
<Code size={"s"} className={styles["test-result-step-number"]}>
|
|
63
|
+
{stepIndex}
|
|
64
|
+
</Code>
|
|
65
|
+
<Text className={styles["test-result-header-text"]}>{item.name}</Text>
|
|
66
|
+
<TestResultStepInfo item={item} />
|
|
67
|
+
</div>
|
|
68
|
+
{hasContent && isOpened && <TestResultStepsContent item={item} />}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { formatDuration } from "@allurereport/core-api";
|
|
2
|
+
import LineArrowsCornerDownRight from "@/assets/svg/line-arrows-corner-down-right.svg";
|
|
3
|
+
import LineFilesFileAttachment from "@/assets/svg/line-files-file-attachment-2.svg";
|
|
4
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
5
|
+
import { SvgIcon } from "@/components/commons/SvgIcon";
|
|
6
|
+
import { Text } from "@/components/commons/Typography";
|
|
7
|
+
|
|
8
|
+
export const TestResultStepInfo = ({ item }) => {
|
|
9
|
+
const { steps } = item;
|
|
10
|
+
const formattedDuration = formatDuration(item?.duration as number);
|
|
11
|
+
const stepLength = steps?.length;
|
|
12
|
+
const attachmentLength = steps?.filter((step) => step.type === "attachment")?.length;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className={styles["item-info"]}>
|
|
16
|
+
{Boolean(stepLength) && (
|
|
17
|
+
<div className={styles["item-info-step"]}>
|
|
18
|
+
<SvgIcon id={LineArrowsCornerDownRight.id} className={styles["item-info-step-icon"]} />
|
|
19
|
+
<Text size={"s"}>{stepLength}</Text>
|
|
20
|
+
</div>
|
|
21
|
+
)}
|
|
22
|
+
{Boolean(attachmentLength) && (
|
|
23
|
+
<div className={styles["item-info-step"]}>
|
|
24
|
+
<SvgIcon id={LineFilesFileAttachment.id} className={styles["item-info-step-icon"]} />
|
|
25
|
+
<Text size={"s"}>{attachmentLength}</Text>
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
<Text type="ui" size={"s"} className={styles["item-time"]}>
|
|
29
|
+
{formattedDuration}
|
|
30
|
+
</Text>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
2
|
+
import { useI18n } from "@/stores";
|
|
3
|
+
|
|
4
|
+
export const EmptyComponent = () => {
|
|
5
|
+
const { t } = useI18n("errors");
|
|
6
|
+
|
|
7
|
+
return <div className={styles["wrong-attachment-sign"]}>{t("missedAttachment")}</div>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ComponentChildren, createContext } from "preact";
|
|
2
|
+
import { useContext, useState } from "preact/hooks";
|
|
3
|
+
import { Text } from "@/components/commons/Typography";
|
|
4
|
+
import * as styles from "./styles.scss";
|
|
5
|
+
|
|
6
|
+
type TestResultTabsContextT = {
|
|
7
|
+
currentTab: string | undefined;
|
|
8
|
+
setCurrentTab: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const TestResultTabsContext = createContext<TestResultTabsContextT | null>(null);
|
|
12
|
+
|
|
13
|
+
export const useTestResultTabsContext = () => {
|
|
14
|
+
const context = useContext(TestResultTabsContext);
|
|
15
|
+
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error("TestResultTabs components must be used within a TestResultTabs component");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return context;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const TestResultTabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
|
|
24
|
+
const { children, initialTab } = props;
|
|
25
|
+
const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<TestResultTabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</TestResultTabsContext.Provider>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const TestResultTabs = (props: { children: ComponentChildren; initialTab?: string }) => {
|
|
33
|
+
return <TestResultTabsProvider {...props} />;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const TestResultTabsList = (props: { children: ComponentChildren }) => {
|
|
37
|
+
return <div className={styles.tabsList}>{props.children}</div>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const TestResultTab = (props: { id: string; children: ComponentChildren; disabled?: boolean }) => {
|
|
41
|
+
const { id, children } = props;
|
|
42
|
+
const { currentTab, setCurrentTab } = useTestResultTabsContext();
|
|
43
|
+
const isCurrentTab = currentTab === id;
|
|
44
|
+
|
|
45
|
+
const handleTabClick = () => {
|
|
46
|
+
if (isCurrentTab) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setCurrentTab(id);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<button className={styles.tab} onClick={handleTabClick} aria-current={isCurrentTab ? true : undefined}>
|
|
54
|
+
<Text type="paragraph" size="m">
|
|
55
|
+
{children}
|
|
56
|
+
</Text>
|
|
57
|
+
</button>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.test-result-tabs {
|
|
2
|
+
display: flex;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.tabsList {
|
|
6
|
+
display: flex;
|
|
7
|
+
overflow-x: auto;
|
|
8
|
+
flex-grow: 0;
|
|
9
|
+
max-width: max-content;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.tab {
|
|
14
|
+
color: var(--on-text-primary);
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
user-select: none;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
transform: scale(1);
|
|
19
|
+
outline: none;
|
|
20
|
+
background-color: var(--bg-base-primary);
|
|
21
|
+
padding: 8px;
|
|
22
|
+
border: none;
|
|
23
|
+
border-radius: 4px;
|
|
24
|
+
transition:
|
|
25
|
+
transform var(--interaction-transition-duration) ease-out,
|
|
26
|
+
outline var(--interaction-transition-duration) ease-out,
|
|
27
|
+
background-color var(--color-change-transition-duration),
|
|
28
|
+
border-color var(--color-change-transition-duration);
|
|
29
|
+
margin: 0 0 8px;
|
|
30
|
+
|
|
31
|
+
&:after {
|
|
32
|
+
content: "";
|
|
33
|
+
position: absolute;
|
|
34
|
+
bottom: -8px;
|
|
35
|
+
width: 100%;
|
|
36
|
+
left: 0;
|
|
37
|
+
border-bottom: 2px solid transparent;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&[disabled] {
|
|
41
|
+
opacity: 0.5;
|
|
42
|
+
}
|
|
43
|
+
&[aria-current] {
|
|
44
|
+
background-color: var(--bg-base-primary);
|
|
45
|
+
cursor: default;
|
|
46
|
+
|
|
47
|
+
&:after {
|
|
48
|
+
border-bottom: 2px solid var(--on-support-aldebaran);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
span {
|
|
52
|
+
font-weight: bold;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&:hover:not([aria-current]) {
|
|
57
|
+
background-color: var(--bg-control-flat-medium);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:active:not([aria-current]) {
|
|
61
|
+
background-color: var(--bg-control-flat-heavy);
|
|
62
|
+
transform: scale(0.94);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:focus {
|
|
66
|
+
outline: 1px solid transparent;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: 0 solid var(--ad-other-focus);
|
|
71
|
+
|
|
72
|
+
&:not([aria-current]) {
|
|
73
|
+
background-color: var(--bg-control-flat-medium);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FunctionalComponent } from "preact";
|
|
2
|
+
import { useState } from "preact/hooks";
|
|
3
|
+
import { AllureAwesomeTestResult } from "types";
|
|
4
|
+
import lineHelpersFlag from "@/assets/svg/line-helpers-flag.svg";
|
|
5
|
+
import { TestResultDropdown } from "@/components/app/TestResult/TestResultDropdown";
|
|
6
|
+
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
7
|
+
import { TestResultAttachment } from "@/components/app/TestResult/TestResultSteps/testResultAttachment";
|
|
8
|
+
import { TestResultStep } from "@/components/app/TestResult/TestResultSteps/testResultStep";
|
|
9
|
+
import { useI18n } from "@/stores/locale";
|
|
10
|
+
|
|
11
|
+
const typeMap = {
|
|
12
|
+
before: TestResultStep,
|
|
13
|
+
after: TestResultStep,
|
|
14
|
+
step: TestResultStep,
|
|
15
|
+
attachment: TestResultAttachment,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type TestResultTeardownProps = {
|
|
19
|
+
teardown: AllureAwesomeTestResult["teardown"];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const TestResultTeardown: FunctionalComponent<TestResultTeardownProps> = ({ teardown }) => {
|
|
23
|
+
const [isOpened, setIsOpen] = useState(false);
|
|
24
|
+
const { t } = useI18n("execution");
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className={styles["test-result-steps"]}>
|
|
28
|
+
<TestResultDropdown
|
|
29
|
+
icon={lineHelpersFlag.id}
|
|
30
|
+
isOpened={isOpened}
|
|
31
|
+
setIsOpen={setIsOpen}
|
|
32
|
+
counter={teardown?.length}
|
|
33
|
+
title={t("teardown")}
|
|
34
|
+
/>
|
|
35
|
+
{isOpened && (
|
|
36
|
+
<div className={styles["test-result-steps-root"]}>
|
|
37
|
+
{teardown?.map((item, key) => {
|
|
38
|
+
const StepComponent = typeMap[item.type];
|
|
39
|
+
return StepComponent ? (
|
|
40
|
+
// FIXME: use proper type in the StepComponent component
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
<StepComponent item={item} stepIndex={key + 1} key={key} className={styles["test-result-step-root"]} />
|
|
43
|
+
) : null;
|
|
44
|
+
})}
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|