@allurereport/web-awesome 3.0.0-beta.9 → 3.0.0

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 (279) hide show
  1. package/dist/multi/173.app-9931797d1602fc52db5b.js +1 -0
  2. package/dist/multi/174.app-9931797d1602fc52db5b.js +1 -0
  3. package/dist/multi/252.app-9931797d1602fc52db5b.js +1 -0
  4. package/dist/multi/282.app-9931797d1602fc52db5b.js +1 -0
  5. package/dist/multi/29.app-9931797d1602fc52db5b.js +1 -0
  6. package/dist/multi/416.app-9931797d1602fc52db5b.js +1 -0
  7. package/dist/multi/527.app-9931797d1602fc52db5b.js +1 -0
  8. package/dist/multi/600.app-9931797d1602fc52db5b.js +1 -0
  9. package/dist/multi/605.app-9931797d1602fc52db5b.js +1 -0
  10. package/dist/multi/638.app-9931797d1602fc52db5b.js +1 -0
  11. package/dist/multi/672.app-9931797d1602fc52db5b.js +1 -0
  12. package/dist/multi/686.app-9931797d1602fc52db5b.js +1 -0
  13. package/dist/multi/725.app-9931797d1602fc52db5b.js +1 -0
  14. package/dist/multi/741.app-9931797d1602fc52db5b.js +1 -0
  15. package/dist/multi/755.app-9931797d1602fc52db5b.js +1 -0
  16. package/dist/multi/894.app-9931797d1602fc52db5b.js +1 -0
  17. package/dist/multi/91.app-9931797d1602fc52db5b.js +1 -0
  18. package/dist/multi/943.app-9931797d1602fc52db5b.js +1 -0
  19. package/dist/multi/980.app-9931797d1602fc52db5b.js +1 -0
  20. package/dist/multi/app-9931797d1602fc52db5b.js +2 -0
  21. package/dist/multi/app-9931797d1602fc52db5b.js.LICENSE.txt +10 -0
  22. package/dist/multi/manifest.json +25 -24
  23. package/dist/multi/styles-8fe37354d1c2270c691e.css +48 -0
  24. package/dist/single/app-6199dc1c2fd3bddc2526.js +2 -0
  25. package/dist/single/app-6199dc1c2fd3bddc2526.js.LICENSE.txt +10 -0
  26. package/dist/single/manifest.json +1 -1
  27. package/package.json +29 -17
  28. package/src/assets/scss/day.scss +2 -0
  29. package/src/assets/scss/index.scss +1 -3
  30. package/src/assets/scss/night.scss +2 -0
  31. package/src/assets/scss/palette.scss +391 -391
  32. package/src/assets/scss/theme.scss +292 -79
  33. package/src/components/BaseLayout/index.tsx +10 -32
  34. package/src/components/BaseLayout/styles.scss +14 -4
  35. package/src/components/Charts/index.tsx +245 -0
  36. package/src/components/Charts/styles.scss +27 -0
  37. package/src/components/EnvironmentPicker/index.tsx +60 -0
  38. package/src/components/EnvironmentPicker/styles.scss +9 -0
  39. package/src/components/Footer/FooterLogo.tsx +1 -2
  40. package/src/components/Footer/FooterVersion.tsx +7 -3
  41. package/src/components/Footer/index.tsx +6 -2
  42. package/src/components/Header/CiInfo/index.tsx +67 -0
  43. package/src/components/Header/CiInfo/styles.scss +7 -0
  44. package/src/components/Header/index.tsx +21 -8
  45. package/src/components/Header/styles.scss +9 -1
  46. package/src/components/HeaderControls/index.tsx +20 -0
  47. package/src/components/MainReport/index.tsx +84 -6
  48. package/src/components/MainReport/styles.scss +20 -0
  49. package/src/components/Metadata/index.tsx +6 -4
  50. package/src/components/MetadataButton/index.tsx +14 -6
  51. package/src/components/MetadataButton/styles.scss +3 -0
  52. package/src/components/Modal/index.tsx +15 -167
  53. package/src/components/NavTabs/index.tsx +70 -0
  54. package/src/components/{TestResult/TestResultTabs → NavTabs}/styles.scss +0 -3
  55. package/src/components/Report/index.tsx +7 -0
  56. package/src/components/ReportBody/Filters.tsx +45 -64
  57. package/src/components/ReportBody/index.tsx +26 -15
  58. package/src/components/ReportBody/styles.scss +9 -3
  59. package/src/components/ReportGlobalAttachments/index.tsx +34 -0
  60. package/src/components/ReportGlobalAttachments/styles.scss +11 -0
  61. package/src/components/ReportGlobalErrors/index.tsx +30 -0
  62. package/src/components/ReportGlobalErrors/styles.scss +12 -0
  63. package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
  64. package/src/components/ReportHeader/ReportHeaderPie.tsx +1 -2
  65. package/src/components/ReportHeader/index.tsx +38 -12
  66. package/src/components/ReportHeader/styles.scss +9 -1
  67. package/src/components/ReportMetadata/MetadataSummary.tsx +57 -65
  68. package/src/components/ReportMetadata/MetadataWithIcon.tsx +11 -13
  69. package/src/components/ReportMetadata/index.tsx +50 -3
  70. package/src/components/ReportMetadata/styles.scss +0 -2
  71. package/src/components/ReportQualityGateResults/index.tsx +42 -0
  72. package/src/components/ReportQualityGateResults/styles.scss +44 -0
  73. package/src/components/SectionPicker/index.tsx +55 -0
  74. package/src/components/SectionPicker/styles.scss +5 -0
  75. package/src/components/SectionSwitcher/index.tsx +16 -0
  76. package/src/components/SectionSwitcher/styles.scss +4 -0
  77. package/src/components/SectionTabs/index.tsx +0 -0
  78. package/src/components/SideBySide/index.tsx +52 -0
  79. package/src/components/SideBySide/styles.scss +64 -0
  80. package/src/components/SplitLayout/index.tsx +73 -0
  81. package/src/components/SplitLayout/styles.scss +84 -0
  82. package/src/components/Tabs/index.tsx +2 -2
  83. package/src/components/TestResult/TestStepsEmpty/index.tsx +2 -2
  84. package/src/components/TestResult/TrAttachmentsView/index.tsx +29 -0
  85. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +5 -5
  86. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +7 -5
  87. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +6 -6
  88. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  89. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  90. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  91. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  92. package/src/components/TestResult/TrError/TrDiff.tsx +121 -0
  93. package/src/components/TestResult/TrError/index.tsx +104 -0
  94. package/src/components/TestResult/TrError/styles.scss +223 -0
  95. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +44 -0
  96. package/src/components/TestResult/TrHeader/index.tsx +15 -0
  97. package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +7 -2
  98. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +94 -0
  99. package/src/components/TestResult/TrHistory/index.tsx +26 -0
  100. package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +2 -1
  101. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +6 -4
  102. package/src/components/TestResult/TrInfo/index.tsx +99 -0
  103. package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +18 -0
  104. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +8 -8
  105. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +6 -6
  106. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +7 -9
  107. package/src/components/TestResult/TrOverview.tsx +46 -0
  108. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +4 -4
  109. package/src/components/TestResult/TrPrevStatuses/index.tsx +63 -0
  110. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  111. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +32 -0
  112. package/src/components/TestResult/TrPwTraces/index.tsx +32 -0
  113. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  114. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +70 -0
  115. package/src/components/TestResult/TrRetriesView/index.tsx +29 -0
  116. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +13 -13
  117. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +2 -2
  118. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +5 -5
  119. package/src/components/TestResult/TrSteps/TrAttachment.tsx +118 -0
  120. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +11 -11
  121. package/src/components/TestResult/TrSteps/TrStep.tsx +98 -0
  122. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +90 -0
  123. package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +12 -12
  124. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +49 -10
  125. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  126. package/src/components/TestResult/TrTabs/index.tsx +42 -0
  127. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +13 -13
  128. package/src/components/TestResult/index.tsx +54 -38
  129. package/src/components/TestResult/styles.scss +12 -0
  130. package/src/components/Timeline/index.tsx +100 -0
  131. package/src/components/Timeline/styles.scss +45 -0
  132. package/src/components/ToggleLayout/index.tsx +17 -0
  133. package/src/components/Tree/index.tsx +123 -9
  134. package/src/components/Tree/styles.scss +23 -5
  135. package/src/index.html +22 -6
  136. package/src/index.tsx +91 -20
  137. package/src/locales/az.json +376 -0
  138. package/src/locales/de.json +376 -0
  139. package/src/locales/en.json +376 -0
  140. package/src/locales/es.json +376 -0
  141. package/src/locales/fr.json +376 -0
  142. package/src/locales/he.json +376 -0
  143. package/src/locales/hy.json +376 -0
  144. package/src/locales/it.json +376 -0
  145. package/src/locales/ja.json +376 -0
  146. package/src/locales/ka.json +376 -0
  147. package/src/locales/kr.json +376 -0
  148. package/src/locales/nl.json +376 -0
  149. package/src/locales/pl.json +384 -0
  150. package/src/locales/pt.json +376 -0
  151. package/src/locales/ru.json +384 -0
  152. package/src/locales/sv.json +376 -0
  153. package/src/locales/tr.json +376 -0
  154. package/src/locales/ua.json +327 -0
  155. package/src/locales/zh.json +376 -0
  156. package/src/stores/chart.ts +41 -6
  157. package/src/stores/env.ts +88 -0
  158. package/src/stores/envInfo.ts +2 -2
  159. package/src/stores/globals.ts +28 -0
  160. package/src/stores/layout.ts +36 -0
  161. package/src/stores/locale.ts +77 -29
  162. package/src/stores/modal.ts +22 -0
  163. package/src/stores/qualityGate.ts +28 -0
  164. package/src/stores/router.ts +108 -0
  165. package/src/stores/sections.ts +63 -0
  166. package/src/stores/stats.ts +52 -7
  167. package/src/stores/testResults.ts +13 -9
  168. package/src/stores/theme.ts +15 -18
  169. package/src/stores/timeline.ts +39 -0
  170. package/src/stores/tree.ts +61 -22
  171. package/src/stores/variables.ts +40 -0
  172. package/src/styles.scss +66 -0
  173. package/src/utils/time.ts +1 -0
  174. package/src/utils/tree.ts +23 -0
  175. package/src/utils/treeFilters.ts +27 -21
  176. package/test/components/Header/CiInfo.test.tsx +177 -0
  177. package/test/components/Header.test.tsx +122 -0
  178. package/test/utils/treeFilters.test.ts +44 -44
  179. package/tsconfig.json +7 -2
  180. package/tsconfig.node.json +8 -0
  181. package/types.d.ts +43 -24
  182. package/vitest.config.ts +15 -2
  183. package/vitest.setup.ts +1 -0
  184. package/webpack.config.js +35 -5
  185. package/dist/multi/141.app-f32e4213.js +0 -1
  186. package/dist/multi/222.app-f32e4213.js +0 -1
  187. package/dist/multi/335.app-f32e4213.js +0 -1
  188. package/dist/multi/34.app-f32e4213.js +0 -1
  189. package/dist/multi/349.app-f32e4213.js +0 -1
  190. package/dist/multi/378.app-f32e4213.js +0 -1
  191. package/dist/multi/406.app-f32e4213.js +0 -1
  192. package/dist/multi/476.app-f32e4213.js +0 -1
  193. package/dist/multi/53.app-f32e4213.js +0 -1
  194. package/dist/multi/584.app-f32e4213.js +0 -1
  195. package/dist/multi/690.app-f32e4213.js +0 -1
  196. package/dist/multi/747.app-f32e4213.js +0 -1
  197. package/dist/multi/767.app-f32e4213.js +0 -1
  198. package/dist/multi/816.app-f32e4213.js +0 -1
  199. package/dist/multi/83.app-f32e4213.js +0 -1
  200. package/dist/multi/873.app-f32e4213.js +0 -1
  201. package/dist/multi/920.app-f32e4213.js +0 -1
  202. package/dist/multi/991.app-f32e4213.js +0 -1
  203. package/dist/multi/app-f32e4213.js +0 -2
  204. package/dist/multi/app-f32e4213.js.LICENSE.txt +0 -16
  205. package/dist/multi/styles-f32e4213.css +0 -284
  206. package/dist/single/app-7fa8e43f.js +0 -2
  207. package/dist/single/app-7fa8e43f.js.LICENSE.txt +0 -16
  208. package/src/assets/scss/code.scss +0 -71
  209. package/src/assets/scss/typography.scss +0 -218
  210. package/src/components/ArrowButton/index.tsx +0 -36
  211. package/src/components/ArrowButton/styles.scss +0 -35
  212. package/src/components/LanguagePicker/index.tsx +0 -40
  213. package/src/components/Modal/styles.scss +0 -126
  214. package/src/components/ReportLogo/index.tsx +0 -16
  215. package/src/components/ReportLogo/styles.scss +0 -20
  216. package/src/components/ReportLogoFull/index.tsx +0 -20
  217. package/src/components/ReportLogoFull/styles.scss +0 -7
  218. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +0 -27
  219. package/src/components/TestResult/TestResultError/index.tsx +0 -59
  220. package/src/components/TestResult/TestResultError/styles.scss +0 -51
  221. package/src/components/TestResult/TestResultHeader/index.tsx +0 -55
  222. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +0 -67
  223. package/src/components/TestResult/TestResultHistory/index.tsx +0 -26
  224. package/src/components/TestResult/TestResultInfo/index.tsx +0 -79
  225. package/src/components/TestResult/TestResultOverview.tsx +0 -43
  226. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +0 -49
  227. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -52
  228. package/src/components/TestResult/TestResultRetriesView/index.tsx +0 -24
  229. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +0 -12
  230. package/src/components/TestResult/TestResultSteps/attachment.tsx +0 -68
  231. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +0 -20
  232. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +0 -32
  233. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +0 -15
  234. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +0 -77
  235. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +0 -85
  236. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -30
  237. package/src/components/TestResult/TestResultTabs/index.tsx +0 -59
  238. package/src/components/ThemeButton/ThemeButton.tsx +0 -20
  239. package/src/components/Tree/Tree.tsx +0 -75
  240. package/src/components/Tree/TreeHeader.tsx +0 -82
  241. package/src/components/Tree/TreeItem.tsx +0 -35
  242. package/src/components/Tree/TreeItemIcon.tsx +0 -32
  243. package/src/i18n/constants.ts +0 -124
  244. package/src/i18n/locales/am.json +0 -120
  245. package/src/i18n/locales/az.json +0 -120
  246. package/src/i18n/locales/de.json +0 -120
  247. package/src/i18n/locales/en.json +0 -121
  248. package/src/i18n/locales/es.json +0 -120
  249. package/src/i18n/locales/fr.json +0 -120
  250. package/src/i18n/locales/he.json +0 -120
  251. package/src/i18n/locales/it.json +0 -120
  252. package/src/i18n/locales/ja.json +0 -120
  253. package/src/i18n/locales/ka.json +0 -120
  254. package/src/i18n/locales/kr.json +0 -120
  255. package/src/i18n/locales/nl.json +0 -120
  256. package/src/i18n/locales/pl.json +0 -118
  257. package/src/i18n/locales/pt.json +0 -120
  258. package/src/i18n/locales/ru.json +0 -118
  259. package/src/i18n/locales/sv.json +0 -120
  260. package/src/i18n/locales/tr.json +0 -120
  261. package/src/i18n/locales/zh.json +0 -120
  262. package/src/utils/attachments.ts +0 -156
  263. package/src/utils/capitalize.ts +0 -6
  264. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  265. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  266. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  267. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
  268. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  269. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  270. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  271. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  272. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  273. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  274. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  275. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  276. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  277. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  278. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  279. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
@@ -0,0 +1,42 @@
1
+ import { type ComponentChildren } from "preact";
2
+ import { useEffect } from "preact/hooks";
3
+ import { NavTab, NavTabs, NavTabsList, useNavTabsContext } from "@/components/NavTabs";
4
+ import { activeSubTab, navigateTo, route } from "@/stores/router";
5
+
6
+ export const TrTabs = NavTabs;
7
+ export const TrTabsList = NavTabsList;
8
+ export const useTestResultTabsContext = useNavTabsContext;
9
+
10
+ export const TrTab = (props: { id: string; children: ComponentChildren }) => {
11
+ const { testResultId } = route.value.params;
12
+ const { currentTab, setCurrentTab } = useNavTabsContext();
13
+ const { id, children } = props;
14
+ const isActiveFromUrl = activeSubTab.value === id;
15
+ const handleTabClick = () => {
16
+ const isCurrentTab = isActiveFromUrl ? isActiveFromUrl : currentTab === id;
17
+ if (isCurrentTab) {
18
+ return;
19
+ }
20
+ setCurrentTab(id);
21
+ navigateTo({
22
+ ...route.value,
23
+ params: {
24
+ testResultId,
25
+ subTab: id || null,
26
+ },
27
+ });
28
+ };
29
+ const isCurrentTab = isActiveFromUrl ? isActiveFromUrl : currentTab === id;
30
+
31
+ useEffect(() => {
32
+ if (isActiveFromUrl) {
33
+ setCurrentTab(id);
34
+ }
35
+ }, [activeSubTab.value, id, setCurrentTab]);
36
+
37
+ return (
38
+ <NavTab id={id} onClick={handleTabClick} data-testid={`test-result-tab-${id}`} isCurrentTab={isCurrentTab}>
39
+ {children}
40
+ </NavTab>
41
+ );
42
+ };
@@ -1,27 +1,27 @@
1
1
  import { allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
- import type { AllureAwesomeTestResult } from "types";
5
- import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
6
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
7
- import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
8
- import { TestResultStep } from "@/components/TestResult/TestResultSteps/testResultStep";
4
+ import type { AwesomeTestResult } from "types";
5
+ import { TrDropdown } from "@/components/TestResult/TrDropdown";
6
+ import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
7
+ import { TrStep } from "@/components/TestResult/TrSteps/TrStep";
8
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
9
9
  import { useI18n } from "@/stores/locale";
10
10
  import { collapsedTrees, toggleTree } from "@/stores/tree";
11
11
 
12
12
  const typeMap = {
13
- before: TestResultStep,
14
- after: TestResultStep,
15
- step: TestResultStep,
16
- attachment: TestResultAttachment,
13
+ before: TrStep,
14
+ after: TrStep,
15
+ step: TrStep,
16
+ attachment: TrAttachment,
17
17
  };
18
18
 
19
- export type TestResultTeardownProps = {
20
- teardown: AllureAwesomeTestResult["teardown"];
19
+ export type TrTeardownProps = {
20
+ teardown: AwesomeTestResult["teardown"];
21
21
  id: string;
22
22
  };
23
23
 
24
- export const TestResultTeardown: FunctionalComponent<TestResultTeardownProps> = ({ teardown, id }) => {
24
+ export const TrTeardown: FunctionalComponent<TrTeardownProps> = ({ teardown, id }) => {
25
25
  const teardownId = `${id}-teardown`;
26
26
  const isEarlyCollapsed = !collapsedTrees.value.has(teardownId);
27
27
  const [isOpened, setIsOpen] = useState<boolean>(isEarlyCollapsed);
@@ -35,7 +35,7 @@ export const TestResultTeardown: FunctionalComponent<TestResultTeardownProps> =
35
35
 
36
36
  return (
37
37
  <div className={styles["test-result-steps"]}>
38
- <TestResultDropdown
38
+ <TrDropdown
39
39
  icon={allureIcons.lineHelpersFlag}
40
40
  isOpened={isOpened}
41
41
  setIsOpen={handleClick}
@@ -1,56 +1,72 @@
1
+ import clsx from "clsx";
1
2
  import type { FunctionComponent, FunctionalComponent } from "preact";
2
- import type { AllureAwesomeTestResult } from "types";
3
- import * as styles from "@/components/BaseLayout/styles.scss";
4
- import { TestResultAttachmentView } from "@/components/TestResult/TestResultAttachmentsView";
5
- import TestResultEmpty from "@/components/TestResult/TestResultEmpty";
6
- import { TestResultHeader } from "@/components/TestResult/TestResultHeader";
7
- import TestResultHistoryView from "@/components/TestResult/TestResultHistory";
8
- import { TestResultInfo } from "@/components/TestResult/TestResultInfo";
9
- import { TestResultOverview } from "@/components/TestResult/TestResultOverview";
10
- import { TestResultRetriesView } from "@/components/TestResult/TestResultRetriesView";
11
- import { TestResultTabs, useTestResultTabsContext } from "@/components/TestResult/TestResultTabs";
12
-
13
- export type TestResultViewProps = {
14
- testResult?: AllureAwesomeTestResult;
3
+ import { useEffect } from "preact/hooks";
4
+ import type { AwesomeTestResult } from "types";
5
+ import { TrAttachmentView } from "@/components/TestResult/TrAttachmentsView";
6
+ import TrEmpty from "@/components/TestResult/TrEmpty";
7
+ import { TrEnvironmentsView } from "@/components/TestResult/TrEnvironmentsView";
8
+ import TrHistoryView from "@/components/TestResult/TrHistory";
9
+ import { TrInfo } from "@/components/TestResult/TrInfo";
10
+ import { TrOverview } from "@/components/TestResult/TrOverview";
11
+ import { TrRetriesView } from "@/components/TestResult/TrRetriesView";
12
+ import { TrTabs, useTestResultTabsContext } from "@/components/TestResult/TrTabs";
13
+ import { fetchTestEnvGroup } from "@/stores/env";
14
+ import { isSplitMode } from "@/stores/layout";
15
+ import * as styles from "./styles.scss";
16
+
17
+ export type TrViewProps = {
18
+ testResult?: AwesomeTestResult;
19
+ };
20
+
21
+ export type TrContentProps = {
22
+ testResult?: AwesomeTestResult;
15
23
  };
16
24
 
17
- const TestResultView: FunctionalComponent<TestResultViewProps> = ({ testResult }) => {
25
+ export type TrProps = {
26
+ testResult?: AwesomeTestResult;
27
+ };
28
+
29
+ const TrView: FunctionalComponent<TrViewProps> = ({ testResult }) => {
18
30
  const { currentTab } = useTestResultTabsContext();
19
31
  const viewMap: Record<string, any> = {
20
- overview: TestResultOverview,
21
- history: TestResultHistoryView,
22
- attachments: TestResultAttachmentView,
23
- retries: TestResultRetriesView,
32
+ overview: TrOverview,
33
+ history: TrHistoryView,
34
+ attachments: TrAttachmentView,
35
+ retries: TrRetriesView,
36
+ environments: TrEnvironmentsView,
24
37
  };
25
38
  const ViewComponent = viewMap[currentTab];
26
39
 
27
40
  return <ViewComponent testResult={testResult} />;
28
41
  };
29
42
 
30
- export type TestResultContentProps = {
31
- testResult?: AllureAwesomeTestResult;
32
- };
33
-
34
- const TestResultContent: FunctionalComponent<TestResultContentProps> = ({ testResult }) => {
43
+ const TrContent: FunctionalComponent<TrContentProps> = ({ testResult }) => {
35
44
  return (
36
- <TestResultTabs initialTab="overview">
37
- <TestResultInfo testResult={testResult} />
38
- <TestResultView testResult={testResult} />
39
- </TestResultTabs>
45
+ <TrTabs initialTab="overview">
46
+ <TrInfo testResult={testResult} />
47
+ <TrView testResult={testResult} />
48
+ </TrTabs>
40
49
  );
41
50
  };
42
51
 
43
- export type TestResultProps = {
44
- testResult?: AllureAwesomeTestResult;
45
- };
52
+ const TestResult: FunctionComponent<TrProps> = ({ testResult }) => {
53
+ const splitModeClass = isSplitMode.value ? styles["scroll-inside"] : "";
54
+
55
+ useEffect(() => {
56
+ const testCaseId = testResult?.testCase?.id;
57
+
58
+ if (testCaseId) {
59
+ fetchTestEnvGroup(testCaseId);
60
+ }
61
+ }, [testResult]);
46
62
 
47
- const TestResult: FunctionComponent<TestResultProps> = ({ testResult }) => (
48
- <>
49
- <TestResultHeader testResult={testResult} />
50
- <div className={styles.content}>
51
- {testResult ? <TestResultContent testResult={testResult} /> : <TestResultEmpty />}
52
- </div>
53
- </>
54
- );
63
+ return (
64
+ <>
65
+ <div className={clsx(styles.content, splitModeClass)}>
66
+ {testResult ? <TrContent testResult={testResult} /> : <TrEmpty />}
67
+ </div>
68
+ </>
69
+ );
70
+ };
55
71
 
56
72
  export default TestResult;
@@ -0,0 +1,12 @@
1
+ .content {
2
+ box-shadow: var(--shadow-small);
3
+ background: var(--bg-base-primary);
4
+ border-radius: 12px;
5
+ width: 100%;
6
+ }
7
+
8
+ .scroll-inside {
9
+ overflow: auto;
10
+ height: 100%;
11
+ border-radius: 0;
12
+ }
@@ -0,0 +1,100 @@
1
+ import { Timeline as AllureTimeline, Grid, GridItem, Loadable, PageLoader, Widget } from "@allurereport/web-components";
2
+ import { computed } from "@preact/signals";
3
+ import { useEffect, useMemo } from "preact/hooks";
4
+ import { useI18n } from "@/stores";
5
+ import { currentEnvironment } from "@/stores/env";
6
+ import type { TimlineTr } from "@/stores/timeline";
7
+ import { fetchTimelineData, timelineStore } from "@/stores/timeline";
8
+ import * as styles from "./styles.scss";
9
+
10
+ const getHosts = (tests: TimlineTr[]) => [
11
+ ...new Set(tests.map((test) => test.labels.find((label) => label.name === "host")?.value).filter(Boolean)),
12
+ ];
13
+
14
+ const filterTestsByHost = (tests: TimlineTr[], host: string) =>
15
+ tests.filter((test) => test.labels.find((label) => label.name === "host")?.value === host);
16
+
17
+ const currentTimelineData = computed(() => {
18
+ const tests = timelineStore.value.data ?? [];
19
+ if (!tests.length) {
20
+ return [];
21
+ }
22
+
23
+ if (currentEnvironment.value) {
24
+ const testsToEnv = tests.filter((test) => test.environment === currentEnvironment.value);
25
+ const hostsByEnv = getHosts(testsToEnv);
26
+
27
+ return hostsByEnv.map((host) => ({
28
+ data: filterTestsByHost(testsToEnv, host),
29
+ host,
30
+ }));
31
+ }
32
+
33
+ const hosts = getHosts(tests);
34
+
35
+ return hosts.map((host) => ({
36
+ data: filterTestsByHost(tests, host),
37
+ host,
38
+ }));
39
+ });
40
+
41
+ export const Timeline = () => {
42
+ const { t } = useI18n("timeline");
43
+
44
+ useEffect(() => {
45
+ fetchTimelineData();
46
+ }, []);
47
+
48
+ const translations = useMemo(
49
+ () => ({
50
+ empty: t("empty"),
51
+ selected: (props: { count: number; percentage: string; minDuration: string; maxDuration: string }) =>
52
+ t("selected", {
53
+ count: props.count,
54
+ percentage: props.percentage,
55
+ minDuration: props.minDuration,
56
+ maxDuration: props.maxDuration,
57
+ }),
58
+ }),
59
+ [t],
60
+ );
61
+
62
+ return (
63
+ <Loadable
64
+ source={timelineStore}
65
+ renderLoader={() => <PageLoader />}
66
+ renderData={() => {
67
+ if (currentTimelineData.value.length === 0) {
68
+ return (
69
+ <div className={styles.overview}>
70
+ <Grid kind="swap" className={styles["overview-grid"]}>
71
+ <GridItem className={styles["overview-grid-item"]}>
72
+ <Widget>
73
+ <div className={styles.empty}>{t("empty")}</div>
74
+ </Widget>
75
+ </GridItem>
76
+ </Grid>
77
+ </div>
78
+ );
79
+ }
80
+
81
+ return (
82
+ <div className={styles.overview}>
83
+ <Grid kind="swap" className={styles["overview-grid"]}>
84
+ {currentTimelineData.value.map(({ data, host }) => (
85
+ <GridItem key={host} className={styles["overview-grid-item"]}>
86
+ <Widget title={t("host", { host })}>
87
+ {data.length > 0 && (
88
+ <AllureTimeline data={data} dataId={host} width={100} translations={translations} />
89
+ )}
90
+ {data.length === 0 && <div className={styles.empty}>{t("empty_host", { host })}</div>}
91
+ </Widget>
92
+ </GridItem>
93
+ ))}
94
+ </Grid>
95
+ </div>
96
+ );
97
+ }}
98
+ />
99
+ );
100
+ };
@@ -0,0 +1,45 @@
1
+ .overview {
2
+ padding: 0 24px;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow-y: auto;
6
+
7
+ --timeline-font-family: var(--font-family);
8
+ --timeline-grid: var(--on-border-control);
9
+ --timeline-border-primary: var(--on-border-primary);
10
+ --timeline-axis-text: var(--on-text-secondary);
11
+ --timeline-bg: var(--bg-base-primary);
12
+ --timeline-selection-bg: var(--bg-control-flat-medium);
13
+ }
14
+
15
+ .overview-grid {
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 12px;
19
+ }
20
+
21
+ .overview-grid-item {
22
+ padding: 4px;
23
+ width: 100%;
24
+ }
25
+
26
+ .overview-grid-item-pie-chart-wrapper {
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ width: 100%;
31
+ height: 100%;
32
+ }
33
+
34
+ .overview-grid-item-pie-chart-wrapper-squeezer {
35
+ width: 50%;
36
+ }
37
+
38
+ .empty {
39
+ display: flex;
40
+ justify-content: center;
41
+ align-items: center;
42
+ width: 100%;
43
+ min-height: 320px;
44
+ color: var(--on-text-hint);
45
+ }
@@ -0,0 +1,17 @@
1
+ import { IconButton, allureIcons } from "@allurereport/web-components";
2
+ import { isSplitMode, toggleLayout } from "@/stores/layout";
3
+
4
+ const ToggleLayout = () => {
5
+ const icon = isSplitMode.value ? allureIcons.lineLayoutsLayoutTop : allureIcons.lineLayoutsColumn2;
6
+ return (
7
+ <IconButton
8
+ data-testId={"toggle-layout-button"}
9
+ size={"s"}
10
+ icon={icon}
11
+ style={"ghost"}
12
+ onClick={() => toggleLayout()}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default ToggleLayout;
@@ -1,23 +1,47 @@
1
- import { Button, Loadable, PageLoader, Text } from "@allurereport/web-components";
2
- import type { AllureAwesomeStatus } from "types";
1
+ import { Button, Loadable, PageLoader, Text, Tree, TreeStatusBar } from "@allurereport/web-components";
2
+ import { useMemo } from "preact/hooks";
3
+ import type { AwesomeStatus } from "types";
4
+ import { MetadataButton } from "@/components/MetadataButton";
3
5
  import { useTabsContext } from "@/components/Tabs";
4
- import Tree from "@/components/Tree/Tree";
6
+ import { reportStatsStore, statsByEnvStore } from "@/stores";
7
+ import { collapsedEnvironments, currentEnvironment, environmentsStore } from "@/stores/env";
5
8
  import { useI18n } from "@/stores/locale";
6
- import { clearTreeFilters, filteredTree, noTests, noTestsFound, treeStore } from "@/stores/tree";
9
+ import { navigateTo, route } from "@/stores/router";
10
+ import {
11
+ clearTreeFilters,
12
+ collapsedTrees,
13
+ filteredTree,
14
+ noTests,
15
+ noTestsFound,
16
+ toggleTree,
17
+ treeStore,
18
+ } from "@/stores/tree";
19
+ import { createTreeLocalizer } from "@/utils/tree";
7
20
  import * as styles from "./styles.scss";
8
21
 
9
22
  export const TreeList = () => {
10
23
  const { t } = useI18n("empty");
24
+ const { t: tEnvironments } = useI18n("environments");
25
+ const { t: tooltip } = useI18n("transitions");
11
26
  const { currentTab } = useTabsContext();
27
+ const routeId = route.value.params?.testResultId;
28
+
29
+ const localizers = useMemo(
30
+ () => ({
31
+ tooltip: (key: string) => t(`description.${key}`),
32
+ }),
33
+ [tooltip],
34
+ );
12
35
 
13
36
  return (
14
37
  <Loadable
15
38
  source={treeStore}
16
39
  renderLoader={() => <PageLoader />}
17
40
  renderData={() => {
41
+ // TODO: use function instead of computed
18
42
  if (noTests.value) {
19
43
  return (
20
- <div className={styles["tree-list"]}>
44
+ <div>
21
45
  <div className={styles["tree-empty-results"]}>
22
46
  <Text className={styles["tree-empty-results-title"]}>{t("no-results")}</Text>
23
47
  </div>
@@ -27,7 +51,7 @@ export const TreeList = () => {
27
51
 
28
52
  if (noTestsFound.value) {
29
53
  return (
30
- <div className={styles["tree-list"]}>
54
+ <div>
31
55
  <div className={styles["tree-empty-results"]}>
32
56
  <Text tag="p" className={styles["tree-empty-results-title"]}>
33
57
  {t("no-tests-found")}
@@ -45,10 +69,100 @@ export const TreeList = () => {
45
69
  );
46
70
  }
47
71
 
72
+ const treeLocalizer = createTreeLocalizer(localizers);
73
+
74
+ // render single tree for single environment
75
+ if (environmentsStore.value.data.length === 1) {
76
+ return (
77
+ <div>
78
+ <Tree
79
+ reportStatistic={reportStatsStore.value.data}
80
+ statistic={statsByEnvStore.value.data[currentEnvironment.value]}
81
+ collapsedTrees={collapsedTrees.value}
82
+ toggleTree={toggleTree}
83
+ navigateTo={navigateTo}
84
+ tree={treeLocalizer(filteredTree.value.default)}
85
+ statusFilter={currentTab as AwesomeStatus}
86
+ routeId={routeId}
87
+ root
88
+ />
89
+ </div>
90
+ );
91
+ }
92
+
93
+ const currentTree = currentEnvironment.value ? filteredTree.value[currentEnvironment.value] : undefined;
94
+
95
+ if (currentTree) {
96
+ return (
97
+ <div>
98
+ <Tree
99
+ reportStatistic={reportStatsStore.value.data}
100
+ statistic={statsByEnvStore.value.data[currentEnvironment.value]}
101
+ collapsedTrees={collapsedTrees.value}
102
+ toggleTree={toggleTree}
103
+ navigateTo={navigateTo}
104
+ tree={treeLocalizer(currentTree)}
105
+ statusFilter={currentTab as AwesomeStatus}
106
+ routeId={routeId}
107
+ root
108
+ />
109
+ </div>
110
+ );
111
+ }
112
+
113
+ // render tree section for every environment
48
114
  return (
49
- <div className={styles["tree-list"]}>
50
- <Tree tree={filteredTree.value} statusFilter={currentTab as AllureAwesomeStatus} root />
51
- </div>
115
+ <>
116
+ {Object.entries(filteredTree.value).map(([key, value]) => {
117
+ const { total } = value.statistic;
118
+
119
+ if (total === 0) {
120
+ return null;
121
+ }
122
+
123
+ const isOpened = !collapsedEnvironments.value.includes(key);
124
+ const toggleEnv = () => {
125
+ collapsedEnvironments.value = isOpened
126
+ ? collapsedEnvironments.value.concat(key)
127
+ : collapsedEnvironments.value.filter((env) => env !== key);
128
+ };
129
+ const stats = statsByEnvStore.value.data[key];
130
+
131
+ return (
132
+ <div key={key} className={styles["tree-section"]} data-testid={"tree-section"}>
133
+ <div className={styles["tree-env-button"]}>
134
+ <MetadataButton
135
+ isOpened={isOpened}
136
+ setIsOpen={toggleEnv}
137
+ title={`${tEnvironments("environment", { count: 1 })}: "${key}"`}
138
+ counter={total}
139
+ data-testid={"tree-section-env-button"}
140
+ />
141
+ <TreeStatusBar
142
+ statistic={stats}
143
+ reportStatistic={reportStatsStore.value.data}
144
+ statusFilter={currentTab}
145
+ />
146
+ </div>
147
+ {isOpened && (
148
+ <div data-testid={"tree-section-env-content"}>
149
+ <Tree
150
+ statistic={statsByEnvStore.value.data[key]}
151
+ reportStatistic={reportStatsStore.value.data}
152
+ collapsedTrees={collapsedTrees.value}
153
+ toggleTree={toggleTree}
154
+ statusFilter={currentTab}
155
+ navigateTo={navigateTo}
156
+ tree={treeLocalizer(value)}
157
+ routeId={routeId}
158
+ root
159
+ />
160
+ </div>
161
+ )}
162
+ </div>
163
+ );
164
+ })}
165
+ </>
52
166
  );
53
167
  }}
54
168
  />
@@ -6,10 +6,6 @@
6
6
  }
7
7
  }
8
8
 
9
- .tree-list {
10
- min-height: 128px;
11
- }
12
-
13
9
  .tree-header {
14
10
  display: flex;
15
11
  align-items: center;
@@ -178,5 +174,27 @@
178
174
  box-sizing: content-box;
179
175
  padding-top: 2px;
180
176
  line-height: 16px;
181
- width: 24px;
177
+ }
178
+
179
+ .tree-item-marked {
180
+ background: var(--bg-base-secondary);
181
+ }
182
+
183
+ .tree-item-marked {
184
+ background: var(--bg-base-secondary);
185
+ }
186
+
187
+ .tree-section {
188
+ &:not(:last-child) {
189
+ padding-bottom: 8px;
190
+ margin-bottom: 14px;
191
+ border-bottom: 1px solid var(--on-border-muted);
192
+ }
193
+ }
194
+
195
+ .tree-env-button {
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: space-between;
199
+ padding: 0 8px 0 6px;
182
200
  }
package/src/index.html CHANGED
@@ -22,12 +22,28 @@
22
22
  </script>
23
23
  <script>
24
24
  window.allureReportOptions = {
25
- reportName: "Allure Report (Dev)",
26
- logo: "/data/logo.jpg",
27
- theme: "light",
28
- reportLanguage: "ru",
29
- createdAt: 1731513697651,
30
- groupBy: "suite",
25
+ "reportName": "Allure Report",
26
+ "logo": "",
27
+ "theme": "light",
28
+ "reportLanguage": "en",
29
+ "createdAt": 1739819870336,
30
+ "reportUuid": "51b36daf-614b-409c-b6a1-e8e401b2c144",
31
+ "groupBy": ["parentSuite", "suite", "subSuite"],
32
+ "layout": "split",
33
+ "allureVersion": "3.0.0-beta.8",
34
+ "ci": {
35
+ "type": "github",
36
+ "detected": true,
37
+ "jobUid": "1234567890",
38
+ "jobUrl": "#",
39
+ "jobName": "Sample job name",
40
+ "jobRunUid": "0987654321",
41
+ "jobRunUrl": "#",
42
+ "jobRunName": "Sample job run name",
43
+ "jobRunBranch": "master",
44
+ "pullRequestName": "Pull request #123",
45
+ "pullRequestUrl": "#"
46
+ }
31
47
  };
32
48
  </script>
33
49
  <script async>