@allurereport/web-awesome 3.3.1 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/dist/multi/173.app-648d4a8e7d5405e104a1.js +1 -0
  2. package/dist/multi/174.app-648d4a8e7d5405e104a1.js +1 -0
  3. package/dist/multi/252.app-648d4a8e7d5405e104a1.js +1 -0
  4. package/dist/multi/282.app-648d4a8e7d5405e104a1.js +1 -0
  5. package/dist/multi/29.app-648d4a8e7d5405e104a1.js +1 -0
  6. package/dist/multi/310.app-648d4a8e7d5405e104a1.js +1 -0
  7. package/dist/multi/416.app-648d4a8e7d5405e104a1.js +1 -0
  8. package/dist/multi/507.app-648d4a8e7d5405e104a1.js +1 -0
  9. package/dist/multi/527.app-648d4a8e7d5405e104a1.js +1 -0
  10. package/dist/multi/600.app-648d4a8e7d5405e104a1.js +1 -0
  11. package/dist/multi/605.app-648d4a8e7d5405e104a1.js +1 -0
  12. package/dist/multi/638.app-648d4a8e7d5405e104a1.js +1 -0
  13. package/dist/multi/672.app-648d4a8e7d5405e104a1.js +1 -0
  14. package/dist/multi/686.app-648d4a8e7d5405e104a1.js +1 -0
  15. package/dist/multi/725.app-648d4a8e7d5405e104a1.js +1 -0
  16. package/dist/multi/741.app-648d4a8e7d5405e104a1.js +1 -0
  17. package/dist/multi/749.app-648d4a8e7d5405e104a1.js +1 -0
  18. package/dist/multi/755.app-648d4a8e7d5405e104a1.js +1 -0
  19. package/dist/multi/{894.app-8be6acc0a596a2197dbf.js → 894.app-648d4a8e7d5405e104a1.js} +1 -1
  20. package/dist/multi/943.app-648d4a8e7d5405e104a1.js +1 -0
  21. package/dist/multi/980.app-648d4a8e7d5405e104a1.js +1 -0
  22. package/dist/multi/app-648d4a8e7d5405e104a1.js +2 -0
  23. package/dist/multi/{app-8be6acc0a596a2197dbf.js.LICENSE.txt → app-648d4a8e7d5405e104a1.js.LICENSE.txt} +1 -1
  24. package/dist/multi/manifest.json +23 -21
  25. package/dist/multi/{styles-0b84e1ef76554ad2db9a.css → styles-b72a0161ddf41447b31c.css} +10 -10
  26. package/dist/single/app-ae966ad3dc27579d6c39.js +2 -0
  27. package/dist/single/{app-8221eb856e47b4ef50d6.js.LICENSE.txt → app-ae966ad3dc27579d6c39.js.LICENSE.txt} +1 -1
  28. package/dist/single/manifest.json +1 -1
  29. package/package.json +18 -36
  30. package/src/components/BaseLayout/index.tsx +2 -0
  31. package/src/components/Categories/CategoriesTree/index.tsx +2 -0
  32. package/src/components/Categories/CategoryHeaderItem/index.tsx +2 -0
  33. package/src/components/Categories/CategoryTreeItem/index.tsx +2 -0
  34. package/src/components/Categories/GroupTreeItem/index.tsx +2 -0
  35. package/src/components/Categories/HistoryTreeItem/index.tsx +2 -0
  36. package/src/components/Categories/LabelTreeItem/index.tsx +2 -0
  37. package/src/components/Categories/MessageTreeItem/index.tsx +2 -0
  38. package/src/components/Categories/SeverityTreeItem/index.tsx +2 -0
  39. package/src/components/Charts/index.tsx +3 -0
  40. package/src/components/EnvironmentPicker/index.tsx +78 -18
  41. package/src/components/EnvironmentPicker/styles.scss +19 -0
  42. package/src/components/Footer/FooterLogo.tsx +1 -0
  43. package/src/components/Footer/FooterVersion.tsx +2 -0
  44. package/src/components/Footer/index.tsx +3 -1
  45. package/src/components/Header/CiInfo/index.tsx +17 -3
  46. package/src/components/Header/index.tsx +3 -0
  47. package/src/components/Header/styles.scss +1 -0
  48. package/src/components/HeaderControls/index.tsx +1 -0
  49. package/src/components/MainReport/index.tsx +3 -0
  50. package/src/components/Metadata/index.tsx +2 -0
  51. package/src/components/MetadataButton/index.tsx +35 -8
  52. package/src/components/MetadataButton/styles.scss +20 -0
  53. package/src/components/Modal/index.tsx +2 -0
  54. package/src/components/NavTabs/index.tsx +2 -1
  55. package/src/components/ReportBody/HeaderActions.tsx +1 -0
  56. package/src/components/ReportBody/SortBy.tsx +2 -0
  57. package/src/components/ReportBody/index.tsx +4 -1
  58. package/src/components/ReportCategories/index.tsx +2 -0
  59. package/src/components/ReportFilters/BaseFilters.tsx +2 -0
  60. package/src/components/ReportFilters/CategoriesFilter.tsx +2 -0
  61. package/src/components/ReportFilters/RetryFlaky.tsx +2 -0
  62. package/src/components/ReportFilters/TagsFilter.tsx +2 -0
  63. package/src/components/ReportFilters/TransitionFilter.tsx +2 -0
  64. package/src/components/ReportFilters/index.tsx +3 -0
  65. package/src/components/ReportGlobalAttachments/index.tsx +3 -0
  66. package/src/components/ReportGlobalErrors/index.tsx +2 -0
  67. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +1 -0
  68. package/src/components/ReportHeader/ReportHeaderLogo.tsx +3 -1
  69. package/src/components/ReportHeader/ReportHeaderPie.tsx +2 -0
  70. package/src/components/ReportHeader/index.tsx +2 -0
  71. package/src/components/ReportMetadata/MetadataItem.tsx +1 -0
  72. package/src/components/ReportMetadata/MetadataSummary.tsx +3 -1
  73. package/src/components/ReportMetadata/MetadataTestType.tsx +2 -0
  74. package/src/components/ReportMetadata/MetadataWithIcon.tsx +2 -0
  75. package/src/components/ReportMetadata/index.tsx +61 -17
  76. package/src/components/ReportQualityGateResults/index.tsx +6 -2
  77. package/src/components/ReportSearch/index.tsx +1 -0
  78. package/src/components/ReportTabs/index.tsx +3 -0
  79. package/src/components/SectionPicker/index.tsx +2 -0
  80. package/src/components/SectionSwitcher/index.tsx +3 -0
  81. package/src/components/SideBySide/index.tsx +1 -0
  82. package/src/components/SplitLayout/index.tsx +2 -0
  83. package/src/components/TestResult/TestStepsEmpty/index.tsx +2 -0
  84. package/src/components/TestResult/TrAttachmentsView/index.tsx +2 -0
  85. package/src/components/TestResult/TrDescription/index.tsx +16 -3
  86. package/src/components/TestResult/TrDropdown/index.tsx +1 -0
  87. package/src/components/TestResult/TrEmpty/index.tsx +3 -1
  88. package/src/components/TestResult/TrEnvironmentItem/index.tsx +3 -0
  89. package/src/components/TestResult/TrEnvironmentsView/index.tsx +8 -2
  90. package/src/components/TestResult/TrError/TrDiff.tsx +3 -1
  91. package/src/components/TestResult/TrError/index.tsx +20 -18
  92. package/src/components/TestResult/TrError/styles.scss +0 -25
  93. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +3 -1
  94. package/src/components/TestResult/TrHeader/index.tsx +2 -0
  95. package/src/components/TestResult/TrHeader/styles.scss +1 -0
  96. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +3 -1
  97. package/src/components/TestResult/TrHistory/index.tsx +2 -0
  98. package/src/components/TestResult/TrInfo/TrInfoStatuses.tsx +2 -0
  99. package/src/components/TestResult/TrInfo/index.tsx +2 -0
  100. package/src/components/TestResult/TrLinks/index.tsx +63 -11
  101. package/src/components/TestResult/TrMetadata/index.tsx +44 -5
  102. package/src/components/TestResult/TrNavigation/index.tsx +2 -0
  103. package/src/components/TestResult/TrOverview.tsx +20 -17
  104. package/src/components/TestResult/TrParameters/index.tsx +41 -7
  105. package/src/components/TestResult/TrPrevStatuses/index.tsx +2 -0
  106. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +44 -9
  107. package/src/components/TestResult/TrPwTraces/index.tsx +5 -1
  108. package/src/components/TestResult/TrPwTraces/openPwTraceInNewTab.ts +29 -0
  109. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +3 -1
  110. package/src/components/TestResult/TrRetriesView/index.tsx +2 -0
  111. package/src/components/TestResult/TrSetup/index.tsx +3 -1
  112. package/src/components/TestResult/TrSeverity/index.tsx +2 -0
  113. package/src/components/TestResult/TrStatus/index.tsx +2 -0
  114. package/src/components/TestResult/TrSteps/TrAttachment.tsx +38 -6
  115. package/src/components/TestResult/TrSteps/TrAttachmentInfo.tsx +50 -2
  116. package/src/components/TestResult/TrSteps/TrBodyItems.tsx +42 -0
  117. package/src/components/TestResult/TrSteps/TrErrorStep.tsx +40 -0
  118. package/src/components/TestResult/TrSteps/TrStep.tsx +31 -65
  119. package/src/components/TestResult/TrSteps/TrStepHeader.tsx +50 -0
  120. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +1 -0
  121. package/src/components/TestResult/TrSteps/index.tsx +12 -32
  122. package/src/components/TestResult/TrSteps/styles.scss +8 -0
  123. package/src/components/TestResult/TrSteps/wrongAttachment.tsx +2 -1
  124. package/src/components/TestResult/TrTabs/index.tsx +1 -0
  125. package/src/components/TestResult/TrTeardown/index.tsx +3 -1
  126. package/src/components/TestResult/bodyItems.ts +151 -0
  127. package/src/components/TestResult/index.tsx +2 -0
  128. package/src/components/Timeline/index.tsx +12 -2
  129. package/src/components/ToggleLayout/index.tsx +1 -0
  130. package/src/components/Tree/index.tsx +6 -2
  131. package/src/components/Tree/styles.scss +11 -0
  132. package/src/index.tsx +9 -3
  133. package/src/locales/ar.json +427 -0
  134. package/src/locales/az.json +43 -46
  135. package/src/locales/de.json +5 -0
  136. package/src/locales/en.json +5 -0
  137. package/src/locales/es.json +5 -0
  138. package/src/locales/fr.json +5 -0
  139. package/src/locales/he.json +5 -0
  140. package/src/locales/hy.json +5 -0
  141. package/src/locales/it.json +5 -0
  142. package/src/locales/ja.json +5 -0
  143. package/src/locales/ka.json +5 -0
  144. package/src/locales/kr.json +5 -0
  145. package/src/locales/nl.json +5 -0
  146. package/src/locales/pl.json +5 -0
  147. package/src/locales/pt.json +5 -0
  148. package/src/locales/ru.json +5 -0
  149. package/src/locales/sv.json +5 -0
  150. package/src/locales/tr.json +5 -0
  151. package/src/locales/uk.json +5 -0
  152. package/src/locales/zh-TW.json +432 -0
  153. package/src/locales/zh.json +5 -0
  154. package/src/stores/categories.ts +1 -0
  155. package/src/stores/chart.ts +2 -1
  156. package/src/stores/env.ts +14 -4
  157. package/src/stores/envInfo.ts +1 -0
  158. package/src/stores/globals.ts +1 -0
  159. package/src/stores/locale.ts +1 -0
  160. package/src/stores/qualityGate.ts +1 -0
  161. package/src/stores/sections.ts +1 -0
  162. package/src/stores/stats.ts +12 -6
  163. package/src/stores/testResult.ts +1 -0
  164. package/src/stores/testResults.ts +1 -0
  165. package/src/stores/timeline.ts +2 -0
  166. package/src/stores/tree.ts +2 -0
  167. package/src/stores/treeFilters/actions.ts +1 -0
  168. package/src/stores/treeFilters/store.ts +1 -0
  169. package/src/stores/treeFilters/utils.ts +1 -0
  170. package/src/stores/variables.ts +1 -0
  171. package/src/utils/time.ts +1 -0
  172. package/src/utils/treeFilters.ts +2 -0
  173. package/test/components/EnvironmentPicker.test.tsx +133 -0
  174. package/test/components/Header/CiInfo.test.tsx +15 -0
  175. package/test/components/Header.test.tsx +1 -0
  176. package/test/components/TestResult/PwTraceButton.test.tsx +104 -0
  177. package/test/components/TestResult/TrErrorStep.test.tsx +127 -0
  178. package/test/components/TestResult/TrOverview.test.tsx +114 -0
  179. package/test/components/TestResult/bodyItems.test.ts +194 -0
  180. package/test/components/TestResult/openPwTraceInNewTab.test.ts +65 -0
  181. package/test/components/Timeline.test.tsx +104 -0
  182. package/test/stores/treeFilters/actions.test.ts +82 -0
  183. package/test/utils/ownerAddress.test.ts +1 -0
  184. package/test/utils/treeFilters.test.ts +1 -0
  185. package/tsconfig.json +1 -2
  186. package/tsconfig.node.json +2 -1
  187. package/types.d.ts +2 -0
  188. package/.eslintrc.cjs +0 -18
  189. package/dist/multi/173.app-8be6acc0a596a2197dbf.js +0 -1
  190. package/dist/multi/174.app-8be6acc0a596a2197dbf.js +0 -1
  191. package/dist/multi/252.app-8be6acc0a596a2197dbf.js +0 -1
  192. package/dist/multi/282.app-8be6acc0a596a2197dbf.js +0 -1
  193. package/dist/multi/29.app-8be6acc0a596a2197dbf.js +0 -1
  194. package/dist/multi/416.app-8be6acc0a596a2197dbf.js +0 -1
  195. package/dist/multi/527.app-8be6acc0a596a2197dbf.js +0 -1
  196. package/dist/multi/600.app-8be6acc0a596a2197dbf.js +0 -1
  197. package/dist/multi/605.app-8be6acc0a596a2197dbf.js +0 -1
  198. package/dist/multi/638.app-8be6acc0a596a2197dbf.js +0 -1
  199. package/dist/multi/672.app-8be6acc0a596a2197dbf.js +0 -1
  200. package/dist/multi/686.app-8be6acc0a596a2197dbf.js +0 -1
  201. package/dist/multi/725.app-8be6acc0a596a2197dbf.js +0 -1
  202. package/dist/multi/741.app-8be6acc0a596a2197dbf.js +0 -1
  203. package/dist/multi/749.app-8be6acc0a596a2197dbf.js +0 -1
  204. package/dist/multi/755.app-8be6acc0a596a2197dbf.js +0 -1
  205. package/dist/multi/943.app-8be6acc0a596a2197dbf.js +0 -1
  206. package/dist/multi/980.app-8be6acc0a596a2197dbf.js +0 -1
  207. package/dist/multi/app-8be6acc0a596a2197dbf.js +0 -2
  208. package/dist/single/app-8221eb856e47b4ef50d6.js +0 -2
  209. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +0 -34
@@ -1,38 +1,22 @@
1
1
  import { allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
- import { useState } from "preact/hooks";
4
- import type { AwesomeTestResult, AwesomeTestStepResult } from "types";
3
+
4
+ import type { TrBodyItem } from "@/components/TestResult/bodyItems";
5
5
  import { TrDropdown } from "@/components/TestResult/TrDropdown";
6
- import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
7
- import { TrStep } from "@/components/TestResult/TrSteps/TrStep";
6
+ import { TrBodyItems } from "@/components/TestResult/TrSteps/TrBodyItems";
8
7
  import { useI18n } from "@/stores/locale";
9
8
  import { collapsedTrees, toggleTree } from "@/stores/tree";
10
- import * as styles from "./styles.scss";
11
9
 
12
- const typeMap = {
13
- step: TrStep,
14
- attachment: TrAttachment,
15
- } as const;
10
+ import * as styles from "./styles.scss";
16
11
 
17
12
  export type TrStepsProps = {
18
- steps: AwesomeTestResult["steps"];
13
+ bodyItems: TrBodyItem[];
19
14
  id?: string;
20
15
  };
21
16
 
22
- type StepComponentProps = FunctionalComponent<{
23
- item?: AwesomeTestStepResult;
24
- stepIndex?: number;
25
- }>;
26
-
27
- export const TrSteps: FunctionalComponent<TrStepsProps> = ({ steps, id }) => {
28
- const stepsId = `${id}-steps`;
29
- const isEarlyCollapsed = Boolean(!collapsedTrees.value.has(stepsId));
30
- const [isOpened, setIsOpen] = useState<boolean>(isEarlyCollapsed);
31
-
32
- const handleClick = () => {
33
- setIsOpen(!isOpened);
34
- toggleTree(stepsId);
35
- };
17
+ export const TrSteps: FunctionalComponent<TrStepsProps> = ({ bodyItems, id }) => {
18
+ const stepsId = id !== null ? `${id}-steps` : null;
19
+ const isOpened = !collapsedTrees.value.has(stepsId);
36
20
 
37
21
  const { t } = useI18n("execution");
38
22
  return (
@@ -40,17 +24,13 @@ export const TrSteps: FunctionalComponent<TrStepsProps> = ({ steps, id }) => {
40
24
  <TrDropdown
41
25
  icon={allureIcons.lineHelpersPlayCircle}
42
26
  isOpened={isOpened}
43
- setIsOpen={handleClick}
44
- counter={steps?.length}
27
+ setIsOpen={() => stepsId !== null && toggleTree(stepsId)}
28
+ counter={bodyItems.length}
45
29
  title={t("body")}
46
30
  />
47
31
  {isOpened && (
48
- <div className={styles["test-result-steps-root"]}>
49
- {steps?.map((item: AwesomeTestStepResult, index) => {
50
- const { type } = item;
51
- const StepComponent: StepComponentProps = typeMap[type];
52
- return StepComponent ? <StepComponent item={item} stepIndex={index + 1} key={index} /> : null;
53
- })}
32
+ <div data-testid="test-result-steps-root" className={styles["test-result-steps-root"]}>
33
+ <TrBodyItems bodyItems={bodyItems} />
54
34
  </div>
55
35
  )}
56
36
  </div>
@@ -24,6 +24,10 @@
24
24
  border-top: 1px solid var(--on-border-muted);
25
25
  }
26
26
 
27
+ .test-result-error-step-content {
28
+ padding-top: 8px;
29
+ }
30
+
27
31
  .test-result-attachment-content {
28
32
  border-top: 1px solid var(--on-border-muted);
29
33
  }
@@ -196,6 +200,10 @@
196
200
  color: var(--bg-control-flat);
197
201
  }
198
202
 
203
+ .item-button-syntax-off {
204
+ opacity: 0.5;
205
+ }
206
+
199
207
  .wrong-attachment-sign {
200
208
  display: flex;
201
209
  justify-content: center;
@@ -1,6 +1,7 @@
1
- import * as styles from "@/components/TestResult/TrSteps/styles.scss";
2
1
  import { useI18n } from "@/stores";
3
2
 
3
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
4
+
4
5
  export const EmptyComponent = () => {
5
6
  const { t } = useI18n("errors");
6
7
 
@@ -1,4 +1,5 @@
1
1
  import { type ComponentChildren } from "preact";
2
+
2
3
  import { NavTab, NavTabs, NavTabsList } from "@/components/NavTabs";
3
4
  import { navigateToTestResultTab } from "@/stores/router";
4
5
  import { currentTrId, trCurrentTab } from "@/stores/testResult";
@@ -2,13 +2,15 @@ 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
+
5
6
  import { TrDropdown } from "@/components/TestResult/TrDropdown";
6
7
  import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
7
8
  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
+ import * as styles from "@/components/TestResult/TrSteps/styles.scss";
13
+
12
14
  const typeMap = {
13
15
  before: TrStep,
14
16
  after: TrStep,
@@ -0,0 +1,151 @@
1
+ import type { AttachmentTestStepResult, DefaultTestStepResult, TestError, TestStatus } from "@allurereport/core-api";
2
+ import type { AwesomeTestResult } from "types";
3
+
4
+ export type TestLevelErrorItem = {
5
+ type: "error";
6
+ id: string;
7
+ title: string;
8
+ status: TestStatus;
9
+ error: TestError;
10
+ };
11
+
12
+ export type TrStepItem = {
13
+ type: "step";
14
+ item: DefaultTestStepResult;
15
+ bodyItems: TrBodyItem[];
16
+ suppressInlineError: boolean;
17
+ };
18
+
19
+ export type TrBodyItem = TrStepItem | AttachmentTestStepResult | TestLevelErrorItem;
20
+
21
+ type TestErrorLike = Pick<TestError, "message" | "trace" | "actual" | "expected">;
22
+
23
+ type BuildResult = {
24
+ bodyItems: TrBodyItem[];
25
+ didPlaceSyntheticError: boolean;
26
+ };
27
+
28
+ // Same pattern as @allurereport/web-commons stripAnsi — kept inline to avoid
29
+ // module-resolution issues in the vitest/webpack dual environment.
30
+ // eslint-disable-next-line no-control-regex
31
+ const ansiRegex = /\x1B\[[0-9;?]*[ -/]*[@-~]/g;
32
+
33
+ export const getTestLevelErrorId = (testResultId: string) => `__test-error__:${testResultId}`;
34
+
35
+ const normalizeErrorText = (value?: string) => {
36
+ if (typeof value !== "string") {
37
+ return "";
38
+ }
39
+
40
+ return value.replace(ansiRegex, "").trim();
41
+ };
42
+
43
+ const getTestLevelErrorTitle = (message?: string) => {
44
+ return (
45
+ normalizeErrorText(message)
46
+ .split("\n")
47
+ .map((line) => line.trim())
48
+ .find((line) => line.length > 0) ?? ""
49
+ );
50
+ };
51
+
52
+ export const hasErrorDiff = (error?: TestErrorLike) =>
53
+ Boolean(error?.actual) && error.actual !== "undefined" && Boolean(error?.expected) && error.expected !== "undefined";
54
+
55
+ export const hasTestLevelErrorContent = (error?: TestErrorLike) =>
56
+ Boolean(normalizeErrorText(error?.trace).length) || hasErrorDiff(error);
57
+
58
+ const isDisplayableTestError = (error?: TestErrorLike) => {
59
+ return (
60
+ Boolean(normalizeErrorText(error?.message).length) ||
61
+ Boolean(normalizeErrorText(error?.trace).length) ||
62
+ hasErrorDiff(error)
63
+ );
64
+ };
65
+
66
+ const canHostSyntheticError = (step: DefaultTestStepResult, error: TestErrorLike) => {
67
+ if (step.status !== "failed" && step.status !== "broken") {
68
+ return false;
69
+ }
70
+
71
+ const stepMessage = normalizeErrorText(step.message);
72
+ const errorMessage = normalizeErrorText(error.message);
73
+
74
+ if (stepMessage && errorMessage) {
75
+ return stepMessage === errorMessage;
76
+ }
77
+
78
+ const stepTrace = normalizeErrorText(step.trace);
79
+ const errorTrace = normalizeErrorText(error.trace);
80
+
81
+ return Boolean(stepTrace) && Boolean(errorTrace) && stepTrace === errorTrace;
82
+ };
83
+
84
+ const createTestLevelErrorItem = (
85
+ testResultId: string,
86
+ status: TestStatus,
87
+ error: TestError,
88
+ fallbackTitle: string,
89
+ ): TestLevelErrorItem => ({
90
+ type: "error",
91
+ id: getTestLevelErrorId(testResultId),
92
+ title: getTestLevelErrorTitle(error.message) || fallbackTitle,
93
+ status,
94
+ error,
95
+ });
96
+
97
+ const buildStepBodyItems = (
98
+ steps: AwesomeTestResult["steps"],
99
+ syntheticErrorItem: TestLevelErrorItem | undefined,
100
+ ): BuildResult => {
101
+ const bodyItems: TrBodyItem[] = [];
102
+ let didPlaceSyntheticError = false;
103
+
104
+ for (const step of steps) {
105
+ if (step.type === "attachment") {
106
+ bodyItems.push(step);
107
+ continue;
108
+ }
109
+
110
+ const nestedResult = buildStepBodyItems(step.steps, syntheticErrorItem);
111
+ const shouldHostSyntheticError =
112
+ Boolean(syntheticErrorItem) &&
113
+ !nestedResult.didPlaceSyntheticError &&
114
+ canHostSyntheticError(step, syntheticErrorItem.error);
115
+
116
+ bodyItems.push({
117
+ type: "step",
118
+ item: step,
119
+ bodyItems: shouldHostSyntheticError ? [...nestedResult.bodyItems, syntheticErrorItem] : nestedResult.bodyItems,
120
+ suppressInlineError: shouldHostSyntheticError,
121
+ });
122
+
123
+ if (nestedResult.didPlaceSyntheticError || shouldHostSyntheticError) {
124
+ didPlaceSyntheticError = true;
125
+ }
126
+ }
127
+
128
+ return { bodyItems, didPlaceSyntheticError };
129
+ };
130
+
131
+ export const getBodyItems = (
132
+ testResult?: Pick<AwesomeTestResult, "id" | "status" | "steps" | "error">,
133
+ fallbackTitle = "Error",
134
+ ): TrBodyItem[] => {
135
+ if (!testResult) {
136
+ return [];
137
+ }
138
+
139
+ const syntheticErrorItem =
140
+ (testResult.status === "failed" || testResult.status === "broken") && isDisplayableTestError(testResult.error)
141
+ ? createTestLevelErrorItem(testResult.id, testResult.status, testResult.error, fallbackTitle)
142
+ : undefined;
143
+
144
+ const { bodyItems, didPlaceSyntheticError } = buildStepBodyItems(testResult.steps, syntheticErrorItem);
145
+
146
+ if (syntheticErrorItem && !didPlaceSyntheticError) {
147
+ return [...bodyItems, syntheticErrorItem];
148
+ }
149
+
150
+ return bodyItems;
151
+ };
@@ -3,6 +3,7 @@ import clsx from "clsx";
3
3
  import type { FunctionComponent, FunctionalComponent } from "preact";
4
4
  import { useEffect } from "preact/hooks";
5
5
  import type { AwesomeTestResult } from "types";
6
+
6
7
  import { TrAttachmentView } from "@/components/TestResult/TrAttachmentsView";
7
8
  import TrEmpty from "@/components/TestResult/TrEmpty";
8
9
  import { TrEnvironmentsView } from "@/components/TestResult/TrEnvironmentsView";
@@ -14,6 +15,7 @@ import { TrTabs } from "@/components/TestResult/TrTabs";
14
15
  import { fetchTestEnvGroup } from "@/stores/env";
15
16
  import { isSplitMode } from "@/stores/layout";
16
17
  import { trCurrentTab } from "@/stores/testResult";
18
+
17
19
  import * as styles from "./styles.scss";
18
20
 
19
21
  export type TrViewProps = {
@@ -1,16 +1,26 @@
1
1
  import { Timeline as AllureTimeline, Grid, GridItem, Loadable, PageLoader, Widget } from "@allurereport/web-components";
2
2
  import { computed } from "@preact/signals";
3
3
  import { useEffect, useMemo } from "preact/hooks";
4
+
4
5
  import { useI18n } from "@/stores";
5
- import { currentEnvironment } from "@/stores/env";
6
+ import { currentEnvironment, environmentNameById } from "@/stores/env";
6
7
  import type { TimlineTr } from "@/stores/timeline";
7
8
  import { fetchTimelineData, timelineStore } from "@/stores/timeline";
9
+
8
10
  import * as styles from "./styles.scss";
9
11
 
10
12
  const getHosts = (tests: TimlineTr[]) => [...new Set(tests.map((test) => test.host))];
11
13
 
12
14
  const filterTestsByHost = (tests: TimlineTr[], host: string) => tests.filter((test) => test.host === host);
13
15
 
16
+ const matchesSelectedEnvironment = (test: TimlineTr, environmentId: string) => {
17
+ if (test.environmentName !== undefined) {
18
+ return test.environment === environmentId;
19
+ }
20
+
21
+ return test.environment === environmentNameById(environmentId);
22
+ };
23
+
14
24
  const currentTimelineData = computed(() => {
15
25
  const tests = timelineStore.value.data ?? [];
16
26
  if (!tests.length) {
@@ -18,7 +28,7 @@ const currentTimelineData = computed(() => {
18
28
  }
19
29
 
20
30
  if (currentEnvironment.value) {
21
- const testsToEnv = tests.filter((test) => test.environment === currentEnvironment.value);
31
+ const testsToEnv = tests.filter((test) => matchesSelectedEnvironment(test, currentEnvironment.value));
22
32
  const hostsByEnv = getHosts(testsToEnv);
23
33
 
24
34
  return hostsByEnv.map((host) => ({
@@ -1,4 +1,5 @@
1
1
  import { IconButton, allureIcons } from "@allurereport/web-components";
2
+
2
3
  import { isSplitMode, toggleLayout } from "@/stores/layout";
3
4
 
4
5
  const ToggleLayout = () => {
@@ -1,14 +1,16 @@
1
1
  import { Button, Loadable, PageLoader, Text, Tree, TreeStatusBar } from "@allurereport/web-components";
2
2
  import { useMemo } from "preact/hooks";
3
+
3
4
  import { MetadataButton } from "@/components/MetadataButton";
4
5
  import { reportStatsStore, statsByEnvStore } from "@/stores";
5
- import { collapsedEnvironments, currentEnvironment, environmentsStore } from "@/stores/env";
6
+ import { collapsedEnvironments, currentEnvironment, environmentNameById, environmentsStore } from "@/stores/env";
6
7
  import { useI18n } from "@/stores/locale";
7
8
  import { navigateToTestResult } from "@/stores/router";
8
9
  import { currentTrId } from "@/stores/testResult";
9
10
  import { collapsedTrees, filteredTree, noTests, noTestsFound, toggleTree, treeStore } from "@/stores/tree";
10
11
  import { clearTreeFilters, treeStatus } from "@/stores/treeFilters/store";
11
12
  import { createTreeLocalizer } from "@/utils/tree";
13
+
12
14
  import * as styles from "./styles.scss";
13
15
 
14
16
  const treeNavigateTo = (id: string) => {
@@ -131,7 +133,9 @@ export const TreeList = () => {
131
133
  <MetadataButton
132
134
  isOpened={isOpened}
133
135
  setIsOpen={toggleEnv}
134
- title={`${tEnvironments("environment", { count: 1 })}: "${key}"`}
136
+ title={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(key)}"`}
137
+ titleTooltipText={`${tEnvironments("environment", { count: 1 })}: "${environmentNameById(key)}"`}
138
+ truncateTitle
135
139
  counter={total}
136
140
  data-testid={"tree-section-env-button"}
137
141
  />
@@ -197,4 +197,15 @@
197
197
  align-items: center;
198
198
  justify-content: space-between;
199
199
  padding: 0 8px 0 6px;
200
+ min-width: 0;
201
+ gap: 8px;
202
+
203
+ > :first-child {
204
+ flex: 1 1 auto;
205
+ min-width: 0;
206
+ }
207
+
208
+ > :last-child {
209
+ flex: 0 0 auto;
210
+ }
200
211
  }
package/src/index.tsx CHANGED
@@ -1,10 +1,12 @@
1
1
  import { ensureReportDataReady } from "@allurereport/web-commons";
2
2
  import { Spinner, SvgIcon, allureIcons } from "@allurereport/web-components";
3
+
3
4
  import "@allurereport/web-components/index.css";
4
5
  import { computed, useSignalEffect } from "@preact/signals";
5
6
  import clsx from "clsx";
6
7
  import { render } from "preact";
7
8
  import { useEffect, useState } from "preact/hooks";
9
+
8
10
  import "@/assets/scss/index.scss";
9
11
  import { Footer } from "@/components/Footer";
10
12
  import { Header } from "@/components/Header";
@@ -20,12 +22,14 @@ import { isLayoutLoading, layoutStore } from "@/stores/layout";
20
22
  import { fetchTestResult, fetchTestResultNav } from "@/stores/testResults";
21
23
  import { fetchEnvTreesData } from "@/stores/tree";
22
24
  import { isMac } from "@/utils/isMac";
25
+
23
26
  import { fetchQualityGateResults } from "./stores/qualityGate";
24
27
  import { rootTabRoute, testResultRoute } from "./stores/router";
25
28
  import { currentSection } from "./stores/sections";
26
29
  import { currentTrId } from "./stores/testResult";
27
30
  import { fetchTreeFiltersData } from "./stores/treeFilters/actions";
28
31
  import { migrateFilterParam } from "./stores/treeFilters/utils";
32
+
29
33
  import * as styles from "./styles.scss";
30
34
 
31
35
  const Loader = () => {
@@ -64,12 +68,14 @@ const App = () => {
64
68
  await waitForI18next;
65
69
  await Promise.all(fns.map((fn) => fn(currentEnvironment.value)));
66
70
 
71
+ const environmentIds = environmentsStore.value.data.map(({ id }) => id);
72
+
67
73
  if (currentEnvironment.value) {
68
74
  await fetchEnvTreesData([currentEnvironment.value]);
69
- await fetchEnvStats(environmentsStore.value.data);
75
+ await fetchEnvStats(environmentIds);
70
76
  } else {
71
- await fetchEnvTreesData(environmentsStore.value.data);
72
- await fetchEnvStats(environmentsStore.value.data);
77
+ await fetchEnvTreesData(environmentIds);
78
+ await fetchEnvStats(environmentIds);
73
79
  }
74
80
 
75
81
  setPrefetched(true);