@allurereport/web-awesome 3.0.0-beta.10 → 3.0.0-beta.12

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 (167) hide show
  1. package/dist/multi/173.app-52d1decd.js +1 -0
  2. package/dist/multi/174.app-52d1decd.js +1 -0
  3. package/dist/multi/252.app-52d1decd.js +1 -0
  4. package/dist/multi/282.app-52d1decd.js +1 -0
  5. package/dist/multi/29.app-52d1decd.js +1 -0
  6. package/dist/multi/416.app-52d1decd.js +1 -0
  7. package/dist/multi/527.app-52d1decd.js +1 -0
  8. package/dist/multi/600.app-52d1decd.js +1 -0
  9. package/dist/multi/605.app-52d1decd.js +1 -0
  10. package/dist/multi/638.app-52d1decd.js +1 -0
  11. package/dist/multi/672.app-52d1decd.js +1 -0
  12. package/dist/multi/686.app-52d1decd.js +1 -0
  13. package/dist/multi/725.app-52d1decd.js +1 -0
  14. package/dist/multi/741.app-52d1decd.js +1 -0
  15. package/dist/multi/755.app-52d1decd.js +1 -0
  16. package/dist/multi/894.app-52d1decd.js +1 -0
  17. package/dist/multi/943.app-52d1decd.js +1 -0
  18. package/dist/multi/980.app-52d1decd.js +1 -0
  19. package/dist/multi/app-52d1decd.js +2 -0
  20. package/dist/multi/{app-d01d0c66.js.LICENSE.txt → app-52d1decd.js.LICENSE.txt} +7 -0
  21. package/dist/multi/manifest.json +20 -20
  22. package/dist/multi/styles-52d1decd.css +41 -0
  23. package/dist/single/app-83b0c4fc.js +2 -0
  24. package/dist/single/{app-6596cb08.js.LICENSE.txt → app-83b0c4fc.js.LICENSE.txt} +7 -0
  25. package/dist/single/manifest.json +1 -1
  26. package/package.json +4 -4
  27. package/src/assets/scss/palette.scss +391 -391
  28. package/src/assets/scss/theme.scss +9 -1
  29. package/src/assets/scss/vars.scss +0 -1
  30. package/src/components/BaseLayout/styles.scss +10 -2
  31. package/src/components/EnvironmentPicker/index.tsx +51 -0
  32. package/src/components/EnvironmentPicker/styles.scss +9 -0
  33. package/src/components/Footer/FooterLogo.tsx +1 -2
  34. package/src/components/Header/index.tsx +4 -10
  35. package/src/components/HeaderControls/index.tsx +20 -0
  36. package/src/components/MainReport/styles.scss +2 -1
  37. package/src/components/Metadata/index.tsx +6 -4
  38. package/src/components/MetadataButton/index.tsx +12 -4
  39. package/src/components/MetadataButton/styles.scss +3 -0
  40. package/src/components/ReportBody/index.tsx +3 -2
  41. package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
  42. package/src/components/ReportHeader/ReportHeaderPie.tsx +1 -2
  43. package/src/components/ReportMetadata/MetadataSummary.tsx +56 -63
  44. package/src/components/ReportMetadata/MetadataWithIcon.tsx +1 -1
  45. package/src/components/ReportMetadata/index.tsx +50 -3
  46. package/src/components/SideBySide/styles.scss +2 -3
  47. package/src/components/SplitLayout/index.tsx +2 -2
  48. package/src/components/SplitLayout/styles.scss +2 -1
  49. package/src/components/TestResult/TestStepsEmpty/index.tsx +2 -2
  50. package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/index.tsx +4 -4
  51. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +2 -2
  52. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +1 -1
  53. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +6 -6
  54. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  55. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  56. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  57. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  58. package/src/components/TestResult/TrError/TrDiff.tsx +3 -5
  59. package/src/components/TestResult/TrError/index.tsx +21 -6
  60. package/src/components/TestResult/TrError/styles.scss +92 -2
  61. package/src/components/TestResult/{TestResultHeader/TestResultBreadcrumbs.tsx → TrHeader/TrBreadcrumbs.tsx} +3 -3
  62. package/src/components/TestResult/TrHeader/index.tsx +15 -0
  63. package/src/components/TestResult/{TestResultHistory/TestResultHistoryItem.tsx → TrHistory/TrHistoryItem.tsx} +3 -3
  64. package/src/components/TestResult/{TestResultHistory → TrHistory}/index.tsx +5 -5
  65. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +1 -1
  66. package/src/components/TestResult/{TestResultInfo → TrInfo}/index.tsx +37 -23
  67. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +6 -6
  68. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +4 -4
  69. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +3 -2
  70. package/src/components/TestResult/TrOverview.tsx +47 -0
  71. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +2 -2
  72. package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/index.tsx +6 -6
  73. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  74. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +33 -0
  75. package/src/components/TestResult/TrPwTraces/index.tsx +29 -0
  76. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  77. package/src/components/TestResult/{TestResultRetriesView/TestResultRetriesItem.tsx → TrRetriesView/TrRetriesItem.tsx} +3 -3
  78. package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/index.tsx +4 -6
  79. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +11 -11
  80. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +1 -1
  81. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +3 -2
  82. package/src/components/TestResult/{TestResultSteps/testResultAttachment.tsx → TrSteps/TrAttachment.tsx} +10 -7
  83. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +8 -8
  84. package/src/components/TestResult/{TestResultSteps/testResultStep.tsx → TrSteps/TrStep.tsx} +25 -14
  85. package/src/components/TestResult/{TestResultSteps/testResultStepInfo.tsx → TrSteps/TrStepInfo.tsx} +2 -2
  86. package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +8 -8
  87. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +2 -1
  88. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  89. package/src/components/TestResult/{TestResultTabs → TrTabs}/index.tsx +6 -6
  90. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +11 -11
  91. package/src/components/TestResult/index.tsx +42 -30
  92. package/src/components/TestResult/styles.scss +2 -1
  93. package/src/components/Tree/index.tsx +99 -16
  94. package/src/components/Tree/styles.scss +16 -1
  95. package/src/index.tsx +36 -33
  96. package/src/{i18n/locales → locales}/az.json +14 -4
  97. package/src/{i18n/locales → locales}/de.json +13 -4
  98. package/src/{i18n/locales → locales}/en.json +15 -6
  99. package/src/{i18n/locales → locales}/es.json +13 -4
  100. package/src/{i18n/locales → locales}/fr.json +13 -4
  101. package/src/{i18n/locales → locales}/he.json +13 -4
  102. package/src/{i18n/locales/am.json → locales/hy.json} +13 -4
  103. package/src/{i18n/locales → locales}/it.json +13 -4
  104. package/src/{i18n/locales → locales}/ja.json +13 -4
  105. package/src/{i18n/locales → locales}/ka.json +16 -7
  106. package/src/{i18n/locales → locales}/kr.json +15 -6
  107. package/src/{i18n/locales → locales}/nl.json +13 -4
  108. package/src/{i18n/locales → locales}/pl.json +14 -5
  109. package/src/{i18n/locales → locales}/pt.json +12 -4
  110. package/src/{i18n/locales → locales}/ru.json +14 -5
  111. package/src/{i18n/locales → locales}/sv.json +13 -4
  112. package/src/{i18n/locales → locales}/tr.json +13 -4
  113. package/src/{i18n/locales → locales}/zh.json +13 -4
  114. package/src/stores/chart.ts +3 -3
  115. package/src/stores/env.ts +88 -0
  116. package/src/stores/locale.ts +4 -4
  117. package/src/stores/stats.ts +52 -7
  118. package/src/stores/testResults.ts +6 -6
  119. package/src/stores/tree.ts +48 -17
  120. package/src/stores/variables.ts +38 -0
  121. package/types.d.ts +2 -1
  122. package/dist/multi/141.app-d01d0c66.js +0 -1
  123. package/dist/multi/222.app-d01d0c66.js +0 -1
  124. package/dist/multi/335.app-d01d0c66.js +0 -1
  125. package/dist/multi/34.app-d01d0c66.js +0 -1
  126. package/dist/multi/349.app-d01d0c66.js +0 -1
  127. package/dist/multi/378.app-d01d0c66.js +0 -1
  128. package/dist/multi/406.app-d01d0c66.js +0 -1
  129. package/dist/multi/476.app-d01d0c66.js +0 -1
  130. package/dist/multi/53.app-d01d0c66.js +0 -1
  131. package/dist/multi/584.app-d01d0c66.js +0 -1
  132. package/dist/multi/690.app-d01d0c66.js +0 -1
  133. package/dist/multi/747.app-d01d0c66.js +0 -1
  134. package/dist/multi/767.app-d01d0c66.js +0 -1
  135. package/dist/multi/816.app-d01d0c66.js +0 -1
  136. package/dist/multi/83.app-d01d0c66.js +0 -1
  137. package/dist/multi/873.app-d01d0c66.js +0 -1
  138. package/dist/multi/920.app-d01d0c66.js +0 -1
  139. package/dist/multi/991.app-d01d0c66.js +0 -1
  140. package/dist/multi/app-d01d0c66.js +0 -2
  141. package/dist/multi/styles-d01d0c66.css +0 -39
  142. package/dist/single/app-6596cb08.js +0 -2
  143. package/src/components/LanguagePicker/index.tsx +0 -40
  144. package/src/components/ReportLogo/index.tsx +0 -16
  145. package/src/components/ReportLogo/styles.scss +0 -20
  146. package/src/components/ReportLogoFull/index.tsx +0 -20
  147. package/src/components/ReportLogoFull/styles.scss +0 -7
  148. package/src/components/TestResult/TestResultHeader/index.tsx +0 -21
  149. package/src/components/TestResult/TestResultOverview.tsx +0 -43
  150. package/src/components/ThemeButton/ThemeButton.tsx +0 -20
  151. package/src/i18n/constants.ts +0 -124
  152. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  153. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  154. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  155. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  156. /package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +0 -0
  157. /package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +0 -0
  158. /package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +0 -0
  159. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  160. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  161. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  162. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  163. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  164. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  165. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  166. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
  167. /package/src/components/TestResult/{TestResultTabs → TrTabs}/styles.scss +0 -0
@@ -1,24 +1,26 @@
1
+ import type { TestEnvGroup } from "@allurereport/core-api";
1
2
  import { formatDuration } from "@allurereport/core-api";
2
- import { Counter, Heading, Text, TooltipWrapper } from "@allurereport/web-components";
3
+ import { Counter, Heading, Loadable, Text, TooltipWrapper } from "@allurereport/web-components";
3
4
  import clsx from "clsx";
4
5
  import type { FunctionalComponent } from "preact";
5
6
  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";
7
+ import { TrInfoStatuses } from "@/components/TestResult/TrInfo/TrInfoStatuses";
8
+ import { TrNavigation } from "@/components/TestResult/TrNavigation";
9
+ import { TrPrevStatuses } from "@/components/TestResult/TrPrevStatuses";
10
+ import { TrSeverity } from "@/components/TestResult/TrSeverity";
11
+ import { TrStatus } from "@/components/TestResult/TrStatus";
12
+ import { TrTab, TrTabsList } from "@/components/TestResult/TrTabs";
13
+ import { testEnvGroupsStore } from "@/stores/env";
12
14
  import { isSplitMode } from "@/stores/layout";
13
15
  import { useI18n } from "@/stores/locale";
14
16
  import { timestampToDate } from "@/utils/time";
15
17
  import * as styles from "./styles.scss";
16
18
 
17
- export type TestResultInfoProps = {
19
+ export type TrInfoProps = {
18
20
  testResult?: AwesomeTestResult;
19
21
  };
20
22
 
21
- export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testResult }) => {
23
+ export const TrInfo: FunctionalComponent<TrInfoProps> = ({ testResult }) => {
22
24
  const { name, status, muted, flaky, known, duration, labels, history, retries, attachments, stop } = testResult ?? {};
23
25
  const formattedDuration = formatDuration(duration as number);
24
26
  const fullDate = stop && timestampToDate(stop);
@@ -35,10 +37,10 @@ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testR
35
37
  </Heading>
36
38
  )}
37
39
  <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} />}
40
+ {Boolean(status) && <TrStatus status={status} />}
41
+ {Boolean(history?.length) && <TrPrevStatuses history={history} />}
42
+ <TrSeverity severity={severity} />
43
+ {Boolean(statuses.length) && <TrInfoStatuses statuses={statuses} />}
42
44
  <TooltipWrapper tooltipText={fullDate}>
43
45
  <Text tag={"div"} size={"s"} bold className={styles["test-result-duration"]}>
44
46
  {formattedDuration}
@@ -46,27 +48,39 @@ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testR
46
48
  </TooltipWrapper>
47
49
  </div>
48
50
  <div className={styles["test-result-tabs"]}>
49
- <TestResultTabsList>
50
- <TestResultTab id="overview">{t("overview")}</TestResultTab>
51
- <TestResultTab id="history" disabled={!history?.length}>
51
+ <TrTabsList>
52
+ <TrTab id="overview">{t("overview")}</TrTab>
53
+ <TrTab id="history" disabled={!history?.length}>
52
54
  <div className={styles["test-result-tab"]}>
53
55
  {t("history")}
54
56
  {Boolean(history?.length) && <Counter size={"s"} count={history?.length} />}
55
57
  </div>
56
- </TestResultTab>
57
- <TestResultTab id="retries" disabled={!retries?.length}>
58
+ </TrTab>
59
+ <TrTab id="retries" disabled={!retries?.length}>
58
60
  <div className={styles["test-result-tab"]}>
59
61
  {t("retries")}
60
62
  {Boolean(retries?.length) && <Counter size={"s"} count={retries?.length} />}
61
63
  </div>
62
- </TestResultTab>
63
- <TestResultTab id="attachments" disabled={!attachments?.length}>
64
+ </TrTab>
65
+ <TrTab id="attachments" disabled={!attachments?.length}>
64
66
  <div className={styles["test-result-tab"]}>
65
67
  {t("attachments")}
66
68
  {Boolean(attachments?.length) && <Counter size={"s"} count={attachments?.length} />}
67
69
  </div>
68
- </TestResultTab>
69
- </TestResultTabsList>
70
+ </TrTab>
71
+ <Loadable<Record<string, TestEnvGroup>, TestEnvGroup | undefined>
72
+ source={testEnvGroupsStore}
73
+ transformData={(groups) => groups[testResult.testCase.id]}
74
+ renderData={(group) => (
75
+ <TrTab id="environments" disabled={!group}>
76
+ <div className={styles["test-result-tab"]}>
77
+ {t("environments")}
78
+ {Boolean(group) && <Counter size={"s"} count={Object.keys(group.testResultsByEnv).length} />}
79
+ </div>
80
+ </TrTab>
81
+ )}
82
+ />
83
+ </TrTabsList>
70
84
  </div>
71
85
  </>
72
86
  );
@@ -74,7 +88,7 @@ export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testR
74
88
 
75
89
  return (
76
90
  <div className={clsx(styles["test-result-info"], isSplitMode.value && styles.sticky)}>
77
- <TestResultNavigation testResult={testResult} />
91
+ <TrNavigation testResult={testResult} />
78
92
  {testResult && <Content />}
79
93
  </div>
80
94
  );
@@ -6,7 +6,7 @@ import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
- interface TestResultLinkProps {
9
+ interface TrLinkProps {
10
10
  name: string;
11
11
  url: string;
12
12
  type: string;
@@ -19,8 +19,8 @@ const linksIconMap: Record<string, string> = {
19
19
  github: allureIcons.github,
20
20
  };
21
21
 
22
- const TestResultLink: FunctionalComponent<{
23
- link: TestResultLinkProps;
22
+ const TrLink: FunctionalComponent<{
23
+ link: TrLinkProps;
24
24
  }> = ({ link }) => {
25
25
  const { url, type } = link;
26
26
 
@@ -34,15 +34,15 @@ const TestResultLink: FunctionalComponent<{
34
34
  );
35
35
  };
36
36
 
37
- export type TestResultLinksProps = {
37
+ export type TrLinksProps = {
38
38
  links: AwesomeTestResult["links"];
39
39
  };
40
40
 
41
- export const TestResultLinks: FunctionalComponent<TestResultLinksProps> = ({ links }) => {
41
+ export const TrLinks: FunctionalComponent<TrLinksProps> = ({ links }) => {
42
42
  const [isOpened, setIsOpen] = useState(true);
43
43
  const { t } = useI18n("ui");
44
44
  const linkMap = links.map((link, index) => {
45
- return <TestResultLink link={link as TestResultLinkProps} key={index} />;
45
+ return <TrLink link={link as TrLinkProps} key={index} />;
46
46
  });
47
47
 
48
48
  return (
@@ -1,16 +1,16 @@
1
1
  import type { FunctionalComponent } from "preact";
2
2
  import { useState } from "preact/hooks";
3
3
  import type { AwesomeTestResult } from "types";
4
- import { TestResultMetadataList } from "@/components/Metadata";
4
+ import { TrMetadataList } from "@/components/Metadata";
5
5
  import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
- export type TestResultMetadataProps = {
9
+ export type TrMetadataProps = {
10
10
  testResult?: AwesomeTestResult;
11
11
  };
12
12
 
13
- export const TestResultMetadata: FunctionalComponent<TestResultMetadataProps> = ({ testResult }) => {
13
+ export const TrMetadata: FunctionalComponent<TrMetadataProps> = ({ testResult }) => {
14
14
  const { t } = useI18n("ui");
15
15
  const { labels, groupedLabels } = testResult ?? {};
16
16
  const [isOpened, setIsOpened] = useState(true);
@@ -20,7 +20,7 @@ export const TestResultMetadata: FunctionalComponent<TestResultMetadataProps> =
20
20
  <MetadataButton isOpened={isOpened} setIsOpen={setIsOpened} counter={labels?.length} title={t("labels")} />
21
21
 
22
22
  <div className={styles["test-result-metadata-wrapper"]}>
23
- {isOpened && <TestResultMetadataList groupedLabels={groupedLabels} />}
23
+ {isOpened && <TrMetadataList groupedLabels={groupedLabels} />}
24
24
  </div>
25
25
  </div>
26
26
  );
@@ -7,11 +7,11 @@ import { testResultNavStore } from "@/stores/testResults";
7
7
  import { copyToClipboard } from "@/utils/copyToClipboard";
8
8
  import * as styles from "./styles.scss";
9
9
 
10
- export type TestResultNavigationProps = {
10
+ export type TrNavigationProps = {
11
11
  testResult?: AwesomeTestResult;
12
12
  };
13
13
 
14
- export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps> = ({ testResult }) => {
14
+ export const TrNavigation: FunctionalComponent<TrNavigationProps> = ({ testResult }) => {
15
15
  const { fullName, id: testResultId } = testResult ?? {};
16
16
  const id = testResultId || "";
17
17
  const { t: tooltip } = useI18n("controls");
@@ -39,6 +39,7 @@ export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps
39
39
  source={testResultNavStore}
40
40
  renderData={(data) => {
41
41
  const currentIndex = data.indexOf(id) + 1;
42
+
42
43
  return (
43
44
  <div className={styles["test-result-nav"]}>
44
45
  {fullName && <FullName />}
@@ -0,0 +1,47 @@
1
+ import type { TestStatus } from "@allurereport/core-api";
2
+ import type { FunctionalComponent } from "preact";
3
+ import type { AwesomeTestResult } from "types";
4
+ import * as styles from "@/components/BaseLayout/styles.scss";
5
+ import TestStepsEmpty from "@/components/TestResult/TestStepsEmpty";
6
+ import { TrDescription } from "@/components/TestResult/TrDescription";
7
+ import { TrError } from "@/components/TestResult/TrError";
8
+ import { TrLinks } from "@/components/TestResult/TrLinks";
9
+ import { TrMetadata } from "@/components/TestResult/TrMetadata";
10
+ import { TrParameters } from "@/components/TestResult/TrParameters";
11
+ import { TrPwTraces } from "@/components/TestResult/TrPwTraces";
12
+ import { TrSetup } from "@/components/TestResult/TrSetup";
13
+ import { TrSteps } from "@/components/TestResult/TrSteps";
14
+ import { TrTeardown } from "@/components/TestResult/TrTeardown";
15
+
16
+ export type TrOverviewProps = {
17
+ testResult?: AwesomeTestResult;
18
+ };
19
+
20
+ export const TrOverview: FunctionalComponent<TrOverviewProps> = ({ testResult }) => {
21
+ const { error, parameters, groupedLabels, links, description, setup, steps, teardown, id, status } = testResult || {};
22
+ const isNoSteps = !setup?.length && !steps.length && !teardown.length;
23
+ const pwTraces = testResult?.attachments?.filter(
24
+ (attachment) => attachment.link.contentType === "application/vnd.allure.playwright-trace",
25
+ );
26
+
27
+ return (
28
+ <>
29
+ {Boolean(error?.message) && (
30
+ <div className={styles["test-result-errors"]}>
31
+ <TrError {...error} status={status} />
32
+ </div>
33
+ )}
34
+ {Boolean(pwTraces.length) && <TrPwTraces pwTraces={pwTraces} />}
35
+ {Boolean(parameters?.length) && <TrParameters parameters={parameters} />}
36
+ {Boolean(groupedLabels && Object.keys(groupedLabels || {})?.length) && <TrMetadata testResult={testResult} />}
37
+ {Boolean(links?.length) && <TrLinks links={links} />}
38
+ {Boolean(description) && <TrDescription description={description} />}
39
+ <div className={styles["test-results"]}>
40
+ {isNoSteps && <TestStepsEmpty />}
41
+ {Boolean(setup?.length) && <TrSetup id={id} setup={setup} />}
42
+ {Boolean(steps?.length) && <TrSteps id={id} steps={steps} />}
43
+ {Boolean(teardown?.length) && <TrTeardown id={id} teardown={teardown} />}
44
+ </div>
45
+ </>
46
+ );
47
+ };
@@ -6,11 +6,11 @@ import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
- export type TestResultParametersProps = {
9
+ export type TrParametersProps = {
10
10
  parameters: AwesomeTestResult["parameters"];
11
11
  };
12
12
 
13
- export const TestResultParameters: FunctionalComponent<TestResultParametersProps> = ({ parameters }) => {
13
+ export const TrParameters: FunctionalComponent<TrParametersProps> = ({ parameters }) => {
14
14
  const [isOpened, setIsOpened] = useState(true);
15
15
  const { t } = useI18n("ui");
16
16
 
@@ -8,14 +8,14 @@ import { capitalize } from "@/utils/capitalize";
8
8
  import { timestampToDate } from "@/utils/time";
9
9
  import * as styles from "./styles.scss";
10
10
 
11
- const TestResultPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
11
+ const TrPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
12
12
  return (
13
13
  <div className={styles["test-result-prev-status"]} onClick={() => navigateTo(`${item.id}`)}>
14
14
  <SvgIcon id={allureIcons.lineShapesDotCircle} className={styles[`status-${item?.status}`]} />
15
15
  </div>
16
16
  );
17
17
  };
18
- const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
18
+ const TrPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
19
19
  const convertedStop = item.stop && timestampToDate(item.stop);
20
20
  const { t } = useI18n("statuses");
21
21
  const status = t(item.status);
@@ -30,17 +30,17 @@ const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult
30
30
  );
31
31
  };
32
32
 
33
- export type TestResultPrevStatusesProps = {
33
+ export type TrPrevStatusesProps = {
34
34
  history: AwesomeTestResult["history"];
35
35
  };
36
36
 
37
- export const TestResultPrevStatuses: FunctionalComponent<TestResultPrevStatusesProps> = ({ history }) => {
37
+ export const TrPrevStatuses: FunctionalComponent<TrPrevStatusesProps> = ({ history }) => {
38
38
  return (
39
39
  <div className={styles["test-result-prev-statuses"]}>
40
40
  {history?.slice(0, 6).map((item, key) => (
41
41
  <div key={key} className={styles["test-result-prev-status"]}>
42
- <TooltipWrapper key={key} tooltipComponent={<TestResultPrevStatusTooltip item={item} />}>
43
- <TestResultPrevStatus item={item} />
42
+ <TooltipWrapper key={key} tooltipComponent={<TrPrevStatusTooltip item={item} />}>
43
+ <TrPrevStatus item={item} />
44
44
  </TooltipWrapper>
45
45
  </div>
46
46
  ))}
@@ -0,0 +1,34 @@
1
+ import clsx from "clsx";
2
+ import { useEffect, useRef } from "preact/hooks";
3
+ import * as styles from "./styles.scss";
4
+
5
+ interface PwTraceProps {
6
+ blob: Blob;
7
+ isFullScreen?: boolean;
8
+ }
9
+ export const PwTrace = ({ blob, isFullScreen }: PwTraceProps) => {
10
+ const iframeRef = useRef<HTMLIFrameElement>(null);
11
+
12
+ const handleLoad = () => {
13
+ iframeRef.current?.contentWindow?.postMessage(
14
+ { method: "load", params: { trace: blob } },
15
+ "https://trace.playwright.dev",
16
+ );
17
+ };
18
+
19
+ useEffect(() => {
20
+ if (iframeRef.current) {
21
+ iframeRef.current.onload = handleLoad;
22
+ }
23
+ }, [blob]);
24
+
25
+ return (
26
+ <iframe
27
+ className={clsx(styles["pw-trace"], { [styles["pw-trace-fullscreen"]]: isFullScreen })}
28
+ ref={iframeRef}
29
+ width={"100%"}
30
+ height={"100%"}
31
+ src={"https://trace.playwright.dev/next/"}
32
+ />
33
+ );
34
+ };
@@ -0,0 +1,33 @@
1
+ import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
+ import type { Attachments } from "@allurereport/web-commons";
3
+ import { fetchReportAttachment } from "@allurereport/web-commons";
4
+ import { IconButton, TooltipWrapper, allureIcons } from "@allurereport/web-components";
5
+ import { PwTrace } from "@/components/TestResult/TrPwTraces/PwTrace";
6
+ import { useI18n } from "@/stores";
7
+ import { openModal } from "@/stores/modal";
8
+ import * as styles from "./styles.scss";
9
+
10
+ export const fetchFromUrl = async ({ id, ext, contentType }: Attachments) => {
11
+ const fileName = `${id || "-"}${ext || ""}`;
12
+
13
+ return fetchReportAttachment(`data/attachments/${fileName}?attachment`, contentType);
14
+ };
15
+
16
+ export const PwTraceButton = ({ link }: Pick<AttachmentTestStepResult, "link">) => {
17
+ const { t } = useI18n("ui");
18
+ const openPw = async () => {
19
+ const hasPw = await fetchFromUrl(link);
20
+ const blob = await hasPw.blob();
21
+
22
+ openModal({
23
+ component: <PwTrace blob={blob} />,
24
+ title: `Playwright Trace Viewer | ${link.name}${link.ext}`,
25
+ });
26
+ };
27
+
28
+ return (
29
+ <TooltipWrapper tooltipText={t("openPwTrace")}>
30
+ <IconButton icon={allureIcons.lineArrowsExpand3} size={"s"} style={"ghost"} onClick={openPw} />
31
+ </TooltipWrapper>
32
+ );
33
+ };
@@ -0,0 +1,29 @@
1
+ import type { AttachmentTestStepResult } from "@allurereport/core-api";
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 { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
7
+ import { useI18n } from "@/stores/locale";
8
+ import * as styles from "./styles.scss";
9
+
10
+ export type TrMetadataProps = {
11
+ testResult?: AwesomeTestResult;
12
+ pwTraces?: AttachmentTestStepResult[];
13
+ };
14
+
15
+ export const TrPwTraces: FunctionalComponent<TrMetadataProps> = ({ pwTraces }) => {
16
+ const { t } = useI18n("ui");
17
+ const [isOpened, setIsOpened] = useState(true);
18
+
19
+ return (
20
+ <div className={styles["tr-metadata"]}>
21
+ <MetadataButton isOpened={isOpened} setIsOpen={setIsOpened} counter={pwTraces?.length} title={t("pwTrace")} />
22
+ {isOpened && (
23
+ <div className={styles["tr-metadata-wrapper"]}>
24
+ {pwTraces?.map((pw, index) => <TrAttachment stepIndex={index + 1} item={pw} key={pw.link.id} />)}
25
+ </div>
26
+ )}
27
+ </div>
28
+ );
29
+ };
@@ -0,0 +1,20 @@
1
+ .tr-metadata {
2
+ padding: 12px 24px 0;
3
+ }
4
+
5
+ .tr-metadata-wrapper {
6
+ border-bottom: 1px solid var(--on-border-primary);
7
+ padding-top: 8px;
8
+ padding-bottom: 12px;
9
+ }
10
+
11
+ .pw-trace {
12
+ --modal-paddings: 60px;
13
+ overflow: hidden;
14
+ height: calc(80vh - var(--modal-paddings));
15
+ }
16
+
17
+ .pw-trace-fullscreen {
18
+ --modal-fs-paddings: 75px;
19
+ height: calc(100vh - var(--modal-fs-paddings));
20
+ }
@@ -4,12 +4,12 @@ import type { FunctionalComponent } from "preact";
4
4
  import { useState } from "preact/hooks";
5
5
  import type { AwesomeTestResult } from "types";
6
6
  import { ArrowButton } from "@/components/ArrowButton";
7
- import * as styles from "@/components/TestResult/TestResultRetriesView/styles.scss";
8
7
  import { TrError } from "@/components/TestResult/TrError";
8
+ import * as styles from "@/components/TestResult/TrRetriesView/styles.scss";
9
9
  import { navigateTo } from "@/stores/router";
10
10
  import { timestampToDate } from "@/utils/time";
11
11
 
12
- export const TestResultRetriesItem: FunctionalComponent<{
12
+ export const TrRetriesItem: FunctionalComponent<{
13
13
  testResultItem: AwesomeTestResult;
14
14
  }> = ({ testResultItem }) => {
15
15
  const { id, status, error, stop, duration } = testResultItem;
@@ -43,7 +43,7 @@ export const TestResultRetriesItem: FunctionalComponent<{
43
43
  </div>
44
44
  {isOpened && error && (
45
45
  <div className={styles["test-result-retries-item-content"]}>
46
- <TrError {...error} />
46
+ <TrError {...error} status={status} />
47
47
  </div>
48
48
  )}
49
49
  </div>
@@ -1,10 +1,10 @@
1
1
  import type { FunctionalComponent } from "preact";
2
2
  import type { AwesomeTestResult } from "types";
3
- import * as styles from "@/components/TestResult/TestResultHistory/styles.scss";
4
- import { TestResultRetriesItem } from "@/components/TestResult/TestResultRetriesView/TestResultRetriesItem";
3
+ import * as styles from "@/components/TestResult/TrHistory/styles.scss";
4
+ import { TrRetriesItem } from "@/components/TestResult/TrRetriesView/TrRetriesItem";
5
5
  import { useI18n } from "@/stores";
6
6
 
7
- export const TestResultRetriesView: FunctionalComponent<{
7
+ export const TrRetriesView: FunctionalComponent<{
8
8
  testResult: AwesomeTestResult;
9
9
  }> = ({ testResult }) => {
10
10
  const { retries } = testResult ?? {};
@@ -13,9 +13,7 @@ export const TestResultRetriesView: FunctionalComponent<{
13
13
  return (
14
14
  <div className={styles["test-result-history"]}>
15
15
  {retries.length ? (
16
- retries?.map((item, key) => (
17
- <TestResultRetriesItem testResultItem={item as unknown as AwesomeTestResult} key={key} />
18
- ))
16
+ retries?.map((item, key) => <TrRetriesItem testResultItem={item as unknown as AwesomeTestResult} key={key} />)
19
17
  ) : (
20
18
  <div className={styles["test-result-empty"]}>{t("no-retries-results")}</div>
21
19
  )}
@@ -2,26 +2,26 @@ import { allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
4
  import type { AwesomeTestResult } from "types";
5
- import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
6
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
7
- import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
8
- import { TestResultStep } from "@/components/TestResult/TestResultSteps/testResultStep";
5
+ import { TrDropdown } from "@/components/TestResult/TrDropdown";
6
+ import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
7
+ import { TrStep } from "@/components/TestResult/TrSteps/TrStep";
8
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
9
9
  import { useI18n } from "@/stores/locale";
10
10
  import { collapsedTrees, toggleTree } from "@/stores/tree";
11
11
 
12
12
  const typeMap = {
13
- before: TestResultStep,
14
- after: TestResultStep,
15
- step: TestResultStep,
16
- attachment: TestResultAttachment,
13
+ before: TrStep,
14
+ after: TrStep,
15
+ step: TrStep,
16
+ attachment: TrAttachment,
17
17
  };
18
18
 
19
- export type TestResultSetupProps = {
19
+ export type TrSetupProps = {
20
20
  setup: AwesomeTestResult["setup"];
21
21
  id?: string;
22
22
  };
23
23
 
24
- export const TestResultSetup: FunctionalComponent<TestResultSetupProps> = ({ setup, id }) => {
24
+ export const TrSetup: FunctionalComponent<TrSetupProps> = ({ setup, id }) => {
25
25
  const teardownId = `${id}-setup`;
26
26
  const isEarlyCollapsed = Boolean(!collapsedTrees.value.has(teardownId));
27
27
  const [isOpened, setIsOpen] = useState<boolean>(isEarlyCollapsed);
@@ -34,7 +34,7 @@ export const TestResultSetup: FunctionalComponent<TestResultSetupProps> = ({ set
34
34
 
35
35
  return (
36
36
  <div className={styles["test-result-steps"]}>
37
- <TestResultDropdown
37
+ <TrDropdown
38
38
  icon={allureIcons.lineTimeClockStopwatch}
39
39
  isOpened={isOpened}
40
40
  setIsOpen={handleClick}
@@ -12,7 +12,7 @@ const icons: Record<string, string> = {
12
12
  trivial: allureIcons.lineArrowsChevronDownDouble,
13
13
  };
14
14
 
15
- export const TestResultSeverity = ({ severity = "normal" }: { severity?: string }) => {
15
+ export const TrSeverity = ({ severity = "normal" }: { severity?: string }) => {
16
16
  const { t } = useI18n("severity");
17
17
  const statusClass = clsx(styles[`severity-${severity}`]);
18
18
 
@@ -5,8 +5,9 @@ import { useI18n } from "@/stores";
5
5
  import { capitalize } from "@/utils/capitalize";
6
6
  import * as styles from "./styles.scss";
7
7
 
8
- export const TestResultStatus = ({ status }: { status: TestStatus }) => {
8
+ export const TrStatus = ({ status }: { status: TestStatus }) => {
9
9
  const { t } = useI18n("statuses");
10
+
10
11
  return (
11
12
  <div
12
13
  data-testid={`test-result-status-${status}`}
@@ -17,7 +18,7 @@ export const TestResultStatus = ({ status }: { status: TestStatus }) => {
17
18
  className={styles["test-result-status-icon"]}
18
19
  classNameIcon={styles["test-result-status-icon"]}
19
20
  />
20
- <Text type={"ui"} size={"s"} bold className={styles["test-result-status-text"]}>
21
+ <Text type={"ui"} size={"s"} className={styles["test-result-status-text"]}>
21
22
  {capitalize(t(status) ?? status)}
22
23
  </Text>
23
24
  </div>
@@ -4,10 +4,11 @@ import { Attachment, Code, SvgIcon, Text, allureIcons } from "@allurereport/web-
4
4
  import type { FunctionComponent } from "preact";
5
5
  import { useState } from "preact/hooks";
6
6
  import { ArrowButton } from "@/components/ArrowButton";
7
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
8
- import { TestResultAttachmentInfo } from "@/components/TestResult/TestResultSteps/testResultAttachmentInfo";
7
+ import { PwTraceButton } from "@/components/TestResult/TrPwTraces/PwTraceButton";
8
+ import { TrAttachmentInfo } from "@/components/TestResult/TrSteps/TrAttachmentInfo";
9
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
9
10
 
10
- const { lineImagesImage, lineFilesFileAttachment2 } = allureIcons;
11
+ const { lineImagesImage, lineFilesFileAttachment2, playwrightLogo } = allureIcons;
11
12
 
12
13
  const iconMap: Record<string, string> = {
13
14
  "text/plain": lineFilesFileAttachment2,
@@ -25,9 +26,10 @@ const iconMap: Record<string, string> = {
25
26
  "image/jpeg": lineImagesImage,
26
27
  "video/mp4": lineImagesImage,
27
28
  "application/vnd.allure.image.diff": lineImagesImage,
29
+ "application/vnd.allure.playwright-trace": playwrightLogo,
28
30
  };
29
31
 
30
- export const TestResultAttachment: FunctionComponent<{
32
+ export const TrAttachment: FunctionComponent<{
31
33
  item: AttachmentTestStepResult;
32
34
  stepIndex?: number;
33
35
  className?: string;
@@ -47,7 +49,7 @@ export const TestResultAttachment: FunctionComponent<{
47
49
  setIsOpen((prev) => !prev);
48
50
  }}
49
51
  >
50
- <ArrowButton isOpened={isOpened} />
52
+ {isValidComponentType ? <ArrowButton isOpened={isOpened} /> : <div className={styles["test-result-strut"]} />}
51
53
  <div className={styles["test-result-attachment-icon"]}>
52
54
  <SvgIcon size="s" id={iconMap[link.contentType] ?? lineFilesFileAttachment2} />
53
55
  </div>
@@ -55,14 +57,15 @@ export const TestResultAttachment: FunctionComponent<{
55
57
  <Code size="s" className={styles["test-result-step-number"]}>
56
58
  {stepIndex}
57
59
  </Code>
58
-
59
60
  <Text className={styles["test-result-attachment-text"]}>{link.name || link.originalFileName}</Text>
60
61
  {missed && (
61
62
  <Text size={"s"} className={styles["test-result-attachment-missed"]}>
62
63
  missed
63
64
  </Text>
64
65
  )}
65
- <TestResultAttachmentInfo item={item} shouldExpand={isValidComponentType} />
66
+ <div>
67
+ <TrAttachmentInfo item={item} shouldExpand={isValidComponentType} />
68
+ </div>
66
69
  </div>
67
70
  {isOpened && isValidComponentType && (
68
71
  <div className={styles["test-result-attachment-content-wrapper"]}>
@@ -4,21 +4,20 @@ import { Attachment, IconButton, Text, TooltipWrapper, allureIcons } from "@allu
4
4
  import { filesize } from "filesize";
5
5
  import type { FunctionalComponent } from "preact";
6
6
  import { useEffect } from "preact/hooks";
7
- import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
7
+ import { PwTraceButton } from "@/components/TestResult/TrPwTraces/PwTraceButton";
8
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
8
9
  import { useI18n } from "@/stores";
9
- import { isModalOpen, modalData, openModal } from "@/stores/modal";
10
+ import { isModalOpen, openModal } from "@/stores/modal";
10
11
 
11
- interface TestResultAttachmentInfoProps {
12
+ interface TrAttachmentInfo {
12
13
  item?: AttachmentTestStepResult;
13
14
  shouldExpand?: boolean;
14
15
  }
15
16
 
16
- export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentInfoProps> = ({
17
- item,
18
- shouldExpand,
19
- }) => {
20
- const { id, ext, contentType } = item.link;
17
+ export const TrAttachmentInfo: FunctionalComponent<TrAttachmentInfo> = ({ item, shouldExpand }) => {
21
18
  const { t: tooltip } = useI18n("controls");
19
+ const { id, ext, contentType } = item.link;
20
+ const isPwTrace = contentType === "application/vnd.allure.playwright-trace";
22
21
  const contentLength = item.link.missed === false ? item.link.contentLength : undefined;
23
22
  const contentSize = contentLength
24
23
  ? filesize(contentLength, {
@@ -55,6 +54,7 @@ export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentI
55
54
  {Boolean(contentType) && <Text size={"s"}>{contentType}</Text>}
56
55
  {Boolean(contentSize) && <Text size={"s"}>{contentSize}</Text>}
57
56
  <div className={styles["item-buttons"]}>
57
+ {isPwTrace && <PwTraceButton link={item.link} />}
58
58
  {shouldExpand && (
59
59
  <TooltipWrapper tooltipText={tooltip("expand")}>
60
60
  <IconButton