@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.
Files changed (263) hide show
  1. package/.babelrc.js +46 -0
  2. package/.eslintrc.cjs +15 -0
  3. package/README.md +27 -0
  4. package/dist/multi/141.app-b6362ca0.js +1 -0
  5. package/dist/multi/222.app-b6362ca0.js +1 -0
  6. package/dist/multi/335.app-b6362ca0.js +1 -0
  7. package/dist/multi/34.app-b6362ca0.js +1 -0
  8. package/dist/multi/349.app-b6362ca0.js +1 -0
  9. package/dist/multi/378.app-b6362ca0.js +1 -0
  10. package/dist/multi/406.app-b6362ca0.js +1 -0
  11. package/dist/multi/476.app-b6362ca0.js +1 -0
  12. package/dist/multi/53.app-b6362ca0.js +1 -0
  13. package/dist/multi/584.app-b6362ca0.js +1 -0
  14. package/dist/multi/690.app-b6362ca0.js +1 -0
  15. package/dist/multi/747.app-b6362ca0.js +1 -0
  16. package/dist/multi/767.app-b6362ca0.js +1 -0
  17. package/dist/multi/816.app-b6362ca0.js +1 -0
  18. package/dist/multi/83.app-b6362ca0.js +1 -0
  19. package/dist/multi/873.app-b6362ca0.js +1 -0
  20. package/dist/multi/920.app-b6362ca0.js +1 -0
  21. package/dist/multi/991.app-b6362ca0.js +1 -0
  22. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  23. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  24. package/dist/multi/app-b6362ca0.js +2 -0
  25. package/dist/multi/app-b6362ca0.js.LICENSE.txt +16 -0
  26. package/dist/multi/manifest.json +26 -0
  27. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  28. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  29. package/dist/multi/styles-b6362ca0.css +363 -0
  30. package/dist/single/app-57ae0a60.js +2 -0
  31. package/dist/single/app-57ae0a60.js.LICENSE.txt +16 -0
  32. package/dist/single/manifest.json +3 -0
  33. package/package.json +93 -0
  34. package/postcss.config.js +5 -0
  35. package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
  36. package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
  37. package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
  38. package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
  39. package/src/assets/scss/_common.scss +134 -0
  40. package/src/assets/scss/code.css +71 -0
  41. package/src/assets/scss/day.scss +51 -0
  42. package/src/assets/scss/fonts.scss +21 -0
  43. package/src/assets/scss/index.scss +9 -0
  44. package/src/assets/scss/mixins.scss +26 -0
  45. package/src/assets/scss/night.scss +61 -0
  46. package/src/assets/scss/palette.scss +393 -0
  47. package/src/assets/scss/theme.scss +117 -0
  48. package/src/assets/scss/typography.scss +218 -0
  49. package/src/assets/scss/vars.scss +8 -0
  50. package/src/assets/svg/arrows-chevron-down.svg +5 -0
  51. package/src/assets/svg/github.svg +5 -0
  52. package/src/assets/svg/line-alerts-notification-box.svg +3 -0
  53. package/src/assets/svg/line-arrows-chevron-down-double.svg +3 -0
  54. package/src/assets/svg/line-arrows-chevron-down.svg +3 -0
  55. package/src/assets/svg/line-arrows-chevron-right.svg +3 -0
  56. package/src/assets/svg/line-arrows-chevron-up-double.svg +3 -0
  57. package/src/assets/svg/line-arrows-chevron-up.svg +3 -0
  58. package/src/assets/svg/line-arrows-corner-down-right.svg +3 -0
  59. package/src/assets/svg/line-arrows-expand-3.svg +3 -0
  60. package/src/assets/svg/line-arrows-refresh-ccw-1.svg +3 -0
  61. package/src/assets/svg/line-arrows-sort-line-asc.svg +3 -0
  62. package/src/assets/svg/line-arrows-sort-line-desc.svg +3 -0
  63. package/src/assets/svg/line-arrows-switch-vertical-1.svg +3 -0
  64. package/src/assets/svg/line-dev-bug-2.svg +3 -0
  65. package/src/assets/svg/line-dev-code-square.svg +3 -0
  66. package/src/assets/svg/line-files-file-attachment-2.svg +3 -0
  67. package/src/assets/svg/line-general-check.svg +3 -0
  68. package/src/assets/svg/line-general-checklist3.svg +3 -0
  69. package/src/assets/svg/line-general-copy-3.svg +3 -0
  70. package/src/assets/svg/line-general-download-cloud.svg +3 -0
  71. package/src/assets/svg/line-general-equal.svg +3 -0
  72. package/src/assets/svg/line-general-home-line.svg +3 -0
  73. package/src/assets/svg/line-general-link-1.svg +3 -0
  74. package/src/assets/svg/line-general-link-external.svg +3 -0
  75. package/src/assets/svg/line-general-search-md.svg +3 -0
  76. package/src/assets/svg/line-general-settings-1.svg +3 -0
  77. package/src/assets/svg/line-general-x-close.svg +3 -0
  78. package/src/assets/svg/line-general-zap.svg +3 -0
  79. package/src/assets/svg/line-helpers-flag.svg +4 -0
  80. package/src/assets/svg/line-helpers-play-circle.svg +4 -0
  81. package/src/assets/svg/line-images-image.svg +3 -0
  82. package/src/assets/svg/line-security-key.svg +3 -0
  83. package/src/assets/svg/line-shapes-dot-circle.svg +3 -0
  84. package/src/assets/svg/line-shapes-moon.svg +3 -0
  85. package/src/assets/svg/line-shapes-sun.svg +3 -0
  86. package/src/assets/svg/line-time-clock-stopwatch.svg +3 -0
  87. package/src/assets/svg/report-logo.svg +64 -0
  88. package/src/assets/svg/solid-alert-circle.svg +3 -0
  89. package/src/assets/svg/solid-check-circle.svg +3 -0
  90. package/src/assets/svg/solid-help-circle.svg +3 -0
  91. package/src/assets/svg/solid-minus-circle.svg +3 -0
  92. package/src/assets/svg/solid-x-circle.svg +3 -0
  93. package/src/assets/svg/spinner.svg +18 -0
  94. package/src/assets/svg/view-off.svg +12 -0
  95. package/src/assets/svg/view.svg +11 -0
  96. package/src/components/app/ArrowButton/index.tsx +36 -0
  97. package/src/components/app/ArrowButton/styles.scss +32 -0
  98. package/src/components/app/BaseLayout/index.tsx +60 -0
  99. package/src/components/app/BaseLayout/styles.scss +60 -0
  100. package/src/components/app/Footer/FooterLogo.tsx +16 -0
  101. package/src/components/app/Footer/FooterVersion.tsx +27 -0
  102. package/src/components/app/Footer/index.tsx +13 -0
  103. package/src/components/app/Footer/styles.scss +14 -0
  104. package/src/components/app/Header/index.tsx +17 -0
  105. package/src/components/app/Header/styles.scss +26 -0
  106. package/src/components/app/LanguagePicker/index.tsx +41 -0
  107. package/src/components/app/MainReport/index.tsx +19 -0
  108. package/src/components/app/Metadata/index.tsx +114 -0
  109. package/src/components/app/Metadata/styles.scss +146 -0
  110. package/src/components/app/MetadataButton/index.tsx +33 -0
  111. package/src/components/app/MetadataButton/styles.scss +53 -0
  112. package/src/components/app/Modal/index.tsx +184 -0
  113. package/src/components/app/Modal/styles.scss +126 -0
  114. package/src/components/app/ReportBody/Filters.tsx +94 -0
  115. package/src/components/app/ReportBody/HeaderActions.tsx +21 -0
  116. package/src/components/app/ReportBody/SortBy.tsx +134 -0
  117. package/src/components/app/ReportBody/context.tsx +107 -0
  118. package/src/components/app/ReportBody/index.tsx +71 -0
  119. package/src/components/app/ReportBody/styles.scss +64 -0
  120. package/src/components/app/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  121. package/src/components/app/ReportHeader/ReportHeaderLogo.tsx +10 -0
  122. package/src/components/app/ReportHeader/ReportHeaderPie.tsx +14 -0
  123. package/src/components/app/ReportHeader/index.tsx +33 -0
  124. package/src/components/app/ReportHeader/styles.scss +49 -0
  125. package/src/components/app/ReportLogo/index.tsx +17 -0
  126. package/src/components/app/ReportLogo/styles.scss +20 -0
  127. package/src/components/app/ReportLogoFull/index.tsx +21 -0
  128. package/src/components/app/ReportLogoFull/styles.scss +7 -0
  129. package/src/components/app/ReportMetadata/MetadataItem.tsx +45 -0
  130. package/src/components/app/ReportMetadata/MetadataSummary.tsx +79 -0
  131. package/src/components/app/ReportMetadata/MetadataTestType.tsx +16 -0
  132. package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +25 -0
  133. package/src/components/app/ReportMetadata/index.tsx +46 -0
  134. package/src/components/app/ReportMetadata/styles.scss +99 -0
  135. package/src/components/app/Tabs/index.tsx +58 -0
  136. package/src/components/app/Tabs/styles.scss +56 -0
  137. package/src/components/app/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  138. package/src/components/app/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  139. package/src/components/app/TestResult/TestResultDescription/index.tsx +27 -0
  140. package/src/components/app/TestResult/TestResultDescription/styles.scss +12 -0
  141. package/src/components/app/TestResult/TestResultDropdown/index.tsx +19 -0
  142. package/src/components/app/TestResult/TestResultDropdown/styles.scss +34 -0
  143. package/src/components/app/TestResult/TestResultEmpty/index.tsx +34 -0
  144. package/src/components/app/TestResult/TestResultEmpty/styles.scss +25 -0
  145. package/src/components/app/TestResult/TestResultError/index.tsx +51 -0
  146. package/src/components/app/TestResult/TestResultError/styles.scss +40 -0
  147. package/src/components/app/TestResult/TestResultHeader/index.tsx +55 -0
  148. package/src/components/app/TestResult/TestResultHeader/styles.scss +43 -0
  149. package/src/components/app/TestResult/TestResultHistory/TestResultHistoryItem.tsx +57 -0
  150. package/src/components/app/TestResult/TestResultHistory/index.tsx +26 -0
  151. package/src/components/app/TestResult/TestResultHistory/styles.scss +63 -0
  152. package/src/components/app/TestResult/TestResultInfo/index.tsx +79 -0
  153. package/src/components/app/TestResult/TestResultInfo/styles.scss +33 -0
  154. package/src/components/app/TestResult/TestResultLinks/index.tsx +60 -0
  155. package/src/components/app/TestResult/TestResultLinks/styles.scss +30 -0
  156. package/src/components/app/TestResult/TestResultMetadata/index.tsx +27 -0
  157. package/src/components/app/TestResult/TestResultMetadata/styles.scss +8 -0
  158. package/src/components/app/TestResult/TestResultNavigation/index.tsx +89 -0
  159. package/src/components/app/TestResult/TestResultNavigation/styles.scss +48 -0
  160. package/src/components/app/TestResult/TestResultOverview.tsx +40 -0
  161. package/src/components/app/TestResult/TestResultParameters/index.tsx +30 -0
  162. package/src/components/app/TestResult/TestResultParameters/styles.scss +8 -0
  163. package/src/components/app/TestResult/TestResultPrevStatuses/index.tsx +52 -0
  164. package/src/components/app/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  165. package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +50 -0
  166. package/src/components/app/TestResult/TestResultRetriesView/index.tsx +24 -0
  167. package/src/components/app/TestResult/TestResultRetriesView/styles.scss +69 -0
  168. package/src/components/app/TestResult/TestResultSetup/index.tsx +50 -0
  169. package/src/components/app/TestResult/TestResultSeverity/index.tsx +34 -0
  170. package/src/components/app/TestResult/TestResultSeverity/styles.scss +29 -0
  171. package/src/components/app/TestResult/TestResultStatus/index.tsx +26 -0
  172. package/src/components/app/TestResult/TestResultStatus/styles.scss +36 -0
  173. package/src/components/app/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
  174. package/src/components/app/TestResult/TestResultSteps/attachment.tsx +70 -0
  175. package/src/components/app/TestResult/TestResultSteps/attachmentCode.tsx +15 -0
  176. package/src/components/app/TestResult/TestResultSteps/attachmentImage.tsx +29 -0
  177. package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +12 -0
  178. package/src/components/app/TestResult/TestResultSteps/index.tsx +49 -0
  179. package/src/components/app/TestResult/TestResultSteps/styles.scss +225 -0
  180. package/src/components/app/TestResult/TestResultSteps/testResultAttachment.tsx +79 -0
  181. package/src/components/app/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +87 -0
  182. package/src/components/app/TestResult/TestResultSteps/testResultStep.tsx +71 -0
  183. package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +33 -0
  184. package/src/components/app/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  185. package/src/components/app/TestResult/TestResultTabs/index.tsx +59 -0
  186. package/src/components/app/TestResult/TestResultTabs/styles.scss +76 -0
  187. package/src/components/app/TestResult/TestResultTeardown/index.tsx +49 -0
  188. package/src/components/app/TestResult/index.tsx +56 -0
  189. package/src/components/app/ThemeButton/ThemeButton.tsx +22 -0
  190. package/src/components/app/Tree/Tree.tsx +122 -0
  191. package/src/components/app/Tree/TreeHeader.tsx +81 -0
  192. package/src/components/app/Tree/TreeItem.tsx +31 -0
  193. package/src/components/app/Tree/TreeItemIcon.tsx +35 -0
  194. package/src/components/app/Tree/index.tsx +40 -0
  195. package/src/components/app/Tree/styles.scss +170 -0
  196. package/src/components/commons/Button/index.tsx +176 -0
  197. package/src/components/commons/Button/styles.scss +558 -0
  198. package/src/components/commons/Counter/index.tsx +29 -0
  199. package/src/components/commons/Counter/styles.scss +21 -0
  200. package/src/components/commons/Label/index.tsx +11 -0
  201. package/src/components/commons/Label/styles.scss +7 -0
  202. package/src/components/commons/Link/index.tsx +20 -0
  203. package/src/components/commons/Link/styles.scss +46 -0
  204. package/src/components/commons/Loadable/index.tsx +32 -0
  205. package/src/components/commons/Menu/index.tsx +173 -0
  206. package/src/components/commons/Menu/styles.scss +94 -0
  207. package/src/components/commons/PageLoader/index.tsx +10 -0
  208. package/src/components/commons/PageLoader/styles.scss +29 -0
  209. package/src/components/commons/SearchBox/index.tsx +61 -0
  210. package/src/components/commons/SearchBox/styles.scss +58 -0
  211. package/src/components/commons/Spinner/index.tsx +8 -0
  212. package/src/components/commons/SuccessRatePieChart/index.tsx +52 -0
  213. package/src/components/commons/SuccessRatePieChart/styles.scss +12 -0
  214. package/src/components/commons/SvgIcon/index.tsx +46 -0
  215. package/src/components/commons/SvgIcon/styles.scss +26 -0
  216. package/src/components/commons/Toggle/index.tsx +29 -0
  217. package/src/components/commons/Toggle/styles.scss +48 -0
  218. package/src/components/commons/Tooltip/index.tsx +123 -0
  219. package/src/components/commons/Tooltip/styles.scss +38 -0
  220. package/src/components/commons/Typography/index.tsx +99 -0
  221. package/src/hooks/useDebouncedCallback.ts +31 -0
  222. package/src/i18n/constants.ts +105 -0
  223. package/src/i18n/locales/am.json +115 -0
  224. package/src/i18n/locales/az.json +115 -0
  225. package/src/i18n/locales/de.json +115 -0
  226. package/src/i18n/locales/en.json +115 -0
  227. package/src/i18n/locales/es.json +114 -0
  228. package/src/i18n/locales/fr.json +115 -0
  229. package/src/i18n/locales/he.json +115 -0
  230. package/src/i18n/locales/it.json +115 -0
  231. package/src/i18n/locales/ja.json +115 -0
  232. package/src/i18n/locales/ka.json +115 -0
  233. package/src/i18n/locales/kr.json +115 -0
  234. package/src/i18n/locales/nl.json +115 -0
  235. package/src/i18n/locales/pl.json +113 -0
  236. package/src/i18n/locales/pt.json +115 -0
  237. package/src/i18n/locales/ru.json +113 -0
  238. package/src/i18n/locales/sv.json +115 -0
  239. package/src/i18n/locales/tr.json +115 -0
  240. package/src/i18n/locales/zh.json +115 -0
  241. package/src/index.html +35 -0
  242. package/src/index.tsx +48 -0
  243. package/src/stores/chart.ts +32 -0
  244. package/src/stores/envInfo.ts +34 -0
  245. package/src/stores/index.ts +4 -0
  246. package/src/stores/locale.ts +79 -0
  247. package/src/stores/stats.ts +36 -0
  248. package/src/stores/testResults.ts +40 -0
  249. package/src/stores/theme.ts +33 -0
  250. package/src/stores/tree.ts +33 -0
  251. package/src/stores/types.ts +5 -0
  252. package/src/types/globals.d.ts +8 -0
  253. package/src/types/window.d.ts +8 -0
  254. package/src/utils/attachments.ts +156 -0
  255. package/src/utils/capitalize.ts +4 -0
  256. package/src/utils/copyToClipboard.ts +3 -0
  257. package/src/utils/isMac.ts +7 -0
  258. package/src/utils/statuses.ts +55 -0
  259. package/src/utils/time.ts +17 -0
  260. package/src/utils/treeFilters.ts +150 -0
  261. package/tsconfig.json +25 -0
  262. package/types.d.ts +53 -0
  263. package/webpack.config.js +108 -0
@@ -0,0 +1,26 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import type { AllureAwesomeTestResult } from "types";
3
+ import { TestResultHistoryItem } from "@/components/app/TestResult/TestResultHistory/TestResultHistoryItem";
4
+ import { useI18n } from "@/stores";
5
+ import * as styles from "./styles.scss";
6
+
7
+ export type TestResultHistoryViewProps = {
8
+ testResult?: AllureAwesomeTestResult;
9
+ };
10
+
11
+ const TestResultHistoryView: FunctionalComponent<TestResultHistoryViewProps> = ({ testResult }) => {
12
+ const { history } = testResult ?? {};
13
+ const { t } = useI18n("empty");
14
+
15
+ return (
16
+ <div className={styles["test-result-history"]}>
17
+ {history.length ? (
18
+ history?.map((item, key) => <TestResultHistoryItem testResultItem={item} key={key} />)
19
+ ) : (
20
+ <div className={styles["test-result-empty"]}>{t("no-history-results")}</div>
21
+ )}
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default TestResultHistoryView;
@@ -0,0 +1,63 @@
1
+ .test-result-history {
2
+ padding: 12px 24px 32px;
3
+ min-height: 320px;
4
+ }
5
+
6
+ .test-result-history-item-header {
7
+ display: flex;
8
+ width: 100%;
9
+ gap: 4px;
10
+ align-items: center;
11
+ cursor: pointer;
12
+ }
13
+
14
+ .test-result-history-item-wrap {
15
+ transition: background-color 300ms;
16
+ display: flex;
17
+ gap: 4px;
18
+ justify-content: space-between;
19
+ border-radius: 6px;
20
+ padding: 4px 4px 4px 4px;
21
+ width: 100%;
22
+ align-items: flex-start;
23
+
24
+ &:hover {
25
+ background: var(--bg-control-flat-medium);
26
+ }
27
+ }
28
+
29
+ .test-result-history-item-text {
30
+ padding-top: 2px;
31
+ }
32
+
33
+ .test-result-history-item-info {
34
+ display: flex;
35
+ gap: 4px;
36
+ align-items: center;
37
+ margin-left: auto;
38
+ }
39
+
40
+ .item-time {
41
+ margin-left: auto;
42
+ line-height: 20px;
43
+ color: var(--on-text-secondary);
44
+ }
45
+
46
+ .test-result-history-item-link {
47
+ :root {
48
+ --allure-btn-icon-color: var(--bg-control-flat);
49
+ }
50
+
51
+ color: var(--on-icon-secondary);
52
+ }
53
+
54
+ .test-result-history-item-status {
55
+ padding-top: 4px;
56
+ }
57
+
58
+ .test-result-empty {
59
+ display: flex;
60
+ padding: 48px 0;
61
+ width: 100%;
62
+ justify-content: center;
63
+ }
@@ -0,0 +1,79 @@
1
+ import { formatDuration } from "@allurereport/core-api";
2
+ import * as test from "node:test";
3
+ import { FunctionalComponent } from "preact";
4
+ import { AllureAwesomeTestResult } from "types";
5
+ import { TestResultNavigation } from "@/components/app/TestResult/TestResultNavigation";
6
+ import { TestResultPrevStatuses } from "@/components/app/TestResult/TestResultPrevStatuses";
7
+ import { TestResultSeverity } from "@/components/app/TestResult/TestResultSeverity";
8
+ import { TestResultStatus } from "@/components/app/TestResult/TestResultStatus";
9
+ import { TestResultTab, TestResultTabsList } from "@/components/app/TestResult/TestResultTabs";
10
+ import { Counter } from "@/components/commons/Counter";
11
+ import { TooltipWrapper } from "@/components/commons/Tooltip";
12
+ import { Heading, Text } from "@/components/commons/Typography";
13
+ import { useI18n } from "@/stores/locale";
14
+ import { timestampToDate } from "@/utils/time";
15
+ import * as styles from "./styles.scss";
16
+
17
+ export type TestResultInfoProps = {
18
+ testResult?: AllureAwesomeTestResult;
19
+ };
20
+
21
+ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testResult }) => {
22
+ const { name, status, duration, labels, history, retries, attachments, stop } = testResult ?? {};
23
+ const formattedDuration = formatDuration(duration);
24
+ const fullDate = stop && timestampToDate(stop);
25
+ const severity = labels?.find((label) => label.name === "severity")?.value ?? "normal";
26
+ const { t } = useI18n("ui");
27
+
28
+ const Content = () => {
29
+ return (
30
+ <>
31
+ {name && (
32
+ <Heading data-testid="test-result-info-title" tag={"h1"} size={"s"} className={styles["test-result-name"]}>
33
+ {name}
34
+ </Heading>
35
+ )}
36
+ <div className={styles["test-result-info-data"]}>
37
+ {Boolean(status) && <TestResultStatus status={status} />}
38
+ {Boolean(history?.length) && <TestResultPrevStatuses history={history} />}
39
+ <TestResultSeverity severity={severity} />
40
+ <TooltipWrapper tooltipText={fullDate}>
41
+ <Text tag={"div"} size={"s"} bold className={styles["test-result-duration"]}>
42
+ {formattedDuration}
43
+ </Text>
44
+ </TooltipWrapper>
45
+ </div>
46
+ <div className={styles["test-result-tabs"]}>
47
+ <TestResultTabsList>
48
+ <TestResultTab id="overview">{t("overview")}</TestResultTab>
49
+ <TestResultTab id="history" disabled={!history?.length}>
50
+ <div className={styles["test-result-tab"]}>
51
+ {t("history")}
52
+ {Boolean(history?.length) && <Counter size={"s"} count={history?.length} />}
53
+ </div>
54
+ </TestResultTab>
55
+ <TestResultTab id="retries" disabled={!retries?.length}>
56
+ <div className={styles["test-result-tab"]}>
57
+ {t("retries")}
58
+ {Boolean(retries?.length) && <Counter size={"s"} count={retries?.length} />}
59
+ </div>
60
+ </TestResultTab>
61
+ <TestResultTab id="attachments" disabled={!attachments?.length}>
62
+ <div className={styles["test-result-tab"]}>
63
+ {t("attachments")}
64
+ {Boolean(attachments?.length) && <Counter size={"s"} count={attachments?.length} />}
65
+ </div>
66
+ </TestResultTab>
67
+ </TestResultTabsList>
68
+ </div>
69
+ </>
70
+ );
71
+ };
72
+
73
+ return (
74
+ <div className={styles["test-result-info"]}>
75
+ <TestResultNavigation testResult={testResult} />
76
+ {testResult && <Content />}
77
+ </div>
78
+ );
79
+ };
@@ -0,0 +1,33 @@
1
+ .test-result-info {
2
+ padding: 20px 24px 0;
3
+ }
4
+
5
+ .test-result-info-data {
6
+ display: flex;
7
+ gap: 12px;
8
+ align-items: center;
9
+ margin-bottom: 8px;
10
+
11
+ & > *:not(:first-child):not(:empty) {
12
+ border-left: 1px solid var(--on-border-primary);
13
+ padding-left: 12px;
14
+ }
15
+ }
16
+
17
+ .test-result-name {
18
+ margin-bottom: 8px;
19
+ }
20
+
21
+ .test-result-duration {
22
+ color: var(--on-text-secondary);
23
+ }
24
+
25
+ .test-result-tabs {
26
+ border-bottom: 1px solid var(--on-border-primary);
27
+ }
28
+
29
+ .test-result-tab {
30
+ display: flex;
31
+ gap: 4px;
32
+ align-items: center;
33
+ }
@@ -0,0 +1,60 @@
1
+ import { FunctionalComponent } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import { AllureAwesomeTestResult } from "types";
4
+ import githubIcon from "@/assets/svg/github.svg";
5
+ import Bug from "@/assets/svg/line-dev-bug-2.svg";
6
+ import TmsLink from "@/assets/svg/line-general-checklist3.svg";
7
+ import Link from "@/assets/svg/line-general-link-1.svg";
8
+ import { MetadataButton } from "@/components/app/MetadataButton";
9
+ import { SvgIcon } from "@/components/commons/SvgIcon";
10
+ import { Text } from "@/components/commons/Typography";
11
+ import { useI18n } from "@/stores/locale";
12
+ import * as styles from "./styles.scss";
13
+
14
+ interface TestResultLinkProps {
15
+ name: string;
16
+ url: string;
17
+ type: string;
18
+ }
19
+
20
+ const TestResultLink: FunctionalComponent<{
21
+ link: TestResultLinkProps;
22
+ }> = ({ link }) => {
23
+ const { url, type } = link;
24
+ const iconMap = {
25
+ issue: Bug.id,
26
+ link: Link.id,
27
+ tms: TmsLink.id,
28
+ github: githubIcon.id,
29
+ };
30
+
31
+ return (
32
+ <div className={styles["test-result-link"]}>
33
+ <SvgIcon id={iconMap[type] ?? Link.id} />
34
+ <Text tag={"a"} href={url} target={"_blank"} size={"m"} className={styles["test-result-link-text"]}>
35
+ {url}
36
+ </Text>
37
+ </div>
38
+ );
39
+ };
40
+
41
+ export type TestResultLinksProps = {
42
+ links: AllureAwesomeTestResult["links"];
43
+ };
44
+
45
+ export const TestResultLinks: FunctionalComponent<TestResultLinksProps> = ({ links }) => {
46
+ const [isOpened, setIsOpen] = useState(true);
47
+ const { t } = useI18n("ui");
48
+ const linkMap = links.map((link, index) => {
49
+ return <TestResultLink link={link as TestResultLinkProps} key={index} />;
50
+ });
51
+
52
+ return (
53
+ <div className={styles["test-result-links"]}>
54
+ <div className={styles["test-result-links-wrapper"]}>
55
+ <MetadataButton isOpened={isOpened} setIsOpen={setIsOpen} counter={links.length} title={t("links")} />
56
+ {isOpened && <div className={styles["test-result-links-list"]}>{linkMap}</div>}
57
+ </div>
58
+ </div>
59
+ );
60
+ };
@@ -0,0 +1,30 @@
1
+ .test-result-links {
2
+ display: flex;
3
+ gap: 4px;
4
+ width: 100%;
5
+ padding: 12px 24px 0;
6
+ }
7
+
8
+ .test-result-links-wrapper {
9
+ width: 100%;
10
+ border-bottom: 1px solid var(--on-border-primary);
11
+ padding-bottom: 12px;
12
+ }
13
+
14
+ .test-result-link {
15
+ display: flex;
16
+ gap: 4px;
17
+ padding: 6px;
18
+ align-items: center;
19
+ }
20
+
21
+ .test-result-link-text {
22
+ color: var(--on-support-aldebaran);
23
+ }
24
+
25
+ .test-result-links-list {
26
+ display: grid;
27
+ column-gap: 32px;
28
+ grid-template-columns: repeat(2, 1fr);
29
+ width: 100%;
30
+ }
@@ -0,0 +1,27 @@
1
+ import { FunctionalComponent } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import { AllureAwesomeTestResult } from "types";
4
+ import { TestResultMetadataList } from "@/components/app/Metadata";
5
+ import { MetadataButton } from "@/components/app/MetadataButton";
6
+ import { useI18n } from "@/stores/locale";
7
+ import * as styles from "./styles.scss";
8
+
9
+ export type TestResultMetadataProps = {
10
+ testResult?: AllureAwesomeTestResult;
11
+ };
12
+
13
+ export const TestResultMetadata: FunctionalComponent<TestResultMetadataProps> = ({ testResult }) => {
14
+ const { t } = useI18n("ui");
15
+ const { labels, groupedLabels } = testResult ?? {};
16
+ const [isOpened, setIsOpened] = useState(true);
17
+
18
+ return (
19
+ <div className={styles["test-result-metadata"]}>
20
+ <MetadataButton isOpened={isOpened} setIsOpen={setIsOpened} counter={labels?.length} title={t("labels")} />
21
+
22
+ <div className={styles["test-result-metadata-wrapper"]}>
23
+ {isOpened && <TestResultMetadataList groupedLabels={groupedLabels} />}
24
+ </div>
25
+ </div>
26
+ );
27
+ };
@@ -0,0 +1,8 @@
1
+ .test-result-metadata {
2
+ padding: 12px 24px 0;
3
+ }
4
+
5
+ .test-result-metadata-wrapper {
6
+ border-bottom: 1px solid var(--on-border-primary);
7
+ padding-bottom: 12px;
8
+ }
@@ -0,0 +1,89 @@
1
+ import { FunctionalComponent } from "preact";
2
+ import { AllureAwesomeTestResult } from "types";
3
+ import LineArrowsChevronDown from "@/assets/svg/line-arrows-chevron-down.svg";
4
+ import LineGeneralCopy3 from "@/assets/svg/line-general-copy-3.svg";
5
+ import { IconButton } from "@/components/commons/Button";
6
+ import { Loadable } from "@/components/commons/Loadable";
7
+ import { TooltipWrapper } from "@/components/commons/Tooltip";
8
+ import { Code } from "@/components/commons/Typography";
9
+ import { navigateTo } from "@/index";
10
+ import { useI18n } from "@/stores";
11
+ import { treeStore } from "@/stores/tree";
12
+ import { copyToClipboard } from "@/utils/copyToClipboard";
13
+ import * as styles from "./styles.scss";
14
+
15
+ export type TestResultNavigationProps = {
16
+ testResult?: AllureAwesomeTestResult;
17
+ };
18
+
19
+ export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps> = ({ testResult }) => {
20
+ const { fullName, id: testResultId } = testResult ?? {};
21
+ const id = testResultId || "";
22
+ const { t: tooltip } = useI18n("controls");
23
+
24
+ return (
25
+ <Loadable
26
+ source={treeStore}
27
+ renderData={(treeData) => {
28
+ const leaves = treeData && Object.keys(treeData?.leavesById);
29
+ const currentIndex = id && leaves?.findIndex((leave) => leave === id) + 1;
30
+ const allTestResults = leaves?.length;
31
+
32
+ const FullName = () => {
33
+ return (
34
+ <div data-testid="test-result-fullname" className={styles["test-result-fullName"]}>
35
+ <TooltipWrapper tooltipText={tooltip("clipboard")} tooltipTextAfterClick={tooltip("clipboardSuccess")}>
36
+ <IconButton
37
+ data-testid="test-result-fullname-copy"
38
+ style={"ghost"}
39
+ size={"s"}
40
+ icon={LineGeneralCopy3.id}
41
+ onClick={() => copyToClipboard(fullName)}
42
+ />
43
+ </TooltipWrapper>
44
+ <Code tag={"div"} size={"s"} className={styles["test-result-fullName-text"]}>
45
+ {fullName && fullName}
46
+ </Code>
47
+ </div>
48
+ );
49
+ };
50
+
51
+ return (
52
+ <div className={styles["test-result-nav"]}>
53
+ {fullName && <FullName />}
54
+ {allTestResults && (
55
+ <div className={styles["test-result-navigator"]}>
56
+ <TooltipWrapper tooltipText={tooltip("nextTR")}>
57
+ <IconButton
58
+ icon={LineArrowsChevronDown.id}
59
+ style={"ghost"}
60
+ isDisabled={currentIndex === allTestResults}
61
+ data-testid="test-result-nav-next"
62
+ onClick={() => navigateTo(leaves[currentIndex])}
63
+ className={styles["test-result-nav-next"]}
64
+ />
65
+ </TooltipWrapper>
66
+ <Code
67
+ data-testid="test-result-nav-current"
68
+ size={"s"}
69
+ className={styles["test-result-navigator-numbers"]}
70
+ >
71
+ {currentIndex}/{allTestResults}
72
+ </Code>
73
+ <TooltipWrapper tooltipText={tooltip("prevTR")} isTriggerActive={currentIndex > 1}>
74
+ <IconButton
75
+ icon={LineArrowsChevronDown.id}
76
+ style={"ghost"}
77
+ isDisabled={currentIndex <= 1}
78
+ data-testid="test-result-nav-prev"
79
+ onClick={() => navigateTo(leaves[currentIndex - 2])}
80
+ />
81
+ </TooltipWrapper>
82
+ </div>
83
+ )}
84
+ </div>
85
+ );
86
+ }}
87
+ />
88
+ );
89
+ };
@@ -0,0 +1,48 @@
1
+ .test-result-nav {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ margin-bottom: 12px;
5
+ }
6
+
7
+ .test-result-fullName {
8
+ font-weight: 400;
9
+ display: flex;
10
+ gap: 4px;
11
+ align-items: center;
12
+ white-space: nowrap;
13
+ text-overflow: ellipsis;
14
+ overflow: hidden;
15
+ min-height: 32px;
16
+ }
17
+
18
+ .test-result-fullName-text {
19
+ overflow: hidden;
20
+ white-space: nowrap;
21
+ text-overflow: ellipsis;
22
+ width: 100%;
23
+ font-weight: 400;
24
+ color: var(--on-text-secondary);
25
+ }
26
+
27
+ .test-result-fullName-icon {
28
+ --allure-btn-icon-color: var(--on-icon-secondary);
29
+ }
30
+
31
+ .test-result-navigator {
32
+ display: flex;
33
+ gap: 4px;
34
+ align-items: center;
35
+ margin-left: auto;
36
+ }
37
+
38
+ .test-result-navigator-numbers {
39
+ color: var(--on-text-secondary);
40
+ font-weight: 400;
41
+ }
42
+
43
+ .test-result-nav-next {
44
+ transform: rotate(-180deg);
45
+ &:active {
46
+ transform: scale(var(--allure-btn-pressed-scale)) rotate(-180deg);
47
+ }
48
+ }
@@ -0,0 +1,40 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import * as styles from "@/components/app/BaseLayout/styles.scss";
3
+ import { TestResultDescription } from "@/components/app/TestResult/TestResultDescription";
4
+ import { TestResultError } from "@/components/app/TestResult/TestResultError";
5
+ import { TestResultLinks } from "@/components/app/TestResult/TestResultLinks";
6
+ import { TestResultMetadata } from "@/components/app/TestResult/TestResultMetadata";
7
+ import { TestResultParameters } from "@/components/app/TestResult/TestResultParameters";
8
+ import { TestResultSetup } from "@/components/app/TestResult/TestResultSetup";
9
+ import { TestResultSteps } from "@/components/app/TestResult/TestResultSteps";
10
+ import { TestResultTeardown } from "@/components/app/TestResult/TestResultTeardown";
11
+ import type { AllureAwesomeTestResult } from "../../../../types.js";
12
+
13
+ export type TestResultOverviewProps = {
14
+ testResult?: AllureAwesomeTestResult;
15
+ };
16
+
17
+ export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> = ({ testResult }) => {
18
+ const { message, trace, parameters, groupedLabels, links, description, setup, steps, teardown } = testResult || {};
19
+
20
+ return (
21
+ <>
22
+ {Boolean(message) && (
23
+ <div className={styles["test-result-errors"]}>
24
+ <TestResultError message={message} trace={trace} />
25
+ </div>
26
+ )}
27
+ {Boolean(parameters?.length) && <TestResultParameters parameters={parameters} />}
28
+ {Boolean(groupedLabels && Object.keys(groupedLabels || {})?.length) && (
29
+ <TestResultMetadata testResult={testResult} />
30
+ )}
31
+ {Boolean(links?.length) && <TestResultLinks links={links} />}
32
+ {Boolean(description) && <TestResultDescription description={description} />}
33
+ <div className={styles["test-results"]}>
34
+ {Boolean(setup?.length) && <TestResultSetup setup={setup} />}
35
+ {Boolean(steps?.length) && <TestResultSteps steps={steps} />}
36
+ {Boolean(teardown?.length) && <TestResultTeardown teardown={teardown} />}
37
+ </div>
38
+ </>
39
+ );
40
+ };
@@ -0,0 +1,30 @@
1
+ import { FunctionalComponent } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import { AllureAwesomeTestResult } from "types";
4
+ import { MetadataList } from "@/components/app/Metadata";
5
+ import { MetadataButton } from "@/components/app/MetadataButton";
6
+ import { useI18n } from "@/stores/locale";
7
+ import * as styles from "./styles.scss";
8
+
9
+ export type TestResultParametersProps = {
10
+ parameters: AllureAwesomeTestResult["parameters"];
11
+ };
12
+
13
+ export const TestResultParameters: FunctionalComponent<TestResultParametersProps> = ({ parameters }) => {
14
+ const [isOpened, setIsOpened] = useState(true);
15
+ const { t } = useI18n("ui");
16
+
17
+ return (
18
+ <div className={styles["test-result-metadata"]}>
19
+ <MetadataButton
20
+ isOpened={isOpened}
21
+ setIsOpen={setIsOpened}
22
+ counter={parameters?.length}
23
+ title={t("parameters")}
24
+ />
25
+ {/* FIXME: use proper type in the MetadataList component */}
26
+ {/* @ts-ignore */}
27
+ <div className={styles["test-result-metadata-wrapper"]}>{isOpened && <MetadataList envInfo={parameters} />}</div>
28
+ </div>
29
+ );
30
+ };
@@ -0,0 +1,8 @@
1
+ .test-result-metadata {
2
+ padding: 12px 24px 0;
3
+ }
4
+
5
+ .test-result-metadata-wrapper {
6
+ border-bottom: 1px solid var(--on-border-primary);
7
+ padding-bottom: 12px;
8
+ }
@@ -0,0 +1,52 @@
1
+ import { autoUpdate, computePosition, flip, offset, shift } from "@floating-ui/dom";
2
+ import { FunctionalComponent } from "preact";
3
+ import { useEffect, useRef, useState } from "preact/hooks";
4
+ import { AllureAwesomeTestResult } from "types";
5
+ import LineShapesDotCircle from "@/assets/svg/line-shapes-dot-circle.svg";
6
+ import { SvgIcon } from "@/components/commons/SvgIcon";
7
+ import { TooltipWrapper } from "@/components/commons/Tooltip";
8
+ import { Text } from "@/components/commons/Typography";
9
+ import { useI18n } from "@/stores";
10
+ import { capitalize } from "@/utils/capitalize";
11
+ import { timestampToDate } from "@/utils/time";
12
+ import * as styles from "./styles.scss";
13
+
14
+ const TestResultPrevStatus = ({ item }) => {
15
+ return (
16
+ <div className={styles["test-result-prev-status"]}>
17
+ <SvgIcon id={LineShapesDotCircle.id} className={styles[`status-${item?.status}`]} />
18
+ </div>
19
+ );
20
+ };
21
+ const TestResultPrevStatusTooltip = ({ item }) => {
22
+ const convertedStop = item.stop && timestampToDate(item.stop);
23
+ const { t } = useI18n("statuses");
24
+ const status = t(item.status);
25
+
26
+ return (
27
+ <div className={styles["test-result-prev-status-tooltip"]}>
28
+ <Text tag={"div"} size={"m"} bold>
29
+ {capitalize(status)}
30
+ </Text>
31
+ <Text size={"m"}>{convertedStop}</Text>
32
+ </div>
33
+ );
34
+ };
35
+
36
+ export type TestResultPrevStatusesProps = {
37
+ history: AllureAwesomeTestResult["history"];
38
+ };
39
+
40
+ export const TestResultPrevStatuses: FunctionalComponent<TestResultPrevStatusesProps> = ({ history }) => {
41
+ return (
42
+ <div className={styles["test-result-prev-statuses"]}>
43
+ {history?.slice(0, 6).map((item, key) => (
44
+ <div className={styles["test-result-prev-status"]}>
45
+ <TooltipWrapper key={key} tooltipComponent={<TestResultPrevStatusTooltip item={item} />}>
46
+ <TestResultPrevStatus item={item} />
47
+ </TooltipWrapper>
48
+ </div>
49
+ ))}
50
+ </div>
51
+ );
52
+ };
@@ -0,0 +1,57 @@
1
+ .test-result-prev-statuses {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+
6
+ .test-result-prev-status {
7
+ position: relative;
8
+ display: flex;
9
+ cursor: pointer;
10
+
11
+ &:not(:first-child) {
12
+ padding-left: 8px;
13
+
14
+ &:before {
15
+ content: "";
16
+ width: 8px;
17
+ position: absolute;
18
+ height: 2px;
19
+ left: 0;
20
+ top: 0;
21
+ bottom: 0;
22
+ margin: auto;
23
+ background: var(--on-border-medium);
24
+ }
25
+ }
26
+ }
27
+
28
+ .status-passed {
29
+ color: var(--bg-support-castor);
30
+ }
31
+
32
+ .status-failed {
33
+ color: var(--bg-support-capella);
34
+ }
35
+
36
+ .status-broken {
37
+ color: var(--bg-support-atlas);
38
+ }
39
+
40
+ .status-skipped {
41
+ color: var(--bg-support-rau);
42
+ }
43
+
44
+ .status-unknown {
45
+ color: var(--bg-support-skat);
46
+ }
47
+
48
+ .test-result-prev-status-tooltip {
49
+ text-align: center;
50
+ background-color: var(--constant-bg-base-modal);
51
+ color: var(--constant-on-text-primary);
52
+ padding: 2px 8px;
53
+ border-radius: 6px;
54
+ font-size: 12px;
55
+ max-width: 600px;
56
+ min-width: max-content;
57
+ }