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

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 (290) hide show
  1. package/dist/multi/173.app-bae2a0fe5738d77cd976.js +1 -0
  2. package/dist/multi/174.app-bae2a0fe5738d77cd976.js +1 -0
  3. package/dist/multi/252.app-bae2a0fe5738d77cd976.js +1 -0
  4. package/dist/multi/282.app-bae2a0fe5738d77cd976.js +1 -0
  5. package/dist/multi/29.app-bae2a0fe5738d77cd976.js +1 -0
  6. package/dist/multi/416.app-bae2a0fe5738d77cd976.js +1 -0
  7. package/dist/multi/527.app-bae2a0fe5738d77cd976.js +1 -0
  8. package/dist/multi/600.app-bae2a0fe5738d77cd976.js +1 -0
  9. package/dist/multi/605.app-bae2a0fe5738d77cd976.js +1 -0
  10. package/dist/multi/638.app-bae2a0fe5738d77cd976.js +1 -0
  11. package/dist/multi/672.app-bae2a0fe5738d77cd976.js +1 -0
  12. package/dist/multi/686.app-bae2a0fe5738d77cd976.js +1 -0
  13. package/dist/multi/725.app-bae2a0fe5738d77cd976.js +1 -0
  14. package/dist/multi/741.app-bae2a0fe5738d77cd976.js +1 -0
  15. package/dist/multi/755.app-bae2a0fe5738d77cd976.js +1 -0
  16. package/dist/multi/894.app-bae2a0fe5738d77cd976.js +1 -0
  17. package/dist/multi/91.app-bae2a0fe5738d77cd976.js +1 -0
  18. package/dist/multi/943.app-bae2a0fe5738d77cd976.js +1 -0
  19. package/dist/multi/980.app-bae2a0fe5738d77cd976.js +1 -0
  20. package/dist/multi/app-bae2a0fe5738d77cd976.js +2 -0
  21. package/dist/multi/app-bae2a0fe5738d77cd976.js.LICENSE.txt +10 -0
  22. package/dist/multi/manifest.json +25 -24
  23. package/dist/multi/styles-bbf68b2ba63c38b53c38.css +48 -0
  24. package/dist/single/app-996d3b5869f8fc942b66.js +2 -0
  25. package/dist/single/app-996d3b5869f8fc942b66.js.LICENSE.txt +10 -0
  26. package/dist/single/manifest.json +1 -1
  27. package/package.json +31 -19
  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 +96 -64
  57. package/src/components/ReportBody/HeaderActions.tsx +2 -2
  58. package/src/components/ReportBody/SortBy.tsx +4 -7
  59. package/src/components/ReportBody/index.tsx +30 -24
  60. package/src/components/ReportBody/styles.scss +9 -3
  61. package/src/components/ReportGlobalAttachments/index.tsx +34 -0
  62. package/src/components/ReportGlobalAttachments/styles.scss +11 -0
  63. package/src/components/ReportGlobalErrors/index.tsx +30 -0
  64. package/src/components/ReportGlobalErrors/styles.scss +12 -0
  65. package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
  66. package/src/components/ReportHeader/ReportHeaderPie.tsx +1 -2
  67. package/src/components/ReportHeader/index.tsx +38 -12
  68. package/src/components/ReportHeader/styles.scss +9 -1
  69. package/src/components/ReportMetadata/MetadataSummary.tsx +57 -65
  70. package/src/components/ReportMetadata/MetadataWithIcon.tsx +11 -13
  71. package/src/components/ReportMetadata/index.tsx +50 -3
  72. package/src/components/ReportMetadata/styles.scss +0 -2
  73. package/src/components/ReportQualityGateResults/index.tsx +42 -0
  74. package/src/components/ReportQualityGateResults/styles.scss +44 -0
  75. package/src/components/ReportTabs/index.tsx +37 -0
  76. package/src/components/SectionPicker/index.tsx +55 -0
  77. package/src/components/SectionPicker/styles.scss +5 -0
  78. package/src/components/SectionSwitcher/index.tsx +16 -0
  79. package/src/components/SectionSwitcher/styles.scss +4 -0
  80. package/src/components/SectionTabs/index.tsx +0 -0
  81. package/src/components/SideBySide/index.tsx +52 -0
  82. package/src/components/SideBySide/styles.scss +64 -0
  83. package/src/components/SplitLayout/index.tsx +71 -0
  84. package/src/components/SplitLayout/styles.scss +84 -0
  85. package/src/components/TestResult/TestStepsEmpty/index.tsx +3 -9
  86. package/src/components/TestResult/TrAttachmentsView/index.tsx +29 -0
  87. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +5 -5
  88. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +7 -5
  89. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +7 -13
  90. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  91. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  92. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  93. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  94. package/src/components/TestResult/TrError/TrDiff.tsx +121 -0
  95. package/src/components/TestResult/TrError/index.tsx +111 -0
  96. package/src/components/TestResult/TrError/styles.scss +223 -0
  97. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +44 -0
  98. package/src/components/TestResult/TrHeader/index.tsx +15 -0
  99. package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +7 -2
  100. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +94 -0
  101. package/src/components/TestResult/TrHistory/index.tsx +26 -0
  102. package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +2 -1
  103. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +6 -4
  104. package/src/components/TestResult/TrInfo/index.tsx +99 -0
  105. package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +18 -0
  106. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +8 -8
  107. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +6 -6
  108. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +7 -9
  109. package/src/components/TestResult/TrOverview.tsx +46 -0
  110. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +4 -4
  111. package/src/components/TestResult/TrPrevStatuses/index.tsx +63 -0
  112. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  113. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +32 -0
  114. package/src/components/TestResult/TrPwTraces/index.tsx +32 -0
  115. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  116. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +70 -0
  117. package/src/components/TestResult/TrRetriesView/index.tsx +29 -0
  118. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +13 -13
  119. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +2 -2
  120. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +5 -5
  121. package/src/components/TestResult/TrSteps/TrAttachment.tsx +118 -0
  122. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +11 -11
  123. package/src/components/TestResult/TrSteps/TrStep.tsx +98 -0
  124. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +90 -0
  125. package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +12 -12
  126. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +49 -10
  127. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  128. package/src/components/TestResult/TrTabs/index.tsx +42 -0
  129. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +13 -13
  130. package/src/components/TestResult/index.tsx +54 -38
  131. package/src/components/TestResult/styles.scss +12 -0
  132. package/src/components/Timeline/index.tsx +100 -0
  133. package/src/components/Timeline/styles.scss +45 -0
  134. package/src/components/ToggleLayout/index.tsx +17 -0
  135. package/src/components/Tree/index.tsx +117 -11
  136. package/src/components/Tree/styles.scss +23 -5
  137. package/src/index.html +22 -6
  138. package/src/index.tsx +90 -20
  139. package/src/locales/az.json +378 -0
  140. package/src/locales/de.json +378 -0
  141. package/src/locales/en.json +378 -0
  142. package/src/locales/es.json +378 -0
  143. package/src/locales/fr.json +378 -0
  144. package/src/locales/he.json +378 -0
  145. package/src/locales/hy.json +378 -0
  146. package/src/locales/it.json +378 -0
  147. package/src/locales/ja.json +378 -0
  148. package/src/locales/ka.json +378 -0
  149. package/src/locales/kr.json +378 -0
  150. package/src/locales/nl.json +378 -0
  151. package/src/locales/pl.json +386 -0
  152. package/src/locales/pt.json +378 -0
  153. package/src/locales/ru.json +386 -0
  154. package/src/locales/sv.json +378 -0
  155. package/src/locales/tr.json +378 -0
  156. package/src/locales/ua.json +329 -0
  157. package/src/locales/zh.json +378 -0
  158. package/src/stores/chart.ts +41 -6
  159. package/src/stores/env.ts +88 -0
  160. package/src/stores/envInfo.ts +2 -2
  161. package/src/stores/globals.ts +28 -0
  162. package/src/stores/layout.ts +36 -0
  163. package/src/stores/locale.ts +77 -29
  164. package/src/stores/modal.ts +22 -0
  165. package/src/stores/qualityGate.ts +28 -0
  166. package/src/stores/router.ts +108 -0
  167. package/src/stores/sections.ts +63 -0
  168. package/src/stores/stats.ts +52 -7
  169. package/src/stores/testResults.ts +13 -9
  170. package/src/stores/theme.ts +15 -18
  171. package/src/stores/timeline.ts +39 -0
  172. package/src/stores/tree.ts +65 -110
  173. package/src/stores/treeFilters/actions.ts +67 -0
  174. package/src/stores/treeFilters/constants.ts +7 -0
  175. package/src/stores/treeFilters/index.ts +3 -0
  176. package/src/stores/treeFilters/store.ts +73 -0
  177. package/src/stores/treeFilters/types.ts +12 -0
  178. package/src/stores/variables.ts +40 -0
  179. package/src/styles.scss +66 -0
  180. package/src/utils/persist.ts +23 -0
  181. package/src/utils/time.ts +1 -0
  182. package/src/utils/tree.ts +30 -0
  183. package/src/utils/treeFilters.ts +42 -24
  184. package/test/components/Header/CiInfo.test.tsx +177 -0
  185. package/test/components/Header.test.tsx +122 -0
  186. package/test/stores/treeFilters.test.ts +302 -0
  187. package/test/utils/treeFilters.test.ts +189 -44
  188. package/tsconfig.json +7 -2
  189. package/tsconfig.node.json +8 -0
  190. package/types.d.ts +45 -24
  191. package/vitest.config.ts +15 -2
  192. package/vitest.setup.ts +1 -0
  193. package/webpack.config.js +35 -5
  194. package/dist/multi/141.app-f32e4213.js +0 -1
  195. package/dist/multi/222.app-f32e4213.js +0 -1
  196. package/dist/multi/335.app-f32e4213.js +0 -1
  197. package/dist/multi/34.app-f32e4213.js +0 -1
  198. package/dist/multi/349.app-f32e4213.js +0 -1
  199. package/dist/multi/378.app-f32e4213.js +0 -1
  200. package/dist/multi/406.app-f32e4213.js +0 -1
  201. package/dist/multi/476.app-f32e4213.js +0 -1
  202. package/dist/multi/53.app-f32e4213.js +0 -1
  203. package/dist/multi/584.app-f32e4213.js +0 -1
  204. package/dist/multi/690.app-f32e4213.js +0 -1
  205. package/dist/multi/747.app-f32e4213.js +0 -1
  206. package/dist/multi/767.app-f32e4213.js +0 -1
  207. package/dist/multi/816.app-f32e4213.js +0 -1
  208. package/dist/multi/83.app-f32e4213.js +0 -1
  209. package/dist/multi/873.app-f32e4213.js +0 -1
  210. package/dist/multi/920.app-f32e4213.js +0 -1
  211. package/dist/multi/991.app-f32e4213.js +0 -1
  212. package/dist/multi/app-f32e4213.js +0 -2
  213. package/dist/multi/app-f32e4213.js.LICENSE.txt +0 -16
  214. package/dist/multi/styles-f32e4213.css +0 -284
  215. package/dist/single/app-7fa8e43f.js +0 -2
  216. package/dist/single/app-7fa8e43f.js.LICENSE.txt +0 -16
  217. package/src/assets/scss/code.scss +0 -71
  218. package/src/assets/scss/typography.scss +0 -218
  219. package/src/components/ArrowButton/index.tsx +0 -36
  220. package/src/components/ArrowButton/styles.scss +0 -35
  221. package/src/components/LanguagePicker/index.tsx +0 -40
  222. package/src/components/Modal/styles.scss +0 -126
  223. package/src/components/ReportLogo/index.tsx +0 -16
  224. package/src/components/ReportLogo/styles.scss +0 -20
  225. package/src/components/ReportLogoFull/index.tsx +0 -20
  226. package/src/components/ReportLogoFull/styles.scss +0 -7
  227. package/src/components/Tabs/index.tsx +0 -62
  228. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +0 -27
  229. package/src/components/TestResult/TestResultError/index.tsx +0 -59
  230. package/src/components/TestResult/TestResultError/styles.scss +0 -51
  231. package/src/components/TestResult/TestResultHeader/index.tsx +0 -55
  232. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +0 -67
  233. package/src/components/TestResult/TestResultHistory/index.tsx +0 -26
  234. package/src/components/TestResult/TestResultInfo/index.tsx +0 -79
  235. package/src/components/TestResult/TestResultOverview.tsx +0 -43
  236. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +0 -49
  237. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -52
  238. package/src/components/TestResult/TestResultRetriesView/index.tsx +0 -24
  239. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +0 -12
  240. package/src/components/TestResult/TestResultSteps/attachment.tsx +0 -68
  241. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +0 -20
  242. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +0 -32
  243. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +0 -15
  244. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +0 -77
  245. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +0 -85
  246. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -30
  247. package/src/components/TestResult/TestResultTabs/index.tsx +0 -59
  248. package/src/components/ThemeButton/ThemeButton.tsx +0 -20
  249. package/src/components/Tree/Tree.tsx +0 -75
  250. package/src/components/Tree/TreeHeader.tsx +0 -82
  251. package/src/components/Tree/TreeItem.tsx +0 -35
  252. package/src/components/Tree/TreeItemIcon.tsx +0 -32
  253. package/src/i18n/constants.ts +0 -124
  254. package/src/i18n/locales/am.json +0 -120
  255. package/src/i18n/locales/az.json +0 -120
  256. package/src/i18n/locales/de.json +0 -120
  257. package/src/i18n/locales/en.json +0 -121
  258. package/src/i18n/locales/es.json +0 -120
  259. package/src/i18n/locales/fr.json +0 -120
  260. package/src/i18n/locales/he.json +0 -120
  261. package/src/i18n/locales/it.json +0 -120
  262. package/src/i18n/locales/ja.json +0 -120
  263. package/src/i18n/locales/ka.json +0 -120
  264. package/src/i18n/locales/kr.json +0 -120
  265. package/src/i18n/locales/nl.json +0 -120
  266. package/src/i18n/locales/pl.json +0 -118
  267. package/src/i18n/locales/pt.json +0 -120
  268. package/src/i18n/locales/ru.json +0 -118
  269. package/src/i18n/locales/sv.json +0 -120
  270. package/src/i18n/locales/tr.json +0 -120
  271. package/src/i18n/locales/zh.json +0 -120
  272. package/src/utils/attachments.ts +0 -156
  273. package/src/utils/capitalize.ts +0 -6
  274. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  275. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  276. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  277. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
  278. /package/src/components/{Tabs → ReportTabs}/styles.scss +0 -0
  279. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  280. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  281. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  282. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  283. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  284. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  285. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  286. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  287. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  288. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  289. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  290. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
@@ -0,0 +1,60 @@
1
+ .test-result-environment-item {
2
+ &:not(.current) {
3
+ cursor: pointer;
4
+
5
+ &:hover {
6
+ background: var(--bg-control-flat-medium);
7
+ }
8
+ }
9
+ }
10
+
11
+ .test-result-environment-item-header {
12
+ display: flex;
13
+ width: 100%;
14
+ gap: 4px;
15
+ align-items: center;
16
+ }
17
+
18
+ .test-result-environment-item-wrap {
19
+ transition: background-color 300ms;
20
+ display: flex;
21
+ gap: 4px;
22
+ justify-content: space-between;
23
+ border-radius: 6px;
24
+ padding: 4px 4px 4px 4px;
25
+ width: 100%;
26
+ align-items: flex-start;
27
+ }
28
+
29
+ .test-result-environment-item-text {
30
+ padding-top: 2px;
31
+ }
32
+
33
+ .test-result-environment-item-env {
34
+ margin-top: 1px;
35
+ }
36
+
37
+ .test-result-environment-item-info {
38
+ display: flex;
39
+ gap: 4px;
40
+ align-items: center;
41
+ margin-left: auto;
42
+ }
43
+
44
+ .test-result-environment-item-time {
45
+ margin-left: auto;
46
+ line-height: 20px;
47
+ color: var(--on-text-secondary);
48
+ }
49
+
50
+ .test-result-environment-item-link {
51
+ :root {
52
+ --allure-btn-icon-color: var(--bg-control-flat);
53
+ }
54
+
55
+ color: var(--on-icon-secondary);
56
+ }
57
+
58
+ .test-result-environment-item-status {
59
+ padding-top: 4px;
60
+ }
@@ -0,0 +1,64 @@
1
+ import { type TestEnvGroup, getRealEnvsCount } from "@allurereport/core-api";
2
+ import { Loadable } from "@allurereport/web-components";
3
+ import type { FunctionalComponent } from "preact";
4
+ import { useEffect } from "preact/hooks";
5
+ import type { AwesomeTestResult } from "types";
6
+ import { TrEnvironmentItem } from "@/components/TestResult/TrEnvironmentItem";
7
+ import { useI18n } from "@/stores";
8
+ import { testEnvGroupsStore } from "@/stores/env";
9
+ import { fetchTestResult, testResultStore } from "@/stores/testResults";
10
+ import * as styles from "./styles.scss";
11
+
12
+ export const TrEnvironmentSection: FunctionalComponent<{
13
+ env: string;
14
+ activeTestResultId: string;
15
+ testResultId: string;
16
+ }> = ({ env, activeTestResultId, testResultId }) => {
17
+ useEffect(() => {
18
+ fetchTestResult(testResultId);
19
+ }, [testResultId]);
20
+
21
+ return (
22
+ <Loadable<Record<string, AwesomeTestResult>, AwesomeTestResult | undefined>
23
+ source={testResultStore}
24
+ transformData={(data) => data[testResultId]}
25
+ renderData={(tr) =>
26
+ tr && <TrEnvironmentItem env={env} testResult={tr} current={activeTestResultId === testResultId} />
27
+ }
28
+ />
29
+ );
30
+ };
31
+
32
+ export const TrEnvironmentsView: FunctionalComponent<{
33
+ testResult: AwesomeTestResult;
34
+ }> = ({ testResult }) => {
35
+ const { t } = useI18n("empty");
36
+
37
+ return (
38
+ <div className={styles["test-result-environments"]}>
39
+ <Loadable<Record<string, TestEnvGroup>, TestEnvGroup | undefined>
40
+ source={testEnvGroupsStore}
41
+ renderData={(group) => {
42
+ if (!getRealEnvsCount(group)) {
43
+ return <div className={styles["test-result-empty"]}>{t("no-environments-results")}</div>;
44
+ }
45
+
46
+ const envs = Object.entries(group.testResultsByEnv).sort(([a], [b]) => b.localeCompare(a));
47
+
48
+ return (
49
+ <ul>
50
+ {envs.map(([env, trId]) => {
51
+ return (
52
+ <li key={`${env}-${trId}`}>
53
+ <TrEnvironmentSection env={env} testResultId={trId} activeTestResultId={testResult.id} />
54
+ </li>
55
+ );
56
+ })}
57
+ </ul>
58
+ );
59
+ }}
60
+ transformData={(groups) => groups[testResult?.testCase?.id]}
61
+ />
62
+ </div>
63
+ );
64
+ };
@@ -0,0 +1,11 @@
1
+ .test-result-environments {
2
+ padding: 12px 24px 32px;
3
+ min-height: 320px;
4
+ }
5
+
6
+ .test-result-empty {
7
+ display: flex;
8
+ padding: 48px 0;
9
+ width: 100%;
10
+ justify-content: center;
11
+ }
@@ -0,0 +1,121 @@
1
+ import { Button, Code, CodeViewer } from "@allurereport/web-components";
2
+ import type { BaseOptions, Change } from "diff";
3
+ import { diffChars, diffLines, diffWords } from "diff";
4
+ import { useState } from "preact/hooks";
5
+ import * as styles from "@/components/TestResult/TrError/styles.scss";
6
+ import { useI18n } from "@/stores";
7
+
8
+ const diffFunctions = {
9
+ chars: diffChars,
10
+ words: diffWords,
11
+ lines: diffLines,
12
+ } as const;
13
+
14
+ type DiffType = keyof typeof diffFunctions;
15
+ type ViewMode = "unified" | "side-by-side";
16
+
17
+ export const TrDiff = ({ expected, actual }: { expected: string; actual: string }) => {
18
+ const [diffType, setDiffType] = useState<DiffType>("lines");
19
+ const [viewMode, setViewMode] = useState<ViewMode>("unified");
20
+ const [diff, setDiff] = useState<Change[]>(() => diffLines(expected, actual));
21
+ const { t } = useI18n("controls");
22
+
23
+ const DiffCode = () => {
24
+ return (
25
+ <>
26
+ {diff.map((part, index) => (
27
+ <div key={index} className={part.added ? styles["diff-green"] : part.removed ? styles["diff-red"] : ""}>
28
+ {part.value}
29
+ </div>
30
+ ))}
31
+ </>
32
+ );
33
+ };
34
+ const changeTypeDiff = (type: DiffType = "chars") => {
35
+ const diffFn = diffFunctions[type];
36
+ const result = (diffFn as (oldStr: string, newStr: string, options?: BaseOptions) => Change[])(
37
+ expected,
38
+ actual,
39
+ {},
40
+ );
41
+
42
+ setDiffType(type);
43
+ setDiff(result);
44
+ };
45
+
46
+ const SideBySideView = () => {
47
+ return (
48
+ <div className={styles["side-by-side"]}>
49
+ <div className={styles.side}>
50
+ <Code type={"ui"} size={"s"} className={styles["side-title"]}>
51
+ {t("expected")}
52
+ </Code>
53
+ <CodeViewer code={expected} className={styles["diff-screen"]} />
54
+ </div>
55
+ <div className={styles.side}>
56
+ <div className={styles.expected}>
57
+ <Code size={"s"} className={styles["side-title"]}>
58
+ {t("actual")}
59
+ </Code>
60
+ </div>
61
+ <CodeViewer className={styles["diff-screen"]}>
62
+ <DiffCode />
63
+ </CodeViewer>
64
+ </div>
65
+ </div>
66
+ );
67
+ };
68
+
69
+ const UnifiedView = () => {
70
+ return (
71
+ <>
72
+ <div className={styles.unified}>
73
+ <CodeViewer className={styles["diff-screen"]}>
74
+ <div className={styles["diff-grey"]}>{expected}</div>
75
+ <DiffCode />
76
+ </CodeViewer>
77
+ </div>
78
+ </>
79
+ );
80
+ };
81
+
82
+ return (
83
+ <div className={styles.diff} data-testId={"test-result-diff"}>
84
+ <div className={styles["diff-controls"]}>
85
+ <div className={styles["diff-buttons"]}>
86
+ <Code size={"s"} className={styles["diff-buttons-title"]}>
87
+ {t("viewMode")}:
88
+ </Code>
89
+ <div className={styles["diff-view"]}>
90
+ {["unified", "side-by-side"].map((mode: ViewMode) => (
91
+ <Button
92
+ key={mode}
93
+ size={"s"}
94
+ style={viewMode === mode ? "primary" : "outline"}
95
+ text={t(mode)}
96
+ onClick={() => setViewMode(mode)}
97
+ />
98
+ ))}
99
+ </div>
100
+ </div>
101
+ <div className={styles["diff-buttons"]}>
102
+ <Code size={"s"} className={styles["diff-buttons-title"]}>
103
+ {t("compareBy")}:
104
+ </Code>
105
+ {["chars", "words", "lines"].map((type: DiffType) => {
106
+ return (
107
+ <Button
108
+ key={type}
109
+ size={"s"}
110
+ style={diffType === type ? "primary" : "outline"}
111
+ text={t(type)}
112
+ onClick={() => changeTypeDiff(type)}
113
+ />
114
+ );
115
+ })}
116
+ </div>
117
+ </div>
118
+ {viewMode === "side-by-side" ? <SideBySideView /> : <UnifiedView />}
119
+ </div>
120
+ );
121
+ };
@@ -0,0 +1,111 @@
1
+ import type { TestError, TestStatus } from "@allurereport/core-api";
2
+ import { ansiToHTML } from "@allurereport/web-commons";
3
+ import { Button, Code, IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
4
+ import clsx from "clsx";
5
+ import { type FunctionalComponent } from "preact";
6
+ import { useState } from "preact/hooks";
7
+ import { TrDiff } from "@/components/TestResult/TrError/TrDiff";
8
+ import { useI18n } from "@/stores/locale";
9
+ import { openModal } from "@/stores/modal";
10
+ import { copyToClipboard } from "@/utils/copyToClipboard";
11
+ import * as styles from "./styles.scss";
12
+
13
+ const TrErrorTrace = ({ trace }: { trace: string }) => {
14
+ const sanitizedTrace = ansiToHTML(trace, {
15
+ fg: "var(--on-text-primary)",
16
+ bg: "none",
17
+ colors: {
18
+ 0: "none",
19
+ 1: "none",
20
+ 2: "var(--on-support-sirius)",
21
+ 3: "var(--on-support-atlas)",
22
+ 4: "var(--bg-support-skat)",
23
+ 5: "var(--on-support-betelgeuse)",
24
+ },
25
+ });
26
+
27
+ return (
28
+ <div data-testid="test-result-error-trace" className={styles["test-result-error-trace"]}>
29
+ <Code size={"s"} type={"ui"}>
30
+ {/* eslint-disable-next-line react/no-danger */}
31
+ <pre dangerouslySetInnerHTML={{ __html: sanitizedTrace }} />
32
+ </Code>
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export const TrError: FunctionalComponent<TestError & { className?: string; status?: TestStatus }> = ({
38
+ className,
39
+ message = "",
40
+ trace,
41
+ actual,
42
+ expected,
43
+ status,
44
+ ...rest
45
+ }) => {
46
+ const [isOpen, setIsOpen] = useState(false);
47
+ const { t } = useI18n("ui");
48
+ const { t: tooltip } = useI18n("controls");
49
+ const { t: empty } = useI18n("empty");
50
+ const openDiff = () =>
51
+ openModal({
52
+ title: tooltip("comparison"),
53
+ data: { actual, expected },
54
+ component: <TrDiff actual={actual} expected={expected} />,
55
+ });
56
+ const sanitizedMessage = ansiToHTML(message, {
57
+ fg: "var(--on-text-primary)",
58
+ colors: {},
59
+ });
60
+
61
+ return (
62
+ <div
63
+ data-testid="test-result-error"
64
+ className={clsx(styles["test-result-error"], styles[`tr-status-${status}`], className)}
65
+ {...rest}
66
+ >
67
+ {message ? (
68
+ <>
69
+ <div data-testid="test-result-error-header" className={styles["test-result-error-header"]}>
70
+ <Text
71
+ tag={"p"}
72
+ size={"m"}
73
+ bold
74
+ className={clsx(styles["test-result-error-text"], styles[`tr-color-${status}`])}
75
+ >
76
+ {t("error")}
77
+ </Text>
78
+ <TooltipWrapper tooltipText={tooltip("clipboard")} tooltipTextAfterClick={tooltip("clipboardSuccess")}>
79
+ <IconButton
80
+ style={"ghost"}
81
+ size={"s"}
82
+ icon={allureIcons.lineGeneralCopy3}
83
+ onClick={() => {
84
+ copyToClipboard(message);
85
+ }}
86
+ />
87
+ </TooltipWrapper>
88
+ </div>
89
+ <div className={styles["test-result-error-message"]} onClick={() => setIsOpen(!isOpen)}>
90
+ <Code data-testid="test-result-error-message" size={"s"}>
91
+ {/* eslint-disable-next-line react/no-danger */}
92
+ <pre dangerouslySetInnerHTML={{ __html: sanitizedMessage }} />
93
+ </Code>
94
+ </div>
95
+ </>
96
+ ) : (
97
+ empty("no-message-provided")
98
+ )}
99
+ {Boolean(actual && actual !== "undefined" && expected && expected !== "undefined") && (
100
+ <Button
101
+ style={"flat"}
102
+ data-testId={"test-result-diff-button"}
103
+ size={"s"}
104
+ text={tooltip("showDiff")}
105
+ onClick={openDiff}
106
+ />
107
+ )}
108
+ {isOpen && Boolean(trace?.length) && <TrErrorTrace trace={trace} />}
109
+ </div>
110
+ );
111
+ };
@@ -0,0 +1,223 @@
1
+ .test-result-error {
2
+ padding: 8px 8px 12px 16px;
3
+ background-color: var(--bg-alpha-capella);
4
+ border-radius: 8px;
5
+ position: relative;
6
+ overflow: hidden;
7
+
8
+ &:before {
9
+ content: "";
10
+ display: block;
11
+ height: 100%;
12
+ width: 2px;
13
+ position: absolute;
14
+ left: 0;
15
+ top: 0;
16
+ //background: var(--on-support-capella);
17
+ //background: var(--on-support-capella);
18
+ }
19
+ }
20
+
21
+ .tr-status-failed {
22
+ background-color: var(--bg-alpha-capella);
23
+ &:before {
24
+ background-color: var(--bg-support-capella);
25
+ }
26
+ }
27
+
28
+ .tr-status-broken {
29
+ background-color: var(--bg-alpha-atlas);
30
+ &:before {
31
+ background-color: var(--bg-support-atlas);
32
+ }
33
+ }
34
+
35
+ .tr-status-skipped {
36
+ background-color: var(--bg-alpha-rau);
37
+ &:before {
38
+ background-color: var(--bg-support-rau);
39
+ }
40
+ }
41
+
42
+ .tr-status-unknown {
43
+ background-color: var(--bg-alpha-skat);
44
+ &:before {
45
+ background-color: var(--bg-support-skat);
46
+ }
47
+ }
48
+
49
+ .tr-status-passed {
50
+ background-color: var(--bg-alpha-castor);
51
+ &:before {
52
+ background-color: var(--bg-support-castor);
53
+ }
54
+ }
55
+
56
+ .test-result-error-header {
57
+ display: flex;
58
+ gap: 4px;
59
+ justify-content: space-between;
60
+ }
61
+
62
+ .test-result-error-text {
63
+ margin-bottom: 8px;
64
+ padding-left: 8px;
65
+ color: var(--on-support-capella);
66
+ margin-right: auto;
67
+ }
68
+
69
+ .tr-color-failed {
70
+ color: var(--on-support-capella);
71
+ }
72
+
73
+ .tr-color-broken {
74
+ color: var(--on-support-atlas);
75
+ }
76
+
77
+ .tr-color-skipped {
78
+ color: var(--on-support-rau);
79
+ }
80
+
81
+ .tr-color-passed {
82
+ color: var(--on-support-castor);
83
+ }
84
+ .tr-color-unknown {
85
+ color: var(--on-support-skat);
86
+ }
87
+
88
+ .tr-bg-failed {
89
+ background: var(--bg-support-capella);
90
+ }
91
+
92
+ .tr-bg-broken {
93
+ background: var(--bg-support-atlas);
94
+ }
95
+
96
+ .tr-bg-skipped {
97
+ background: var(--bg-support-rau);
98
+ }
99
+
100
+ .tr-bg-passed {
101
+ background: var(--bg-support-castor);
102
+ }
103
+
104
+ .tr-bg-failed {
105
+ background: var(--bg-support-capella);
106
+ }
107
+ .tr-bg-unknown {
108
+ background: var(--bg-support-skat);
109
+ }
110
+
111
+ .test-result-error-trace {
112
+ margin-top: 8px;
113
+ padding-left: 8px;
114
+
115
+ pre {
116
+ overflow: scroll;
117
+ padding-bottom: 24px;
118
+ }
119
+ }
120
+
121
+ .test-result-error-message {
122
+ padding: 8px;
123
+ border-radius: 8px;
124
+ cursor: pointer;
125
+ transition: background-color 300ms;
126
+ margin-bottom: 4px;
127
+
128
+ &:hover {
129
+ background: inherit;
130
+ }
131
+ }
132
+
133
+ .diff {
134
+ width: 100%;
135
+ line-height: 1.28;
136
+ padding: 0 16px 16px;
137
+ display: flex;
138
+ flex-direction: column;
139
+ height: 100%;
140
+ overflow: hidden;
141
+
142
+ .side {
143
+ flex: 1 1 auto;
144
+ gap: 4px;
145
+ height: 100%;
146
+ overflow: hidden;
147
+ }
148
+
149
+ .unified {
150
+ flex: 1 1 auto;
151
+ overflow: auto;
152
+ }
153
+
154
+ .diff-screen {
155
+ min-height: 320px;
156
+ height: 100%;
157
+ overflow: auto;
158
+ padding-bottom: 48px;
159
+ }
160
+ }
161
+
162
+ .diff-green {
163
+ color: var(--on-support-castor);
164
+ background: #09933729;
165
+ }
166
+
167
+ .diff-grey {
168
+ color: var(--on-text-secondary);
169
+ margin-bottom: 4px;
170
+ }
171
+
172
+ .diff-red {
173
+ color: var(--on-support-capella);
174
+ background: var(--bg-alpha-capella);
175
+ }
176
+
177
+ .diff-buttons {
178
+ display: flex;
179
+ gap: 4px;
180
+ align-items: center;
181
+ line-height: 24px;
182
+ margin-bottom: 4px;
183
+ }
184
+
185
+ .expected {
186
+ display: flex;
187
+ justify-content: space-between;
188
+ width: 100%;
189
+ align-items: center;
190
+ line-height: 24px;
191
+ }
192
+
193
+ .side-title {
194
+ line-height: 24px;
195
+ margin-bottom: 4px;
196
+ display: block;
197
+ }
198
+
199
+ .diff-controls {
200
+ display: flex;
201
+ gap: 16px;
202
+ align-items: center;
203
+ margin-bottom: 4px;
204
+ justify-content: space-between;
205
+ }
206
+
207
+ .diff-view {
208
+ display: flex;
209
+ gap: 4px;
210
+ align-items: flex-start;
211
+ }
212
+
213
+ .side-by-side {
214
+ display: flex;
215
+ gap: 4px;
216
+ height: 100%;
217
+ overflow: hidden;
218
+ }
219
+
220
+ .diff-buttons-title {
221
+ color: var(--on-text-secondary);
222
+ margin-right: 8px;
223
+ }
@@ -0,0 +1,44 @@
1
+ import { IconButton, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import clsx from "clsx";
3
+ import type { AwesomeTestResult } from "types";
4
+ import * as styles from "@/components/TestResult/TrHeader/styles.scss";
5
+ import { navigateTo } from "@/stores/router";
6
+
7
+ interface TrBreadcrumbs {
8
+ testResult?: AwesomeTestResult;
9
+ }
10
+
11
+ export const TrBreadcrumbs = ({ testResult }: TrBreadcrumbs) => {
12
+ const { breadcrumbs, name } = testResult || {};
13
+
14
+ return (
15
+ <div className={styles["test-result-breadcrumbs"]}>
16
+ <div className={clsx(styles["test-result-breadcrumb"], styles["test-result-home"])}>
17
+ <IconButton
18
+ icon={allureIcons.lineGeneralHomeLine}
19
+ size={"s"}
20
+ style={"ghost"}
21
+ className={styles["test-result-breadcrumb-link"]}
22
+ onClick={() => navigateTo("")}
23
+ />
24
+ </div>
25
+ {Boolean(breadcrumbs?.length) &&
26
+ breadcrumbs?.[0]?.map((item, key) => {
27
+ return (
28
+ <div className={styles["test-result-breadcrumb"]} key={key}>
29
+ <SvgIcon id={allureIcons.lineArrowsChevronDown} className={styles["test-result-breadcrumb-arrow"]} />
30
+ <Text size={"s"} bold className={styles["test-result-breadcrumb-title"]}>
31
+ {item}
32
+ </Text>
33
+ </div>
34
+ );
35
+ })}
36
+ <div className={styles["test-result-breadcrumb"]}>
37
+ {name && <SvgIcon id={allureIcons.lineArrowsChevronDown} className={styles["test-result-breadcrumb-arrow"]} />}
38
+ <Text size={"s"} bold className={styles["test-result-breadcrumb-title"]}>
39
+ {name}
40
+ </Text>
41
+ </div>
42
+ </div>
43
+ );
44
+ };
@@ -0,0 +1,15 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import { HeaderControls } from "@/components/HeaderControls";
3
+ import type { TrProps } from "@/components/TestResult";
4
+ import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
5
+ import { isSplitMode } from "@/stores/layout";
6
+ import * as styles from "./styles.scss";
7
+
8
+ export const TrHeader: FunctionalComponent<TrProps> = ({ testResult }) => {
9
+ return (
10
+ <div className={styles.above}>
11
+ {!isSplitMode.value ? <TrBreadcrumbs testResult={testResult} /> : ""}
12
+ <HeaderControls className={styles.right} />
13
+ </div>
14
+ );
15
+ };
@@ -17,11 +17,11 @@
17
17
  .test-result-breadcrumb {
18
18
  display: flex;
19
19
  gap: 4px;
20
- align-items: center;
21
20
  color: var(--on-text-secondary);
22
21
  white-space: nowrap;
23
22
  text-overflow: ellipsis;
24
23
  overflow: hidden;
24
+ align-items: center;
25
25
  }
26
26
 
27
27
  .test-result-breadcrumb-title {
@@ -36,7 +36,12 @@
36
36
  width: 100%;
37
37
  justify-content: space-between;
38
38
  align-items: center;
39
- gap: 12px;
39
+ gap: 4px;
40
+ }
41
+ .right {
42
+ margin-left: auto;
43
+ display: flex;
44
+ gap: 4px;
40
45
  }
41
46
  .test-result-breadcrumb-arrow {
42
47
  transform: rotate(-90deg);