@allurereport/web-classic 3.0.0-beta.10

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 (241) hide show
  1. package/.babelrc--old.cjs +18 -0
  2. package/.babelrc.js +46 -0
  3. package/.eslintrc--old.cjs +125 -0
  4. package/.eslintrc.cjs +22 -0
  5. package/README.md +27 -0
  6. package/dist/multi/10.app-970f027d.js +1 -0
  7. package/dist/multi/222.app-970f027d.js +1 -0
  8. package/dist/multi/26.app-970f027d.js +1 -0
  9. package/dist/multi/302.app-970f027d.js +1 -0
  10. package/dist/multi/304.app-970f027d.js +1 -0
  11. package/dist/multi/369.app-970f027d.js +1 -0
  12. package/dist/multi/389.app-970f027d.js +1 -0
  13. package/dist/multi/498.app-970f027d.js +1 -0
  14. package/dist/multi/60.app-970f027d.js +1 -0
  15. package/dist/multi/643.app-970f027d.js +1 -0
  16. package/dist/multi/671.app-970f027d.js +1 -0
  17. package/dist/multi/725.app-970f027d.js +1 -0
  18. package/dist/multi/770.app-970f027d.js +1 -0
  19. package/dist/multi/848.app-970f027d.js +1 -0
  20. package/dist/multi/853.app-970f027d.js +1 -0
  21. package/dist/multi/872.app-970f027d.js +1 -0
  22. package/dist/multi/895.app-970f027d.js +1 -0
  23. package/dist/multi/920.app-970f027d.js +1 -0
  24. package/dist/multi/979.app-970f027d.js +1 -0
  25. package/dist/multi/991.app-970f027d.js +1 -0
  26. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  27. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  28. package/dist/multi/app-970f027d.js +2 -0
  29. package/dist/multi/app-970f027d.js.LICENSE.txt +25 -0
  30. package/dist/multi/manifest.json +28 -0
  31. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  32. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  33. package/dist/multi/styles-970f027d.css +283 -0
  34. package/dist/single/app-2babff54.js +2 -0
  35. package/dist/single/app-2babff54.js.LICENSE.txt +25 -0
  36. package/dist/single/manifest.json +3 -0
  37. package/package--old.json +106 -0
  38. package/package.json +107 -0
  39. package/postcss.config.js +5 -0
  40. package/src/assets/scss/_common.scss +142 -0
  41. package/src/assets/scss/code.scss +71 -0
  42. package/src/assets/scss/day.scss +51 -0
  43. package/src/assets/scss/fonts.scss +3 -0
  44. package/src/assets/scss/index.scss +9 -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/components/ArrowButton/index.tsx +36 -0
  51. package/src/components/ArrowButton/styles.scss +35 -0
  52. package/src/components/BaseLayout/index.tsx +23 -0
  53. package/src/components/BaseLayout/styles.scss +63 -0
  54. package/src/components/Behaviors/BehaviorsList.tsx +67 -0
  55. package/src/components/Behaviors/index.tsx +60 -0
  56. package/src/components/Behaviors/styles.scss +196 -0
  57. package/src/components/Categories/CategoriesList.tsx +67 -0
  58. package/src/components/Categories/index.tsx +60 -0
  59. package/src/components/Categories/styles.scss +196 -0
  60. package/src/components/Footer/FooterLogo.tsx +16 -0
  61. package/src/components/Footer/FooterVersion.tsx +33 -0
  62. package/src/components/Footer/index.tsx +13 -0
  63. package/src/components/Footer/styles.scss +14 -0
  64. package/src/components/Graphs/index.tsx +2 -0
  65. package/src/components/Header/index.tsx +14 -0
  66. package/src/components/Header/styles.scss +26 -0
  67. package/src/components/HeaderActions/Filters.tsx +90 -0
  68. package/src/components/HeaderActions/HeaderActions.tsx +59 -0
  69. package/src/components/HeaderActions/SortBy.tsx +128 -0
  70. package/src/components/HeaderActions/styles.scss +82 -0
  71. package/src/components/LanguagePicker/index.tsx +41 -0
  72. package/src/components/LanguagePicker/styles.scss +3 -0
  73. package/src/components/MainReport/index.tsx +19 -0
  74. package/src/components/Metadata/index.tsx +121 -0
  75. package/src/components/Metadata/styles.scss +146 -0
  76. package/src/components/MetadataButton/index.tsx +32 -0
  77. package/src/components/MetadataButton/styles.scss +53 -0
  78. package/src/components/Modal/ModalView.hbs +13 -0
  79. package/src/components/Modal/ModalView.js +43 -0
  80. package/src/components/Modal/index.tsx +174 -0
  81. package/src/components/Modal/styles.scss +126 -0
  82. package/src/components/Overview/index.tsx +9 -0
  83. package/src/components/Packages/PackagesList.tsx +67 -0
  84. package/src/components/Packages/index.tsx +59 -0
  85. package/src/components/Packages/styles.scss +196 -0
  86. package/src/components/ReportBody/Filters.tsx +92 -0
  87. package/src/components/ReportBody/HeaderActions.tsx +21 -0
  88. package/src/components/ReportBody/SortBy.tsx +132 -0
  89. package/src/components/ReportBody/context.tsx +106 -0
  90. package/src/components/ReportBody/index.tsx +71 -0
  91. package/src/components/ReportBody/styles.scss +64 -0
  92. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  93. package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
  94. package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
  95. package/src/components/ReportHeader/index.tsx +33 -0
  96. package/src/components/ReportHeader/styles.scss +49 -0
  97. package/src/components/ReportLogo/index.tsx +16 -0
  98. package/src/components/ReportLogo/styles.scss +20 -0
  99. package/src/components/ReportLogoFull/index.tsx +20 -0
  100. package/src/components/ReportLogoFull/styles.scss +7 -0
  101. package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
  102. package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
  103. package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
  104. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  105. package/src/components/ReportMetadata/index.tsx +46 -0
  106. package/src/components/ReportMetadata/styles.scss +99 -0
  107. package/src/components/SideBySide/index.tsx +54 -0
  108. package/src/components/SideBySide/styles.scss +59 -0
  109. package/src/components/SideNav/SideNav.tsx +78 -0
  110. package/src/components/SideNav/SideNavView.hbs +39 -0
  111. package/src/components/SideNav/SideNavView.js +81 -0
  112. package/src/components/SideNav/styles.scss +126 -0
  113. package/src/components/Suites/index.tsx +62 -0
  114. package/src/components/Suites/styles.scss +10 -0
  115. package/src/components/Tabs/index.tsx +33 -0
  116. package/src/components/Tabs/styles.scss +56 -0
  117. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  118. package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  119. package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
  120. package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
  121. package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
  122. package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
  123. package/src/components/TestResult/TestResultEmpty/index.tsx +33 -0
  124. package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
  125. package/src/components/TestResult/TestResultError/index.tsx +48 -0
  126. package/src/components/TestResult/TestResultError/styles.scss +51 -0
  127. package/src/components/TestResult/TestResultHeader/index.tsx +53 -0
  128. package/src/components/TestResult/TestResultHeader/styles.scss +43 -0
  129. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +67 -0
  130. package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
  131. package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
  132. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
  133. package/src/components/TestResult/TestResultInfo/index.tsx +79 -0
  134. package/src/components/TestResult/TestResultInfo/styles.scss +50 -0
  135. package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
  136. package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
  137. package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
  138. package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
  139. package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
  140. package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
  141. package/src/components/TestResult/TestResultOverview.tsx +40 -0
  142. package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
  143. package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
  144. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
  145. package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  146. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +49 -0
  147. package/src/components/TestResult/TestResultRetriesView/index.tsx +20 -0
  148. package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
  149. package/src/components/TestResult/TestResultSetup/index.tsx +49 -0
  150. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  151. package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
  152. package/src/components/TestResult/TestResultStatus/index.tsx +26 -0
  153. package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
  154. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
  155. package/src/components/TestResult/TestResultSteps/attachment.tsx +68 -0
  156. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +20 -0
  157. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +32 -0
  158. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
  159. package/src/components/TestResult/TestResultSteps/index.tsx +49 -0
  160. package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
  161. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +77 -0
  162. package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
  163. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +78 -0
  164. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  165. package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  166. package/src/components/TestResult/TestResultTabs/index.tsx +59 -0
  167. package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
  168. package/src/components/TestResult/TestResultTeardown/index.tsx +49 -0
  169. package/src/components/TestResult/TestResultView.hbs +32 -0
  170. package/src/components/TestResult/TestResultView.js +90 -0
  171. package/src/components/TestResult/index.tsx +54 -0
  172. package/src/components/TestResult/styles.scss +29 -0
  173. package/src/components/TestResultView/index.tsx +31 -0
  174. package/src/components/ThemeButton/ThemeButton.tsx +20 -0
  175. package/src/components/Timeline/index.tsx +2 -0
  176. package/src/components/Tree/Tree.tsx +76 -0
  177. package/src/components/Tree/TreeHeader.tsx +82 -0
  178. package/src/components/Tree/TreeItem.tsx +49 -0
  179. package/src/components/Tree/TreeItemIcon.tsx +32 -0
  180. package/src/components/Tree/index.tsx +60 -0
  181. package/src/components/Tree/styles.scss +185 -0
  182. package/src/favicon.ico +0 -0
  183. package/src/index.html +40 -0
  184. package/src/index.js +52 -0
  185. package/src/index.tsx +60 -0
  186. package/src/mixins.scss +128 -0
  187. package/src/rtl.scss +19 -0
  188. package/src/stores/behaviors.ts +127 -0
  189. package/src/stores/categories.ts +127 -0
  190. package/src/stores/chart.ts +32 -0
  191. package/src/stores/envInfo.ts +34 -0
  192. package/src/stores/index.ts +4 -0
  193. package/src/stores/locale.ts +83 -0
  194. package/src/stores/packages.ts +127 -0
  195. package/src/stores/router.ts +55 -0
  196. package/src/stores/stats.ts +36 -0
  197. package/src/stores/tabs.ts +7 -0
  198. package/src/stores/testResults.ts +66 -0
  199. package/src/stores/theme.ts +33 -0
  200. package/src/stores/tree.ts +127 -0
  201. package/src/stores/types.ts +5 -0
  202. package/src/styles.scss +91 -0
  203. package/src/translations/am.json +127 -0
  204. package/src/translations/az.json +127 -0
  205. package/src/translations/br.json +214 -0
  206. package/src/translations/constants.ts +124 -0
  207. package/src/translations/de.json +127 -0
  208. package/src/translations/en.json +128 -0
  209. package/src/translations/es.json +118 -0
  210. package/src/translations/fr.json +118 -0
  211. package/src/translations/he.json +118 -0
  212. package/src/translations/isv.json +216 -0
  213. package/src/translations/it.json +118 -0
  214. package/src/translations/ja.json +118 -0
  215. package/src/translations/ka.json +118 -0
  216. package/src/translations/kr.json +118 -0
  217. package/src/translations/nl.json +118 -0
  218. package/src/translations/pl.json +116 -0
  219. package/src/translations/pt.json +118 -0
  220. package/src/translations/ru.json +116 -0
  221. package/src/translations/sv.json +118 -0
  222. package/src/translations/tr.json +118 -0
  223. package/src/translations/zh.json +118 -0
  224. package/src/types/globals.d.ts +13 -0
  225. package/src/types/window.d.ts +8 -0
  226. package/src/utils/attachments.ts +156 -0
  227. package/src/utils/capitalize.ts +6 -0
  228. package/src/utils/copyToClipboard.ts +16 -0
  229. package/src/utils/isMac.ts +8 -0
  230. package/src/utils/navigate.ts +7 -0
  231. package/src/utils/statuses.js +1 -0
  232. package/src/utils/statuses.ts +55 -0
  233. package/src/utils/time.ts +17 -0
  234. package/src/utils/treeFilters.ts +139 -0
  235. package/src/variables.scss +71 -0
  236. package/test/utils/treeFilters.test.ts +448 -0
  237. package/tsconfig.json +25 -0
  238. package/types.d.ts +85 -0
  239. package/vitest.config.ts +18 -0
  240. package/webpack.config--old.js +127 -0
  241. package/webpack.config.js +108 -0
@@ -0,0 +1,67 @@
1
+ import { type HistoryTestResult, formatDuration } from "@allurereport/core-api";
2
+ import { IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
3
+ import { type FunctionalComponent } from "preact";
4
+ import { useState } from "preact/hooks";
5
+ import { ArrowButton } from "@/components/ArrowButton";
6
+ import { TestResultError } from "@/components/TestResult/TestResultError";
7
+ import * as styles from "@/components/TestResult/TestResultHistory/styles.scss";
8
+ import TreeItemIcon from "@/components/Tree/TreeItemIcon";
9
+ import { useI18n } from "@/stores";
10
+ import { navigateTo, openInNewTab } from "@/utils/navigate";
11
+ import { timestampToDate } from "@/utils/time";
12
+
13
+ export const TestResultHistoryItem: FunctionalComponent<{
14
+ testResultItem: HistoryTestResult;
15
+ }> = ({ testResultItem }) => {
16
+ const { status, message, trace, stop, duration, id } = testResultItem;
17
+ const [isOpened, setIsOpen] = useState(false);
18
+ const convertedStop = timestampToDate(stop);
19
+ const formattedDuration = formatDuration(duration as number);
20
+ const { t } = useI18n("controls");
21
+
22
+ const navigateUrl = `testresult/${id}`;
23
+
24
+ return (
25
+ <div>
26
+ <div className={styles["test-result-history-item-header"]}>
27
+ {Boolean(message) && (
28
+ <span onClick={() => setIsOpen(!isOpened)}>
29
+ <ArrowButton isOpened={isOpened} icon={allureIcons.arrowsChevronDown} />
30
+ </span>
31
+ )}
32
+ <div
33
+ className={styles["test-result-history-item-wrap"]}
34
+ onClick={(e) => {
35
+ e.stopPropagation();
36
+ navigateTo(navigateUrl);
37
+ }}
38
+ >
39
+ <TreeItemIcon status={status} className={styles["test-result-history-item-status"]} />
40
+ <Text className={styles["test-result-history-item-text"]}>{convertedStop}</Text>
41
+ <div className={styles["test-result-history-item-info"]}>
42
+ <Text type="ui" size={"s"} className={styles["item-time"]}>
43
+ {formattedDuration}
44
+ </Text>
45
+ <TooltipWrapper tooltipText={t("openInNewTab")}>
46
+ <IconButton
47
+ icon={allureIcons.lineGeneralLinkExternal}
48
+ style={"ghost"}
49
+ size={"s"}
50
+ className={styles["test-result-history-item-link"]}
51
+ onClick={(e) => {
52
+ e.stopPropagation();
53
+ openInNewTab(navigateUrl);
54
+ }}
55
+ />
56
+ </TooltipWrapper>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ {isOpened && message && (
61
+ <div>
62
+ <TestResultError message={message} trace={trace} />
63
+ </div>
64
+ )}
65
+ </div>
66
+ );
67
+ };
@@ -0,0 +1,26 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import { TestResultHistoryItem } from "@/components/TestResult/TestResultHistory/TestResultHistoryItem";
3
+ import { useI18n } from "@/stores";
4
+ import { type AwesomeTestResult } from "../../../../types";
5
+ import * as styles from "./styles.scss";
6
+
7
+ export type TestResultHistoryViewProps = {
8
+ testResult?: AwesomeTestResult;
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,30 @@
1
+ import { SvgIcon, allureIcons } from "@allurereport/web-components";
2
+ import { type FunctionalComponent } from "preact";
3
+ import { useI18n } from "@/stores";
4
+ import { capitalize } from "@/utils/capitalize";
5
+ import * as styles from "./styles.scss";
6
+
7
+ const icons: Record<string, string> = {
8
+ flaky: allureIcons.lineIconBomb2,
9
+ known: allureIcons.lineAlertsAlertCircle,
10
+ muted: allureIcons.lineGeneralEye,
11
+ };
12
+
13
+ export const TestResultInfoStatuses: FunctionalComponent<{ statuses: [string, boolean][] }> = ({ statuses }) => {
14
+ const { t } = useI18n("filters");
15
+
16
+ return (
17
+ <div className={styles["test-result-info-statuses"]}>
18
+ {statuses.map(([status], key: number) => {
19
+ const title = t(status);
20
+
21
+ return (
22
+ <div key={key} className={styles["test-result-info-status"]}>
23
+ <SvgIcon className={styles["metadata-icon"]} id={icons[status]} size={"s"} />
24
+ {capitalize(title)}
25
+ </div>
26
+ );
27
+ })}
28
+ </div>
29
+ );
30
+ };
@@ -0,0 +1,79 @@
1
+ import { formatDuration } from "@allurereport/core-api";
2
+ import { Counter, Heading, Text, TooltipWrapper } from "@allurereport/web-components";
3
+ import type { FunctionalComponent } from "preact";
4
+ import type { AwesomeTestResult } from "types";
5
+ import { TestResultInfoStatuses } from "@/components/TestResult/TestResultInfo/TestResultInfoStatuses";
6
+ import { TestResultNavigation } from "@/components/TestResult/TestResultNavigation";
7
+ import { TestResultPrevStatuses } from "@/components/TestResult/TestResultPrevStatuses";
8
+ import { TestResultSeverity } from "@/components/TestResult/TestResultSeverity";
9
+ import { TestResultStatus } from "@/components/TestResult/TestResultStatus";
10
+ import { TestResultTab, TestResultTabsList } from "@/components/TestResult/TestResultTabs";
11
+ import { useI18n } from "@/stores/locale";
12
+ import { timestampToDate } from "@/utils/time";
13
+ import * as styles from "./styles.scss";
14
+
15
+ export type TestResultInfoProps = {
16
+ testResult?: AwesomeTestResult;
17
+ };
18
+
19
+ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testResult }) => {
20
+ const { name, status, muted, flaky, known, duration, labels, history, retries, attachments, stop } = testResult ?? {};
21
+ const formattedDuration = formatDuration(duration as number);
22
+ const fullDate = stop && timestampToDate(stop);
23
+ const severity = labels?.find((label) => label.name === "severity")?.value ?? "normal";
24
+ const { t } = useI18n("ui");
25
+ const statuses = Object.entries({ flaky, muted, known }).filter(([, value]) => value);
26
+
27
+ const Content = () => {
28
+ return (
29
+ <>
30
+ {name && (
31
+ <Heading data-testid="test-result-info-title" tag={"h1"} size={"s"} className={styles["test-result-name"]}>
32
+ {name}
33
+ </Heading>
34
+ )}
35
+ <div className={styles["test-result-info-data"]}>
36
+ {Boolean(status) && <TestResultStatus status={status} />}
37
+ {Boolean(history?.length) && <TestResultPrevStatuses history={history} />}
38
+ <TestResultSeverity severity={severity} />
39
+ {Boolean(statuses.length) && <TestResultInfoStatuses statuses={statuses} />}
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,50 @@
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
+ }
34
+
35
+ .test-result-info-statuses {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 8px;
39
+ }
40
+
41
+ .test-result-info-status {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: 2px;
45
+ }
46
+
47
+ .metadata-icon {
48
+ margin-right: 8px;
49
+ color: var(--on-icon-secondary);
50
+ }
@@ -0,0 +1,56 @@
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import type { FunctionalComponent } from "preact";
3
+ import { useState } from "preact/hooks";
4
+ import type { AwesomeTestResult } from "types";
5
+ import { MetadataButton } from "@/components/MetadataButton";
6
+ import { useI18n } from "@/stores/locale";
7
+ import * as styles from "./styles.scss";
8
+
9
+ interface TestResultLinkProps {
10
+ name: string;
11
+ url: string;
12
+ type: string;
13
+ }
14
+
15
+ const linksIconMap: Record<string, string> = {
16
+ issue: allureIcons.lineDevBug2,
17
+ link: allureIcons.lineGeneralLink1,
18
+ tms: allureIcons.lineGeneralChecklist3,
19
+ github: allureIcons.github,
20
+ };
21
+
22
+ const TestResultLink: FunctionalComponent<{
23
+ link: TestResultLinkProps;
24
+ }> = ({ link }) => {
25
+ const { url, type } = link;
26
+
27
+ return (
28
+ <div className={styles["test-result-link"]}>
29
+ <SvgIcon id={linksIconMap[type] ?? allureIcons.lineGeneralLink1} />
30
+ <Text tag={"a"} href={url} target={"_blank"} size={"m"} className={styles["test-result-link-text"]}>
31
+ {url}
32
+ </Text>
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export type TestResultLinksProps = {
38
+ links: AwesomeTestResult["links"];
39
+ };
40
+
41
+ export const TestResultLinks: FunctionalComponent<TestResultLinksProps> = ({ links }) => {
42
+ const [isOpened, setIsOpen] = useState(true);
43
+ const { t } = useI18n("ui");
44
+ const linkMap = links.map((link, index) => {
45
+ return <TestResultLink link={link as TestResultLinkProps} key={index} />;
46
+ });
47
+
48
+ return (
49
+ <div className={styles["test-result-links"]}>
50
+ <div className={styles["test-result-links-wrapper"]}>
51
+ <MetadataButton isOpened={isOpened} setIsOpen={setIsOpen} counter={links.length} title={t("links")} />
52
+ {isOpened && <div className={styles["test-result-links-list"]}>{linkMap}</div>}
53
+ </div>
54
+ </div>
55
+ );
56
+ };
@@ -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 type { FunctionalComponent } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import type { AwesomeTestResult } from "types";
4
+ import { TestResultMetadataList } from "@/components/Metadata";
5
+ import { MetadataButton } from "@/components/MetadataButton";
6
+ import { useI18n } from "@/stores/locale";
7
+ import * as styles from "./styles.scss";
8
+
9
+ export type TestResultMetadataProps = {
10
+ testResult?: AwesomeTestResult;
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,80 @@
1
+ import { Code, IconButton, Loadable, TooltipWrapper, allureIcons } from "@allurereport/web-components";
2
+ import type { FunctionalComponent } from "preact";
3
+ import type { AwesomeTestResult } from "types";
4
+ import { useI18n } from "@/stores";
5
+ import { testResultNavStore } from "@/stores/testResults";
6
+ import { copyToClipboard } from "@/utils/copyToClipboard";
7
+ import { navigateTo } from "@/utils/navigate";
8
+ import * as styles from "./styles.scss";
9
+
10
+ export type TestResultNavigationProps = {
11
+ testResult?: AwesomeTestResult;
12
+ };
13
+
14
+ export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps> = ({ testResult }) => {
15
+ const { fullName, id: testResultId } = testResult ?? {};
16
+ const id = testResultId || "";
17
+ const { t: tooltip } = useI18n("controls");
18
+ const FullName = () => {
19
+ return (
20
+ <div data-testid="test-result-fullname" className={styles["test-result-fullName"]}>
21
+ <TooltipWrapper tooltipText={tooltip("clipboard")} tooltipTextAfterClick={tooltip("clipboardSuccess")}>
22
+ <IconButton
23
+ data-testid="test-result-fullname-copy"
24
+ style={"ghost"}
25
+ size={"s"}
26
+ icon={allureIcons.lineGeneralCopy3}
27
+ onClick={() => copyToClipboard(fullName)}
28
+ />
29
+ </TooltipWrapper>
30
+ <Code tag={"div"} size={"s"} className={styles["test-result-fullName-text"]}>
31
+ {fullName && fullName}
32
+ </Code>
33
+ </div>
34
+ );
35
+ };
36
+
37
+ return (
38
+ <Loadable
39
+ source={testResultNavStore}
40
+ renderData={(data) => {
41
+ const currentIndex = data.indexOf(id) + 1;
42
+ return (
43
+ <div className={styles["test-result-nav"]}>
44
+ {fullName && <FullName />}
45
+ {data && !testResult?.hidden && (
46
+ <div className={styles["test-result-navigator"]}>
47
+ <TooltipWrapper tooltipText={tooltip("prevTR")} isTriggerActive={currentIndex > 1}>
48
+ <IconButton
49
+ icon={allureIcons.lineArrowsChevronDown}
50
+ style={"ghost"}
51
+ isDisabled={currentIndex === data.length}
52
+ data-testid="test-result-nav-prev"
53
+ className={styles["test-result-nav-prev"]}
54
+ onClick={() => navigateTo(data[currentIndex])}
55
+ />
56
+ </TooltipWrapper>
57
+ <Code
58
+ data-testid="test-result-nav-current"
59
+ size={"s"}
60
+ className={styles["test-result-navigator-numbers"]}
61
+ >
62
+ {currentIndex}/{data.length}
63
+ </Code>
64
+ <TooltipWrapper tooltipText={tooltip("nextTR")}>
65
+ <IconButton
66
+ icon={allureIcons.lineArrowsChevronDown}
67
+ style={"ghost"}
68
+ isDisabled={currentIndex <= 1}
69
+ data-testid="test-result-nav-next"
70
+ onClick={() => navigateTo(data[currentIndex - 2])}
71
+ />
72
+ </TooltipWrapper>
73
+ </div>
74
+ )}
75
+ </div>
76
+ );
77
+ }}
78
+ />
79
+ );
80
+ };
@@ -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-prev {
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 type { AwesomeTestResult } from "types";
3
+ import * as styles from "@/components/BaseLayout/styles.scss";
4
+ import { TestResultDescription } from "@/components/TestResult/TestResultDescription";
5
+ import { TestResultError } from "@/components/TestResult/TestResultError";
6
+ import { TestResultLinks } from "@/components/TestResult/TestResultLinks";
7
+ import { TestResultMetadata } from "@/components/TestResult/TestResultMetadata";
8
+ import { TestResultParameters } from "@/components/TestResult/TestResultParameters";
9
+ import { TestResultSetup } from "@/components/TestResult/TestResultSetup";
10
+ import { TestResultSteps } from "@/components/TestResult/TestResultSteps";
11
+ import { TestResultTeardown } from "@/components/TestResult/TestResultTeardown";
12
+
13
+ export type TestResultOverviewProps = {
14
+ testResult?: AwesomeTestResult;
15
+ };
16
+
17
+ export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> = ({ testResult }) => {
18
+ const { error, parameters, groupedLabels, links, description, setup, steps, teardown } = testResult || {};
19
+
20
+ return (
21
+ <>
22
+ {Boolean(error?.message) && (
23
+ <div className={styles["test-result-errors"]}>
24
+ <TestResultError {...error} />
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 type { FunctionalComponent } from "preact";
2
+ import { useState } from "preact/hooks";
3
+ import type { AwesomeTestResult } from "types";
4
+ import { MetadataList } from "@/components/Metadata";
5
+ import { MetadataButton } from "@/components/MetadataButton";
6
+ import { useI18n } from "@/stores/locale";
7
+ import * as styles from "./styles.scss";
8
+
9
+ export type TestResultParametersProps = {
10
+ parameters: AwesomeTestResult["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
+ }