@allurereport/web-awesome 3.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/.babelrc.js +46 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/CONTRIBUTING.md +34 -0
  4. package/README.md +27 -0
  5. package/dist/multi/141.app-d01d0c66.js +1 -0
  6. package/dist/multi/222.app-d01d0c66.js +1 -0
  7. package/dist/multi/335.app-d01d0c66.js +1 -0
  8. package/dist/multi/34.app-d01d0c66.js +1 -0
  9. package/dist/multi/349.app-d01d0c66.js +1 -0
  10. package/dist/multi/378.app-d01d0c66.js +1 -0
  11. package/dist/multi/406.app-d01d0c66.js +1 -0
  12. package/dist/multi/476.app-d01d0c66.js +1 -0
  13. package/dist/multi/53.app-d01d0c66.js +1 -0
  14. package/dist/multi/584.app-d01d0c66.js +1 -0
  15. package/dist/multi/690.app-d01d0c66.js +1 -0
  16. package/dist/multi/747.app-d01d0c66.js +1 -0
  17. package/dist/multi/767.app-d01d0c66.js +1 -0
  18. package/dist/multi/816.app-d01d0c66.js +1 -0
  19. package/dist/multi/83.app-d01d0c66.js +1 -0
  20. package/dist/multi/873.app-d01d0c66.js +1 -0
  21. package/dist/multi/920.app-d01d0c66.js +1 -0
  22. package/dist/multi/991.app-d01d0c66.js +1 -0
  23. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  24. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  25. package/dist/multi/app-d01d0c66.js +2 -0
  26. package/dist/multi/app-d01d0c66.js.LICENSE.txt +16 -0
  27. package/dist/multi/manifest.json +26 -0
  28. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  29. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  30. package/dist/multi/styles-d01d0c66.css +39 -0
  31. package/dist/single/app-6596cb08.js +2 -0
  32. package/dist/single/app-6596cb08.js.LICENSE.txt +16 -0
  33. package/dist/single/manifest.json +3 -0
  34. package/package.json +107 -0
  35. package/postcss.config.js +5 -0
  36. package/src/assets/scss/_common.scss +143 -0
  37. package/src/assets/scss/day.scss +51 -0
  38. package/src/assets/scss/fonts.scss +3 -0
  39. package/src/assets/scss/index.scss +7 -0
  40. package/src/assets/scss/night.scss +61 -0
  41. package/src/assets/scss/palette.scss +393 -0
  42. package/src/assets/scss/theme.scss +119 -0
  43. package/src/assets/scss/vars.scss +9 -0
  44. package/src/assets/svg/line-alerts-alert-circle.svg +12 -0
  45. package/src/assets/svg/line-general-eye.svg +7 -0
  46. package/src/assets/svg/line-icon-bomb-2.svg +12 -0
  47. package/src/components/ArrowButton/index.tsx +36 -0
  48. package/src/components/ArrowButton/styles.scss +35 -0
  49. package/src/components/BaseLayout/index.tsx +43 -0
  50. package/src/components/BaseLayout/styles.scss +60 -0
  51. package/src/components/Footer/FooterLogo.tsx +16 -0
  52. package/src/components/Footer/FooterVersion.tsx +37 -0
  53. package/src/components/Footer/index.tsx +13 -0
  54. package/src/components/Footer/styles.scss +14 -0
  55. package/src/components/Header/index.tsx +28 -0
  56. package/src/components/Header/styles.scss +33 -0
  57. package/src/components/LanguagePicker/index.tsx +40 -0
  58. package/src/components/MainReport/index.tsx +21 -0
  59. package/src/components/MainReport/styles.scss +11 -0
  60. package/src/components/Metadata/index.tsx +121 -0
  61. package/src/components/Metadata/styles.scss +146 -0
  62. package/src/components/MetadataButton/index.tsx +32 -0
  63. package/src/components/MetadataButton/styles.scss +53 -0
  64. package/src/components/Modal/index.tsx +22 -0
  65. package/src/components/ReportBody/Filters.tsx +90 -0
  66. package/src/components/ReportBody/HeaderActions.tsx +21 -0
  67. package/src/components/ReportBody/SortBy.tsx +132 -0
  68. package/src/components/ReportBody/context.tsx +106 -0
  69. package/src/components/ReportBody/index.tsx +72 -0
  70. package/src/components/ReportBody/styles.scss +69 -0
  71. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  72. package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
  73. package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
  74. package/src/components/ReportHeader/index.tsx +33 -0
  75. package/src/components/ReportHeader/styles.scss +51 -0
  76. package/src/components/ReportLogo/index.tsx +16 -0
  77. package/src/components/ReportLogo/styles.scss +20 -0
  78. package/src/components/ReportLogoFull/index.tsx +20 -0
  79. package/src/components/ReportLogoFull/styles.scss +7 -0
  80. package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
  81. package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
  82. package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
  83. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  84. package/src/components/ReportMetadata/index.tsx +46 -0
  85. package/src/components/ReportMetadata/styles.scss +99 -0
  86. package/src/components/SideBySide/index.tsx +52 -0
  87. package/src/components/SideBySide/styles.scss +65 -0
  88. package/src/components/SplitLayout/index.tsx +77 -0
  89. package/src/components/SplitLayout/styles.scss +85 -0
  90. package/src/components/Tabs/index.tsx +62 -0
  91. package/src/components/Tabs/styles.scss +56 -0
  92. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  93. package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  94. package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
  95. package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
  96. package/src/components/TestResult/TestResultDropdown/index.tsx +26 -0
  97. package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
  98. package/src/components/TestResult/TestResultEmpty/index.tsx +34 -0
  99. package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
  100. package/src/components/TestResult/TestResultHeader/TestResultBreadcrumbs.tsx +44 -0
  101. package/src/components/TestResult/TestResultHeader/index.tsx +21 -0
  102. package/src/components/TestResult/TestResultHeader/styles.scss +48 -0
  103. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +66 -0
  104. package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
  105. package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
  106. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
  107. package/src/components/TestResult/TestResultInfo/index.tsx +81 -0
  108. package/src/components/TestResult/TestResultInfo/styles.scss +68 -0
  109. package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
  110. package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
  111. package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
  112. package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
  113. package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
  114. package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
  115. package/src/components/TestResult/TestResultOverview.tsx +43 -0
  116. package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
  117. package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
  118. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
  119. package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  120. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +51 -0
  121. package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
  122. package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
  123. package/src/components/TestResult/TestResultSetup/index.tsx +58 -0
  124. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  125. package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
  126. package/src/components/TestResult/TestResultStatus/index.tsx +25 -0
  127. package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
  128. package/src/components/TestResult/TestResultSteps/index.tsx +58 -0
  129. package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
  130. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +76 -0
  131. package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
  132. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +84 -0
  133. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  134. package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  135. package/src/components/TestResult/TestResultTabs/index.tsx +68 -0
  136. package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
  137. package/src/components/TestResult/TestResultTeardown/index.tsx +59 -0
  138. package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
  139. package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
  140. package/src/components/TestResult/TrError/TrDiff.tsx +124 -0
  141. package/src/components/TestResult/TrError/index.tsx +78 -0
  142. package/src/components/TestResult/TrError/styles.scss +133 -0
  143. package/src/components/TestResult/index.tsx +62 -0
  144. package/src/components/TestResult/styles.scss +11 -0
  145. package/src/components/ThemeButton/ThemeButton.tsx +20 -0
  146. package/src/components/ToggleLayout/index.tsx +17 -0
  147. package/src/components/Tree/index.tsx +75 -0
  148. package/src/components/Tree/styles.scss +189 -0
  149. package/src/i18n/constants.ts +124 -0
  150. package/src/i18n/locales/am.json +133 -0
  151. package/src/i18n/locales/az.json +133 -0
  152. package/src/i18n/locales/de.json +133 -0
  153. package/src/i18n/locales/en.json +134 -0
  154. package/src/i18n/locales/es.json +133 -0
  155. package/src/i18n/locales/fr.json +133 -0
  156. package/src/i18n/locales/he.json +133 -0
  157. package/src/i18n/locales/it.json +133 -0
  158. package/src/i18n/locales/ja.json +133 -0
  159. package/src/i18n/locales/ka.json +133 -0
  160. package/src/i18n/locales/kr.json +133 -0
  161. package/src/i18n/locales/nl.json +133 -0
  162. package/src/i18n/locales/pl.json +131 -0
  163. package/src/i18n/locales/pt.json +133 -0
  164. package/src/i18n/locales/ru.json +131 -0
  165. package/src/i18n/locales/sv.json +133 -0
  166. package/src/i18n/locales/tr.json +133 -0
  167. package/src/i18n/locales/zh.json +133 -0
  168. package/src/index.html +40 -0
  169. package/src/index.tsx +96 -0
  170. package/src/stores/chart.ts +32 -0
  171. package/src/stores/envInfo.ts +34 -0
  172. package/src/stores/index.ts +4 -0
  173. package/src/stores/layout.ts +36 -0
  174. package/src/stores/locale.ts +75 -0
  175. package/src/stores/modal.ts +22 -0
  176. package/src/stores/router.ts +48 -0
  177. package/src/stores/stats.ts +36 -0
  178. package/src/stores/testResults.ts +66 -0
  179. package/src/stores/theme.ts +32 -0
  180. package/src/stores/tree.ts +157 -0
  181. package/src/stores/types.ts +5 -0
  182. package/src/styles.scss +45 -0
  183. package/src/types/globals.d.ts +13 -0
  184. package/src/types/window.d.ts +8 -0
  185. package/src/utils/capitalize.ts +6 -0
  186. package/src/utils/copyToClipboard.ts +16 -0
  187. package/src/utils/isMac.ts +8 -0
  188. package/src/utils/loadFromLocalStorage.ts +8 -0
  189. package/src/utils/statuses.ts +55 -0
  190. package/src/utils/time.ts +17 -0
  191. package/src/utils/treeFilters.ts +147 -0
  192. package/test/utils/treeFilters.test.ts +448 -0
  193. package/tsconfig.json +27 -0
  194. package/types.d.ts +99 -0
  195. package/vitest.config.ts +18 -0
  196. package/webpack.config.js +112 -0
@@ -0,0 +1,56 @@
1
+ .tabsList {
2
+ background-color: var(--bg-base-secondary);
3
+ padding: 2px;
4
+ border-radius: 8px;
5
+ display: flex;
6
+ overflow-x: auto;
7
+ flex-grow: 0;
8
+ max-width: max-content;
9
+ }
10
+
11
+ .tab {
12
+ background-color: var(--bg-control-flat);
13
+ color: var(--on-text-primary);
14
+ border-radius: 6px;
15
+ border: 1px solid transparent;
16
+ padding: 2px 8px;
17
+ margin: 0;
18
+ cursor: pointer;
19
+ user-select: none;
20
+ flex-shrink: 0;
21
+ transform: scale(1);
22
+ outline-offset: 1px;
23
+ outline: 1px solid transparent;
24
+ transition:
25
+ transform var(--interaction-transition-duration) ease-out,
26
+ outline var(--interaction-transition-duration) ease-out,
27
+ background-color var(--color-change-transition-duration),
28
+ border-color var(--color-change-transition-duration);
29
+
30
+ &[aria-current] {
31
+ background-color: var(--bg-base-modal);
32
+ border-color: var(--on-border-primary);
33
+ cursor: default;
34
+ }
35
+
36
+ &:hover:not([aria-current]) {
37
+ background-color: var(--bg-control-flat-medium);
38
+ }
39
+
40
+ &:active:not([aria-current]) {
41
+ background-color: var(--bg-control-flat-heavy);
42
+ transform: scale(0.94);
43
+ }
44
+
45
+ &:focus {
46
+ outline: 1px solid transparent;
47
+ }
48
+
49
+ &:focus-visible {
50
+ outline: 1px solid var(--ad-other-focus);
51
+
52
+ &:not([aria-current]) {
53
+ background-color: var(--bg-control-flat-medium);
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,27 @@
1
+ import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
+ import type { FunctionalComponent } from "preact";
3
+ import type { AwesomeTestResult } from "types";
4
+ import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
5
+ import { useI18n } from "@/stores";
6
+ import * as styles from "./styles.scss";
7
+
8
+ export type TestResultAttachmentViewProps = {
9
+ testResult?: AwesomeTestResult;
10
+ };
11
+
12
+ export const TestResultAttachmentView: FunctionalComponent<TestResultAttachmentViewProps> = ({ testResult }) => {
13
+ const { attachments } = testResult ?? {};
14
+ const { t } = useI18n("empty");
15
+
16
+ return (
17
+ <div className={styles["test-result-attachments-view"]}>
18
+ {attachments.length ? (
19
+ attachments?.map((attach, key) => (
20
+ <TestResultAttachment item={attach as AttachmentTestStepResult} key={key} stepIndex={key + 1} />
21
+ ))
22
+ ) : (
23
+ <div className={styles["test-result-empty"]}>{t("no-attachments-results")}</div>
24
+ )}
25
+ </div>
26
+ );
27
+ };
@@ -0,0 +1,12 @@
1
+ .test-result-attachments-view {
2
+ padding: 12px 24px 32px;
3
+ min-height: 320px;
4
+ }
5
+
6
+ .test-result-empty {
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ padding: 48px 0;
11
+ width: 100%;
12
+ }
@@ -0,0 +1,27 @@
1
+ import { Text } from "@allurereport/web-components";
2
+ import type { FunctionalComponent } from "preact";
3
+ import { useState } from "preact/hooks";
4
+ import type { AwesomeTestResult } from "types";
5
+ import { MetadataButton } from "@/components/MetadataButton";
6
+ import * as styles from "./styles.scss";
7
+
8
+ export type TestResultDescriptionProps = {
9
+ description: AwesomeTestResult["description"];
10
+ };
11
+
12
+ export const TestResultDescription: FunctionalComponent<TestResultDescriptionProps> = ({ description }) => {
13
+ const [isOpen, setIsOpen] = useState<boolean>(true);
14
+
15
+ return (
16
+ <div className={styles["test-result-description"]}>
17
+ <div className={styles["test-result-description-wrapper"]}>
18
+ <MetadataButton title={"Description"} setIsOpen={setIsOpen} isOpened={isOpen} />
19
+ {isOpen && (
20
+ <Text tag={"p"} className={styles["test-result-description-text"]}>
21
+ {description || "Description mock"}
22
+ </Text>
23
+ )}
24
+ </div>
25
+ </div>
26
+ );
27
+ };
@@ -0,0 +1,12 @@
1
+ .test-result-description {
2
+ padding: 0 24px;
3
+ }
4
+
5
+ .test-result-description-wrapper {
6
+ padding: 16px 0;
7
+ border-bottom: 1px solid var(--on-border-primary);
8
+ }
9
+
10
+ .test-result-description-text {
11
+ padding-top: 10px;
12
+ }
@@ -0,0 +1,26 @@
1
+ import { Counter, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import type { ClassValue } from "clsx";
3
+ import clsx from "clsx";
4
+ import { type FunctionalComponent } from "preact";
5
+ import { ArrowButton } from "@/components/ArrowButton";
6
+ import * as styles from "./styles.scss";
7
+
8
+ export const TestResultDropdown: FunctionalComponent<{
9
+ isOpened: boolean;
10
+ setIsOpen: (isOpened: boolean) => void;
11
+ title: string;
12
+ icon: string;
13
+ counter: number;
14
+ className?: ClassValue;
15
+ }> = ({ isOpened, setIsOpen, title, icon, counter, className }) => {
16
+ return (
17
+ <div className={clsx(styles["test-result-dropdown"], className)} onClick={() => setIsOpen(!isOpened)}>
18
+ <ArrowButton isOpened={isOpened} icon={allureIcons.arrowsChevronDown} />
19
+ <div className={styles["test-result-dropdown-wrap"]}>
20
+ <SvgIcon id={icon} />
21
+ <Text bold>{title}</Text>
22
+ <Counter count={counter} size="s" />
23
+ </div>
24
+ </div>
25
+ );
26
+ };
@@ -0,0 +1,34 @@
1
+ .test-result-dropdown {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ padding: 1px 8px 1px 6px;
5
+ border-radius: 6px;
6
+ transition: background-color 300ms;
7
+ align-items: center;
8
+ cursor: pointer;
9
+ width: 100%;
10
+ }
11
+
12
+ .test-result-step-chevron {
13
+ width: 12px;
14
+ height: 12px;
15
+ transform: rotate(-90deg);
16
+ transition: transform 200ms;
17
+ }
18
+
19
+ .test-result-step-chevron-open {
20
+ transform: rotate(0deg);
21
+ }
22
+
23
+ .test-result-dropdown-wrap {
24
+ display: flex;
25
+ gap: 8px;
26
+ width: 100%;
27
+ align-items: center;
28
+ padding: 6px 8px 6px 6px;
29
+ border-radius: 4px;
30
+
31
+ &:hover {
32
+ background: var(--bg-control-flat-medium);
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import * as baseStyles from "@/components/BaseLayout/styles.scss";
3
+ import { TestResultInfo } from "@/components/TestResult/TestResultInfo";
4
+ import { useI18n } from "@/stores";
5
+ import * as styles from "./styles.scss";
6
+
7
+ const TestResultThumb = () => {
8
+ const { t } = useI18n("empty");
9
+ return (
10
+ <div className={styles["test-result-thumb"]}>
11
+ <div className={styles["test-result-thumb-wrapper"]}>
12
+ <SvgIcon
13
+ size={"m"}
14
+ width={"32px"}
15
+ height={"32px"}
16
+ id={allureIcons.lineDevCodeSquare}
17
+ className={styles["test-result-thumb-icon"]}
18
+ />
19
+ <Text className={styles["test-result-thumb-text"]}>{t("no-test-case-results")}</Text>
20
+ </div>
21
+ </div>
22
+ );
23
+ };
24
+
25
+ const TestResultEmpty = () => {
26
+ return (
27
+ <div className={baseStyles.content}>
28
+ <TestResultInfo />
29
+ <TestResultThumb />
30
+ </div>
31
+ );
32
+ };
33
+
34
+ export default TestResultEmpty;
@@ -0,0 +1,25 @@
1
+ .test-result-thumb {
2
+ display: flex;
3
+ justify-content: center;
4
+ flex-wrap: wrap;
5
+ min-height: 720px;
6
+ align-items: center;
7
+ }
8
+
9
+ .test-result-thumb-wrapper {
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: center;
13
+ }
14
+
15
+ .test-result-thumb-icon {
16
+ width: 32px;
17
+ height: 32px;
18
+ margin-bottom: 16px;
19
+ flex: 1 1 auto;
20
+ }
21
+
22
+ .test-result-thumb-text {
23
+ color: var(--on-text-secondary);
24
+ flex: 1 1 auto;
25
+ }
@@ -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/TestResultHeader/styles.scss";
5
+ import { navigateTo } from "@/stores/router";
6
+
7
+ interface TestResultBreadcrumbsProps {
8
+ testResult?: AwesomeTestResult;
9
+ }
10
+
11
+ export const TestResultBreadcrumbs = ({ testResult }: TestResultBreadcrumbsProps) => {
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,21 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import { LanguagePicker } from "@/components/LanguagePicker";
3
+ import type { TestResultProps } from "@/components/TestResult";
4
+ import { TestResultBreadcrumbs } from "@/components/TestResult/TestResultHeader/TestResultBreadcrumbs";
5
+ import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
6
+ import ToggleLayout from "@/components/ToggleLayout";
7
+ import { isSplitMode } from "@/stores/layout";
8
+ import * as styles from "./styles.scss";
9
+
10
+ export const TestResultHeader: FunctionalComponent<TestResultProps> = ({ testResult }) => {
11
+ return (
12
+ <div className={styles.above}>
13
+ {!isSplitMode.value ? <TestResultBreadcrumbs testResult={testResult} /> : ""}
14
+ <div className={styles.right}>
15
+ <LanguagePicker />
16
+ <ToggleLayout />
17
+ <ThemeButton />
18
+ </div>
19
+ </div>
20
+ );
21
+ };
@@ -0,0 +1,48 @@
1
+ .test-result-breadcrumbs {
2
+ margin-right: auto;
3
+ display: flex;
4
+ gap: 4px;
5
+ overflow: hidden;
6
+ white-space: nowrap;
7
+ text-overflow: ellipsis;
8
+ }
9
+ .test-result-home {
10
+ flex: none;
11
+ }
12
+
13
+ .test-result-breadcrumb-link {
14
+ color: var(--on-text-secondary);
15
+ }
16
+
17
+ .test-result-breadcrumb {
18
+ display: flex;
19
+ gap: 4px;
20
+ color: var(--on-text-secondary);
21
+ white-space: nowrap;
22
+ text-overflow: ellipsis;
23
+ overflow: hidden;
24
+ align-items: center;
25
+ }
26
+
27
+ .test-result-breadcrumb-title {
28
+ white-space: nowrap;
29
+ text-overflow: ellipsis;
30
+ overflow: hidden;
31
+ }
32
+
33
+ .above {
34
+ margin-bottom: 12px;
35
+ display: flex;
36
+ width: 100%;
37
+ justify-content: space-between;
38
+ align-items: center;
39
+ gap: 4px;
40
+ }
41
+ .right {
42
+ margin-left: auto;
43
+ display: flex;
44
+ gap: 4px;
45
+ }
46
+ .test-result-breadcrumb-arrow {
47
+ transform: rotate(-90deg);
48
+ }
@@ -0,0 +1,66 @@
1
+ import { type HistoryTestResult, formatDuration } from "@allurereport/core-api";
2
+ import { IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
3
+ import { type FunctionalComponent } from "preact";
4
+ import { useState } from "preact/hooks";
5
+ import { ArrowButton } from "@/components/ArrowButton";
6
+ import * as styles from "@/components/TestResult/TestResultHistory/styles.scss";
7
+ import { TrError } from "@/components/TestResult/TrError";
8
+ import { useI18n } from "@/stores";
9
+ import { navigateTo, openInNewTab } from "@/stores/router";
10
+ import { timestampToDate } from "@/utils/time";
11
+
12
+ export const TestResultHistoryItem: FunctionalComponent<{
13
+ testResultItem: HistoryTestResult;
14
+ }> = ({ testResultItem }: { testResultItem: HistoryTestResult }) => {
15
+ const { status, error, stop, duration, id } = testResultItem;
16
+ const [isOpened, setIsOpen] = useState(false);
17
+ const convertedStop = timestampToDate(stop);
18
+ const formattedDuration = formatDuration(duration as number);
19
+ const { t } = useI18n("controls");
20
+
21
+ const navigateUrl = id;
22
+
23
+ return (
24
+ <div>
25
+ <div className={styles["test-result-history-item-header"]}>
26
+ {Boolean(error) && (
27
+ <span onClick={() => setIsOpen(!isOpened)}>
28
+ <ArrowButton isOpened={isOpened} icon={allureIcons.arrowsChevronDown} />
29
+ </span>
30
+ )}
31
+ <div
32
+ className={styles["test-result-history-item-wrap"]}
33
+ onClick={(e) => {
34
+ e.stopPropagation();
35
+ navigateTo(navigateUrl);
36
+ }}
37
+ >
38
+ <TreeItemIcon status={status} className={styles["test-result-history-item-status"]} />
39
+ <Text className={styles["test-result-history-item-text"]}>{convertedStop}</Text>
40
+ <div className={styles["test-result-history-item-info"]}>
41
+ <Text type="ui" size={"s"} className={styles["item-time"]}>
42
+ {formattedDuration}
43
+ </Text>
44
+ <TooltipWrapper tooltipText={t("openInNewTab")}>
45
+ <IconButton
46
+ icon={allureIcons.lineGeneralLinkExternal}
47
+ style={"ghost"}
48
+ size={"s"}
49
+ className={styles["test-result-history-item-link"]}
50
+ onClick={(e) => {
51
+ e.stopPropagation();
52
+ openInNewTab(navigateUrl);
53
+ }}
54
+ />
55
+ </TooltipWrapper>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ {isOpened && error && (
60
+ <div>
61
+ <TrError {...error} />
62
+ </div>
63
+ )}
64
+ </div>
65
+ );
66
+ };
@@ -0,0 +1,26 @@
1
+ import type { FunctionalComponent } from "preact";
2
+ import { TestResultHistoryItem } from "@/components/TestResult/TestResultHistory/TestResultHistoryItem";
3
+ import { useI18n } from "@/stores";
4
+ import { type AwesomeTestResult } from "../../../../types";
5
+ import * as styles from "./styles.scss";
6
+
7
+ export type TestResultHistoryViewProps = {
8
+ testResult?: AwesomeTestResult;
9
+ };
10
+
11
+ const TestResultHistoryView: FunctionalComponent<TestResultHistoryViewProps> = ({ testResult }) => {
12
+ const { history } = testResult ?? {};
13
+ const { t } = useI18n("empty");
14
+
15
+ return (
16
+ <div className={styles["test-result-history"]}>
17
+ {history.length ? (
18
+ history?.map((item, key) => <TestResultHistoryItem testResultItem={item} key={key} />)
19
+ ) : (
20
+ <div className={styles["test-result-empty"]}>{t("no-history-results")}</div>
21
+ )}
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default TestResultHistoryView;
@@ -0,0 +1,63 @@
1
+ .test-result-history {
2
+ padding: 12px 24px 32px;
3
+ min-height: 320px;
4
+ }
5
+
6
+ .test-result-history-item-header {
7
+ display: flex;
8
+ width: 100%;
9
+ gap: 4px;
10
+ align-items: center;
11
+ cursor: pointer;
12
+ }
13
+
14
+ .test-result-history-item-wrap {
15
+ transition: background-color 300ms;
16
+ display: flex;
17
+ gap: 4px;
18
+ justify-content: space-between;
19
+ border-radius: 6px;
20
+ padding: 4px 4px 4px 4px;
21
+ width: 100%;
22
+ align-items: flex-start;
23
+
24
+ &:hover {
25
+ background: var(--bg-control-flat-medium);
26
+ }
27
+ }
28
+
29
+ .test-result-history-item-text {
30
+ padding-top: 2px;
31
+ }
32
+
33
+ .test-result-history-item-info {
34
+ display: flex;
35
+ gap: 4px;
36
+ align-items: center;
37
+ margin-left: auto;
38
+ }
39
+
40
+ .item-time {
41
+ margin-left: auto;
42
+ line-height: 20px;
43
+ color: var(--on-text-secondary);
44
+ }
45
+
46
+ .test-result-history-item-link {
47
+ :root {
48
+ --allure-btn-icon-color: var(--bg-control-flat);
49
+ }
50
+
51
+ color: var(--on-icon-secondary);
52
+ }
53
+
54
+ .test-result-history-item-status {
55
+ padding-top: 4px;
56
+ }
57
+
58
+ .test-result-empty {
59
+ display: flex;
60
+ padding: 48px 0;
61
+ width: 100%;
62
+ justify-content: center;
63
+ }
@@ -0,0 +1,30 @@
1
+ import { SvgIcon, allureIcons } from "@allurereport/web-components";
2
+ import { type FunctionalComponent } from "preact";
3
+ import { useI18n } from "@/stores";
4
+ import { capitalize } from "@/utils/capitalize";
5
+ import * as styles from "./styles.scss";
6
+
7
+ const icons: Record<string, string> = {
8
+ flaky: allureIcons.lineIconBomb2,
9
+ known: allureIcons.lineAlertsAlertCircle,
10
+ muted: allureIcons.lineGeneralEye,
11
+ };
12
+
13
+ export const TestResultInfoStatuses: FunctionalComponent<{ statuses: [string, boolean][] }> = ({ statuses }) => {
14
+ const { t } = useI18n("filters");
15
+
16
+ return (
17
+ <div className={styles["test-result-info-statuses"]}>
18
+ {statuses.map(([status], key: number) => {
19
+ const title = t(status);
20
+
21
+ return (
22
+ <div key={key} className={styles["test-result-info-status"]}>
23
+ <SvgIcon className={styles["metadata-icon"]} id={icons[status]} size={"s"} />
24
+ {capitalize(title)}
25
+ </div>
26
+ );
27
+ })}
28
+ </div>
29
+ );
30
+ };
@@ -0,0 +1,81 @@
1
+ import { formatDuration } from "@allurereport/core-api";
2
+ import { Counter, Heading, Text, TooltipWrapper } from "@allurereport/web-components";
3
+ import clsx from "clsx";
4
+ import type { FunctionalComponent } from "preact";
5
+ import type { AwesomeTestResult } from "types";
6
+ import { TestResultInfoStatuses } from "@/components/TestResult/TestResultInfo/TestResultInfoStatuses";
7
+ import { TestResultNavigation } from "@/components/TestResult/TestResultNavigation";
8
+ import { TestResultPrevStatuses } from "@/components/TestResult/TestResultPrevStatuses";
9
+ import { TestResultSeverity } from "@/components/TestResult/TestResultSeverity";
10
+ import { TestResultStatus } from "@/components/TestResult/TestResultStatus";
11
+ import { TestResultTab, TestResultTabsList } from "@/components/TestResult/TestResultTabs";
12
+ import { isSplitMode } from "@/stores/layout";
13
+ import { useI18n } from "@/stores/locale";
14
+ import { timestampToDate } from "@/utils/time";
15
+ import * as styles from "./styles.scss";
16
+
17
+ export type TestResultInfoProps = {
18
+ testResult?: AwesomeTestResult;
19
+ };
20
+
21
+ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testResult }) => {
22
+ const { name, status, muted, flaky, known, duration, labels, history, retries, attachments, stop } = testResult ?? {};
23
+ const formattedDuration = formatDuration(duration as number);
24
+ const fullDate = stop && timestampToDate(stop);
25
+ const severity = labels?.find((label) => label.name === "severity")?.value ?? "normal";
26
+ const { t } = useI18n("ui");
27
+ const statuses = Object.entries({ flaky, muted, known }).filter(([, value]) => value);
28
+
29
+ const Content = () => {
30
+ return (
31
+ <>
32
+ {name && (
33
+ <Heading data-testid="test-result-info-title" tag={"h1"} size={"s"} className={styles["test-result-name"]}>
34
+ {name}
35
+ </Heading>
36
+ )}
37
+ <div className={styles["test-result-info-data"]}>
38
+ {Boolean(status) && <TestResultStatus status={status} />}
39
+ {Boolean(history?.length) && <TestResultPrevStatuses history={history} />}
40
+ <TestResultSeverity severity={severity} />
41
+ {Boolean(statuses.length) && <TestResultInfoStatuses statuses={statuses} />}
42
+ <TooltipWrapper tooltipText={fullDate}>
43
+ <Text tag={"div"} size={"s"} bold className={styles["test-result-duration"]}>
44
+ {formattedDuration}
45
+ </Text>
46
+ </TooltipWrapper>
47
+ </div>
48
+ <div className={styles["test-result-tabs"]}>
49
+ <TestResultTabsList>
50
+ <TestResultTab id="overview">{t("overview")}</TestResultTab>
51
+ <TestResultTab id="history" disabled={!history?.length}>
52
+ <div className={styles["test-result-tab"]}>
53
+ {t("history")}
54
+ {Boolean(history?.length) && <Counter size={"s"} count={history?.length} />}
55
+ </div>
56
+ </TestResultTab>
57
+ <TestResultTab id="retries" disabled={!retries?.length}>
58
+ <div className={styles["test-result-tab"]}>
59
+ {t("retries")}
60
+ {Boolean(retries?.length) && <Counter size={"s"} count={retries?.length} />}
61
+ </div>
62
+ </TestResultTab>
63
+ <TestResultTab id="attachments" disabled={!attachments?.length}>
64
+ <div className={styles["test-result-tab"]}>
65
+ {t("attachments")}
66
+ {Boolean(attachments?.length) && <Counter size={"s"} count={attachments?.length} />}
67
+ </div>
68
+ </TestResultTab>
69
+ </TestResultTabsList>
70
+ </div>
71
+ </>
72
+ );
73
+ };
74
+
75
+ return (
76
+ <div className={clsx(styles["test-result-info"], isSplitMode.value && styles.sticky)}>
77
+ <TestResultNavigation testResult={testResult} />
78
+ {testResult && <Content />}
79
+ </div>
80
+ );
81
+ };