@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
@@ -1,77 +0,0 @@
1
- import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
- import { Code, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
3
- import type { FunctionComponent } from "preact";
4
- import { useState } from "preact/hooks";
5
- import { ArrowButton } from "@/components/ArrowButton";
6
- import { Attachment } from "@/components/TestResult/TestResultSteps/attachment";
7
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
8
- import { TestResultAttachmentInfo } from "@/components/TestResult/TestResultSteps/testResultAttachmentInfo";
9
- import { attachmentType } from "@/utils/attachments";
10
-
11
- const { lineImagesImage, lineFilesFileAttachment2 } = allureIcons;
12
-
13
- const iconMap: Record<string, string> = {
14
- "text/plain": lineFilesFileAttachment2,
15
- "application/xml": lineFilesFileAttachment2,
16
- "text/html": lineFilesFileAttachment2,
17
- "text/csv": lineFilesFileAttachment2,
18
- "text/tab-separated-values": lineFilesFileAttachment2,
19
- "text/css": lineFilesFileAttachment2,
20
- "text/uri-list": lineFilesFileAttachment2,
21
- "image/svg+xml": lineImagesImage,
22
- "image/png": lineImagesImage,
23
- "application/json": lineFilesFileAttachment2,
24
- "application/zip": lineFilesFileAttachment2,
25
- "video/webm": lineImagesImage,
26
- "image/jpeg": lineImagesImage,
27
- "video/mp4": lineImagesImage,
28
- "application/vnd.allure.image.diff": lineImagesImage,
29
- };
30
-
31
- export const TestResultAttachment: FunctionComponent<{
32
- item: AttachmentTestStepResult;
33
- stepIndex?: number;
34
- className?: string;
35
- }> = ({ item, stepIndex }) => {
36
- const [isOpened, setIsOpen] = useState(false);
37
- const { link } = item;
38
- const { missed } = link;
39
- const componentType = attachmentType(link.contentType);
40
- const isValidComponentType = !["archive", null].includes(componentType.type as string);
41
-
42
- return (
43
- <div className={styles["test-result-step"]}>
44
- <div
45
- className={styles["test-result-attachment-header"]}
46
- onClick={(e) => {
47
- e.stopPropagation();
48
- setIsOpen((prev) => !prev);
49
- }}
50
- >
51
- <ArrowButton isOpened={isOpened} />
52
- <div className={styles["test-result-attachment-icon"]}>
53
- <SvgIcon size="s" id={iconMap[link.contentType] ?? lineFilesFileAttachment2} />
54
- </div>
55
-
56
- <Code size="s" className={styles["test-result-step-number"]}>
57
- {stepIndex}
58
- </Code>
59
-
60
- <Text className={styles["test-result-attachment-text"]}>{link.name || link.originalFileName}</Text>
61
- {missed && (
62
- <Text size={"s"} className={styles["test-result-attachment-missed"]}>
63
- missed
64
- </Text>
65
- )}
66
- <TestResultAttachmentInfo item={item} shouldExpand={isValidComponentType} />
67
- </div>
68
- {isOpened && isValidComponentType && (
69
- <div className={styles["test-result-attachment-content-wrapper"]}>
70
- <div className={styles["test-result-attachment-content"]}>
71
- <Attachment item={item} />
72
- </div>
73
- </div>
74
- )}
75
- </div>
76
- );
77
- };
@@ -1,85 +0,0 @@
1
- import type { DefaultTestStepResult } from "@allurereport/core-api";
2
- import { Code, Text, allureIcons } from "@allurereport/web-components";
3
- import type { FunctionComponent } from "preact";
4
- import { useState } from "preact/hooks";
5
- import { ArrowButton } from "@/components/ArrowButton";
6
- import { MetadataList } from "@/components/Metadata";
7
- import { type MetadataItem } from "@/components/ReportMetadata";
8
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
9
- import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
10
- import { TestResultStepInfo } from "@/components/TestResult/TestResultSteps/testResultStepInfo";
11
- import TreeItemIcon from "@/components/Tree/TreeItemIcon";
12
- import { collapsedTrees, toggleTree } from "@/stores/tree";
13
-
14
- export const TestResultStepParameters = (props: { parameters: DefaultTestStepResult["parameters"] }) => {
15
- const { parameters } = props;
16
-
17
- return (
18
- <div className={styles["test-result-parameters"]}>
19
- <MetadataList size={"s"} envInfo={parameters as unknown as MetadataItem[]} columns={1} />
20
- </div>
21
- );
22
- };
23
- export const TestResultStepsContent = (props: { item: DefaultTestStepResult }) => {
24
- const { item } = props;
25
-
26
- return (
27
- <div className={styles["test-result-step-content"]}>
28
- {Boolean(item?.parameters?.length) && <TestResultStepParameters parameters={item.parameters} />}
29
- {Boolean(item?.steps?.length) && (
30
- <>
31
- {item.steps?.map((subItem, key) => {
32
- if (subItem.type === "step") {
33
- return <TestResultStep stepIndex={key + 1} key={key} item={subItem} />;
34
- }
35
-
36
- if (subItem.type === "attachment") {
37
- return <TestResultAttachment stepIndex={key + 1} key={key} item={subItem} />;
38
- }
39
-
40
- return null;
41
- })}
42
- </>
43
- )}
44
- </div>
45
- );
46
- };
47
-
48
- export const TestResultStep: FunctionComponent<{
49
- item: DefaultTestStepResult;
50
- stepIndex?: number;
51
- className?: string;
52
- }> = ({ item, stepIndex }) => {
53
- const isEarlyOpened = collapsedTrees.value.has(item.stepId);
54
- const [isOpened, setIsOpen] = useState(isEarlyOpened || false);
55
- const hasContent = Boolean(item?.steps?.length || item?.parameters?.length);
56
-
57
- const handleClick = () => {
58
- setIsOpen(!isOpened);
59
- toggleTree(item.stepId);
60
- };
61
-
62
- return (
63
- <div className={styles["test-result-step"]}>
64
- <div className={styles["test-result-step-header"]} onClick={handleClick}>
65
- {!hasContent ? (
66
- <div className={styles["test-result-strut"]} />
67
- ) : (
68
- <ArrowButton
69
- isOpened={isOpened}
70
- icon={allureIcons.arrowsChevronDown}
71
- iconSize={"xs"}
72
- className={!hasContent ? styles["test-result-visibility-hidden"] : ""}
73
- />
74
- )}
75
- <TreeItemIcon status={item.status} />
76
- <Code size={"s"} className={styles["test-result-step-number"]}>
77
- {stepIndex}
78
- </Code>
79
- <Text className={styles["test-result-header-text"]}>{item.name}</Text>
80
- <TestResultStepInfo item={item} />
81
- </div>
82
- {hasContent && isOpened && <TestResultStepsContent item={item} />}
83
- </div>
84
- );
85
- };
@@ -1,30 +0,0 @@
1
- import { type DefaultTestStepResult, formatDuration } from "@allurereport/core-api";
2
- import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
3
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
4
-
5
- export const TestResultStepInfo = (props: { item: DefaultTestStepResult }) => {
6
- const { item } = props;
7
- const formattedDuration = formatDuration(item?.duration as number);
8
- const stepLength = item.steps?.length;
9
- const attachmentLength = item.steps?.filter((step) => step.type === "attachment")?.length;
10
-
11
- return (
12
- <div className={styles["item-info"]}>
13
- {Boolean(stepLength) && (
14
- <div className={styles["item-info-step"]}>
15
- <SvgIcon id={allureIcons.lineArrowsCornerDownRight} className={styles["item-info-step-icon"]} />
16
- <Text size={"s"}>{stepLength}</Text>
17
- </div>
18
- )}
19
- {Boolean(attachmentLength) && (
20
- <div className={styles["item-info-step"]}>
21
- <SvgIcon id={allureIcons.lineFilesFileAttachment2} className={styles["item-info-step-icon"]} />
22
- <Text size={"s"}>{attachmentLength}</Text>
23
- </div>
24
- )}
25
- <Text type="ui" size={"s"} className={styles["item-time"]}>
26
- {formattedDuration}
27
- </Text>
28
- </div>
29
- );
30
- };
@@ -1,59 +0,0 @@
1
- import { Text } from "@allurereport/web-components";
2
- import { type ComponentChildren, createContext } from "preact";
3
- import { useContext, useState } from "preact/hooks";
4
- import * as styles from "./styles.scss";
5
-
6
- type TestResultTabsContextT = {
7
- currentTab: string | undefined;
8
- setCurrentTab: (id: string) => void;
9
- };
10
-
11
- const TestResultTabsContext = createContext<TestResultTabsContextT | null>(null);
12
-
13
- export const useTestResultTabsContext = () => {
14
- const context = useContext(TestResultTabsContext);
15
-
16
- if (!context) {
17
- throw new Error("TestResultTabs components must be used within a TestResultTabs component");
18
- }
19
-
20
- return context;
21
- };
22
-
23
- export const TestResultTabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
24
- const { children, initialTab } = props;
25
- const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
26
-
27
- return (
28
- <TestResultTabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</TestResultTabsContext.Provider>
29
- );
30
- };
31
-
32
- export const TestResultTabs = (props: { children: ComponentChildren; initialTab?: string }) => {
33
- return <TestResultTabsProvider {...props} />;
34
- };
35
-
36
- export const TestResultTabsList = (props: { children: ComponentChildren }) => {
37
- return <div className={styles.tabsList}>{props.children}</div>;
38
- };
39
-
40
- export const TestResultTab = (props: { id: string; children: ComponentChildren; disabled?: boolean }) => {
41
- const { id, children } = props;
42
- const { currentTab, setCurrentTab } = useTestResultTabsContext();
43
- const isCurrentTab = currentTab === id;
44
-
45
- const handleTabClick = () => {
46
- if (isCurrentTab) {
47
- return;
48
- }
49
- setCurrentTab(id);
50
- };
51
-
52
- return (
53
- <button className={styles.tab} onClick={handleTabClick} aria-current={isCurrentTab ? true : undefined}>
54
- <Text type="paragraph" size="m">
55
- {children}
56
- </Text>
57
- </button>
58
- );
59
- };
@@ -1,20 +0,0 @@
1
- import { IconButton, allureIcons } from "@allurereport/web-components";
2
- import { useEffect } from "preact/hooks";
3
- import { getTheme, themeStore, toggleTheme } from "@/stores/theme";
4
-
5
- export const ThemeButton = () => {
6
- const theme = themeStore.value;
7
-
8
- useEffect(() => {
9
- getTheme();
10
- }, []);
11
-
12
- return (
13
- <IconButton
14
- onClick={toggleTheme}
15
- style="ghost"
16
- icon={theme === "light" ? allureIcons.lineShapesMoon : allureIcons.lineShapesSun}
17
- size="s"
18
- />
19
- );
20
- };
@@ -1,75 +0,0 @@
1
- import type { Statistic } from "@allurereport/core-api";
2
- import cx from "clsx";
3
- import type { FunctionComponent } from "preact";
4
- import { useState } from "preact/hooks";
5
- import type { AllureAwesomeRecursiveTree, AllureAwesomeStatus } from "types";
6
- import TreeItem from "@/components/Tree/TreeItem";
7
- import { collapsedTrees, toggleTree } from "@/stores/tree";
8
- import TreeHeader from "./TreeHeader";
9
- import * as styles from "./styles.scss";
10
-
11
- interface TreeProps {
12
- statistic?: Statistic;
13
- tree: AllureAwesomeRecursiveTree;
14
- name?: string;
15
- root?: boolean;
16
- statusFilter?: AllureAwesomeStatus;
17
- }
18
-
19
- const Tree: FunctionComponent<TreeProps> = ({ tree, statusFilter, root, name, statistic }) => {
20
- const isEarlyCollapsed = collapsedTrees.value.has(tree.nodeId);
21
- const haveFailedSteps = statistic === undefined || !!statistic?.failed || !!statistic?.broken;
22
- const [isOpened, setIsOpen] = useState(() => (isEarlyCollapsed ? !haveFailedSteps : haveFailedSteps));
23
-
24
- const toggleTreeHeader = () => {
25
- setIsOpen(!isOpened);
26
- toggleTree(tree.nodeId);
27
- };
28
- const emptyTree = !tree?.trees?.length && !tree?.leaves?.length;
29
-
30
- if (emptyTree) {
31
- return null;
32
- }
33
-
34
- const treeContent = isOpened && (
35
- <div
36
- data-testid="tree-content"
37
- className={cx({
38
- [styles["tree-content"]]: true,
39
- [styles.root]: root,
40
- })}
41
- >
42
- {tree?.trees?.map?.((subTree) => (
43
- <Tree
44
- key={subTree.nodeId}
45
- name={subTree.name}
46
- tree={subTree}
47
- statistic={subTree.statistic}
48
- statusFilter={statusFilter}
49
- />
50
- ))}
51
- {tree?.leaves?.map?.((leaf) => (
52
- <TreeItem
53
- data-testid="tree-leaf"
54
- key={leaf.nodeId}
55
- id={leaf.nodeId}
56
- name={leaf.name}
57
- status={leaf.status}
58
- groupOrder={leaf.groupOrder}
59
- duration={leaf.duration}
60
- />
61
- ))}
62
- </div>
63
- );
64
-
65
- return (
66
- <div className={styles.tree}>
67
- {name && (
68
- <TreeHeader categoryTitle={name} isOpened={isOpened} toggleTree={toggleTreeHeader} statistic={statistic} />
69
- )}
70
- {treeContent}
71
- </div>
72
- );
73
- };
74
-
75
- export default Tree;
@@ -1,82 +0,0 @@
1
- import { type Statistic, statusesList } from "@allurereport/core-api";
2
- import { Loadable } from "@allurereport/web-components";
3
- import { Text } from "@allurereport/web-components";
4
- import { clsx } from "clsx";
5
- import { type FunctionComponent } from "preact";
6
- import { ArrowButton } from "@/components/ArrowButton";
7
- import { statsStore } from "@/stores";
8
- import { treeFiltersStore } from "@/stores/tree";
9
- import * as styles from "./styles.scss";
10
-
11
- interface TreeHeaderProps {
12
- statistic?: Statistic;
13
- categoryTitle: string;
14
- isOpened: boolean;
15
- toggleTree: () => void;
16
- }
17
-
18
- const maxWidthTab = 140;
19
- const minWidthTab = 46;
20
- // to make the progress bar more visually responsive for smaller values,
21
- // we can adjust the formula by adding an offset to stretch the lower part
22
- // of the logarithmic scale
23
- const offset = 10;
24
-
25
- const progress = (current: number, total: number) => {
26
- const logOffset = Math.log(offset);
27
- return (Math.log(current + offset) - logOffset) / (Math.log(total + offset) - logOffset);
28
- };
29
-
30
- const TreeHeader: FunctionComponent<TreeHeaderProps> = ({
31
- categoryTitle,
32
- isOpened,
33
- toggleTree,
34
- statistic,
35
- ...rest
36
- }) => {
37
- const { status: statusFilter } = treeFiltersStore.value;
38
-
39
- return (
40
- <Loadable
41
- source={statsStore}
42
- renderData={(stats) => {
43
- const width = Math.floor(progress(statistic.total, stats.total) * (maxWidthTab - minWidthTab) + minWidthTab);
44
-
45
- const treeHeaderBar = statistic
46
- ? statusesList
47
- .map((status) => ({ status, value: statistic[status] }))
48
- .filter(
49
- ({ status, value }) =>
50
- value !== undefined && (statusFilter === "total" || (statusFilter === status && value > 0)),
51
- )
52
- .map(({ status, value }) => {
53
- const className = clsx(styles["tree-header-bar-item"], styles[status]);
54
- const style = { flexGrow: value };
55
-
56
- return (
57
- <div key={status} className={className} style={style}>
58
- {value}
59
- </div>
60
- );
61
- })
62
- : null;
63
-
64
- return (
65
- <div data-testid="tree-header" {...rest} className={styles["tree-header"]} onClick={toggleTree}>
66
- <ArrowButton data-testid="tree-arrow" isOpened={isOpened} />
67
- <Text data-testid="tree-header-title" size="m" bold className={styles["tree-header-title"]}>
68
- {categoryTitle}
69
- </Text>
70
- {treeHeaderBar && (
71
- <div className={styles["tree-header-bar"]} style={{ width: `${width}px` }}>
72
- {treeHeaderBar}
73
- </div>
74
- )}
75
- </div>
76
- );
77
- }}
78
- />
79
- );
80
- };
81
-
82
- export default TreeHeader;
@@ -1,35 +0,0 @@
1
- import { type TestStatus, formatDuration } from "@allurereport/core-api";
2
- import { Text } from "@allurereport/web-components";
3
- import type { FunctionComponent } from "preact";
4
- import TreeItemIcon from "@/components/Tree/TreeItemIcon";
5
- import { navigateTo } from "@/index";
6
- import * as styles from "./styles.scss";
7
-
8
- interface TreeItemProps {
9
- name: string;
10
- status: TestStatus;
11
- duration?: number;
12
- id: string;
13
- groupOrder: number;
14
- }
15
-
16
- export const TreeItem: FunctionComponent<TreeItemProps> = ({ name, groupOrder, status, duration, id, ...rest }) => {
17
- const formattedDuration = formatDuration(duration);
18
-
19
- return (
20
- <div {...rest} className={styles["tree-item"]} onClick={() => navigateTo(id)}>
21
- <TreeItemIcon status={status} />
22
- <span data-testid="tree-leaf-order" class={styles.order}>
23
- {groupOrder}
24
- </span>
25
- <Text data-testid="tree-leaf-title" className={styles["item-title"]}>
26
- {name}
27
- </Text>
28
- <Text data-testid="tree-leaf-duration" type="ui" size={"m"} className={styles["item-time"]}>
29
- {formattedDuration}
30
- </Text>
31
- </div>
32
- );
33
- };
34
-
35
- export default TreeItem;
@@ -1,32 +0,0 @@
1
- import { SvgIcon, allureIcons } from "@allurereport/web-components";
2
- import { clsx } from "clsx";
3
- import type { FunctionalComponent } from "preact";
4
- import * as styles from "./styles.scss";
5
-
6
- interface TestStatusIconProps {
7
- status?: "failed" | "broken" | "passed" | "skipped" | "unknown";
8
- className?: string;
9
- classNameIcon?: string;
10
- }
11
-
12
- const { solidAlertCircle, solidCheckCircle, solidHelpCircle, solidMinusCircle, solidXCircle } = allureIcons;
13
-
14
- const icons = {
15
- failed: solidXCircle,
16
- broken: solidAlertCircle,
17
- passed: solidCheckCircle,
18
- skipped: solidMinusCircle,
19
- unknown: solidHelpCircle,
20
- };
21
-
22
- const TreeItemIcon: FunctionalComponent<TestStatusIconProps> = ({ status = "unknown", className, classNameIcon }) => {
23
- const statusClass = clsx(styles[`status-${status}`], classNameIcon);
24
-
25
- return (
26
- <div data-testid={`tree-leaf-status-${status}`} className={clsx(styles["tree-item-icon"], className)}>
27
- <SvgIcon className={statusClass} id={icons[status]} />
28
- </div>
29
- );
30
- };
31
-
32
- export default TreeItemIcon;
@@ -1,124 +0,0 @@
1
- export const AVAILABLE_LOCALES = [
2
- "en",
3
- "ru",
4
- "pl",
5
- "es",
6
- "pt",
7
- "de",
8
- "am",
9
- "az",
10
- "fr",
11
- "it",
12
- "ja",
13
- "he",
14
- "ka",
15
- "kr",
16
- "nl",
17
- "sv",
18
- "tr",
19
- "zh",
20
- ] as const;
21
-
22
- export const DEFAULT_LOCALE = "en";
23
-
24
- export type LangLocale = (typeof AVAILABLE_LOCALES)[number];
25
-
26
- export const LANG_LOCALE: Record<
27
- LangLocale,
28
- {
29
- short: string;
30
- full: string;
31
- iso: string;
32
- }
33
- > = {
34
- en: {
35
- short: "Eng",
36
- full: "English",
37
- iso: "en-US",
38
- },
39
- ru: {
40
- short: "Ру",
41
- full: "Русский",
42
- iso: "ru-RU",
43
- },
44
- pl: {
45
- short: "Pl",
46
- full: "Polski",
47
- iso: "pl-PL",
48
- },
49
- es: {
50
- short: "Es",
51
- full: "Español",
52
- iso: "es-ES",
53
- },
54
- pt: {
55
- short: "Pt",
56
- full: "Português",
57
- iso: "pt-PT",
58
- },
59
- de: {
60
- short: "De",
61
- full: "Deutsch",
62
- iso: "de-DE",
63
- },
64
- am: {
65
- short: "Am",
66
- full: "Հայերեն",
67
- iso: "hy-AM",
68
- },
69
- az: {
70
- short: "Az",
71
- full: "Azərbaycan",
72
- iso: "az-AZ",
73
- },
74
- fr: {
75
- short: "Fr",
76
- full: "Français",
77
- iso: "fr-FR",
78
- },
79
- it: {
80
- short: "It",
81
- full: "Italiano",
82
- iso: "it-IT",
83
- },
84
- ja: {
85
- short: "Ja",
86
- full: "日本語",
87
- iso: "ja-JP",
88
- },
89
- he: {
90
- short: "He",
91
- full: "עברית",
92
- iso: "he-IL",
93
- },
94
- ka: {
95
- short: "Ka",
96
- full: "ქართული",
97
- iso: "ka-GE",
98
- },
99
- kr: {
100
- short: "Kr",
101
- full: "한국어",
102
- iso: "kr-KR",
103
- },
104
- nl: {
105
- short: "Nl",
106
- full: "Nederlands",
107
- iso: "nl-NL",
108
- },
109
- sv: {
110
- short: "Sv",
111
- full: "Svenska",
112
- iso: "sv-SE",
113
- },
114
- tr: {
115
- short: "Tr",
116
- full: "Türkçe",
117
- iso: "tr-TR",
118
- },
119
- zh: {
120
- short: "Zh",
121
- full: "中文",
122
- iso: "zh-CN",
123
- },
124
- };