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

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 (146) hide show
  1. package/dist/multi/{141.app-d01d0c66.js → 141.app-f4b5d260.js} +1 -1
  2. package/dist/multi/{222.app-d01d0c66.js → 222.app-f4b5d260.js} +1 -1
  3. package/dist/multi/335.app-f4b5d260.js +1 -0
  4. package/dist/multi/{34.app-d01d0c66.js → 34.app-f4b5d260.js} +1 -1
  5. package/dist/multi/{349.app-d01d0c66.js → 349.app-f4b5d260.js} +1 -1
  6. package/dist/multi/378.app-f4b5d260.js +1 -0
  7. package/dist/multi/{406.app-d01d0c66.js → 406.app-f4b5d260.js} +1 -1
  8. package/dist/multi/457.app-f4b5d260.js +1 -0
  9. package/dist/multi/{53.app-d01d0c66.js → 53.app-f4b5d260.js} +1 -1
  10. package/dist/multi/{584.app-d01d0c66.js → 584.app-f4b5d260.js} +1 -1
  11. package/dist/multi/{690.app-d01d0c66.js → 690.app-f4b5d260.js} +1 -1
  12. package/dist/multi/{747.app-d01d0c66.js → 747.app-f4b5d260.js} +1 -1
  13. package/dist/multi/{767.app-d01d0c66.js → 767.app-f4b5d260.js} +1 -1
  14. package/dist/multi/{816.app-d01d0c66.js → 816.app-f4b5d260.js} +1 -1
  15. package/dist/multi/{83.app-d01d0c66.js → 83.app-f4b5d260.js} +1 -1
  16. package/dist/multi/{873.app-d01d0c66.js → 873.app-f4b5d260.js} +1 -1
  17. package/dist/multi/{920.app-d01d0c66.js → 920.app-f4b5d260.js} +1 -1
  18. package/dist/multi/{991.app-d01d0c66.js → 991.app-f4b5d260.js} +1 -1
  19. package/dist/multi/app-f4b5d260.js +2 -0
  20. package/dist/multi/{app-d01d0c66.js.LICENSE.txt → app-f4b5d260.js.LICENSE.txt} +0 -8
  21. package/dist/multi/manifest.json +20 -20
  22. package/dist/multi/{styles-d01d0c66.css → styles-f4b5d260.css} +32 -30
  23. package/dist/single/app-b182550e.js +2 -0
  24. package/dist/single/{app-6596cb08.js.LICENSE.txt → app-b182550e.js.LICENSE.txt} +0 -8
  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 -2
  35. package/src/components/LanguagePicker/index.tsx +1 -1
  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 +53 -63
  44. package/src/components/ReportMetadata/index.tsx +50 -3
  45. package/src/components/SideBySide/styles.scss +2 -3
  46. package/src/components/SplitLayout/index.tsx +2 -2
  47. package/src/components/SplitLayout/styles.scss +2 -1
  48. package/src/components/TestResult/TestStepsEmpty/index.tsx +2 -2
  49. package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/index.tsx +4 -4
  50. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +2 -2
  51. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +1 -1
  52. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +6 -6
  53. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  54. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  55. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  56. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  57. package/src/components/TestResult/TrError/TrDiff.tsx +3 -5
  58. package/src/components/TestResult/TrError/index.tsx +21 -6
  59. package/src/components/TestResult/TrError/styles.scss +92 -2
  60. package/src/components/TestResult/{TestResultHeader/TestResultBreadcrumbs.tsx → TrHeader/TrBreadcrumbs.tsx} +3 -3
  61. package/src/components/TestResult/{TestResultHeader → TrHeader}/index.tsx +6 -4
  62. package/src/components/TestResult/{TestResultHistory/TestResultHistoryItem.tsx → TrHistory/TrHistoryItem.tsx} +3 -3
  63. package/src/components/TestResult/{TestResultHistory → TrHistory}/index.tsx +5 -5
  64. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +1 -1
  65. package/src/components/TestResult/{TestResultInfo → TrInfo}/index.tsx +37 -23
  66. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +6 -6
  67. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +4 -4
  68. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +3 -2
  69. package/src/components/TestResult/TrOverview.tsx +47 -0
  70. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +2 -2
  71. package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/index.tsx +6 -6
  72. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  73. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +33 -0
  74. package/src/components/TestResult/TrPwTraces/index.tsx +29 -0
  75. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  76. package/src/components/TestResult/{TestResultRetriesView/TestResultRetriesItem.tsx → TrRetriesView/TrRetriesItem.tsx} +3 -3
  77. package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/index.tsx +4 -6
  78. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +11 -11
  79. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +1 -1
  80. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +3 -2
  81. package/src/components/TestResult/{TestResultSteps/testResultAttachment.tsx → TrSteps/TrAttachment.tsx} +10 -7
  82. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +8 -8
  83. package/src/components/TestResult/{TestResultSteps/testResultStep.tsx → TrSteps/TrStep.tsx} +22 -13
  84. package/src/components/TestResult/{TestResultSteps/testResultStepInfo.tsx → TrSteps/TrStepInfo.tsx} +2 -2
  85. package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +8 -8
  86. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +2 -1
  87. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  88. package/src/components/TestResult/{TestResultTabs → TrTabs}/index.tsx +6 -6
  89. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +11 -11
  90. package/src/components/TestResult/index.tsx +42 -30
  91. package/src/components/TestResult/styles.scss +2 -1
  92. package/src/components/Tree/index.tsx +94 -15
  93. package/src/components/Tree/styles.scss +16 -1
  94. package/src/i18n/constants.ts +3 -3
  95. package/src/i18n/locales/az.json +12 -2
  96. package/src/i18n/locales/de.json +11 -2
  97. package/src/i18n/locales/en.json +11 -2
  98. package/src/i18n/locales/es.json +11 -2
  99. package/src/i18n/locales/fr.json +11 -2
  100. package/src/i18n/locales/he.json +11 -2
  101. package/src/i18n/locales/{am.json → hy.json} +11 -2
  102. package/src/i18n/locales/it.json +11 -2
  103. package/src/i18n/locales/ja.json +11 -2
  104. package/src/i18n/locales/ka.json +11 -2
  105. package/src/i18n/locales/kr.json +11 -2
  106. package/src/i18n/locales/nl.json +11 -2
  107. package/src/i18n/locales/pl.json +11 -2
  108. package/src/i18n/locales/pt.json +10 -2
  109. package/src/i18n/locales/ru.json +11 -2
  110. package/src/i18n/locales/sv.json +11 -2
  111. package/src/i18n/locales/tr.json +11 -2
  112. package/src/i18n/locales/zh.json +11 -2
  113. package/src/index.tsx +36 -33
  114. package/src/stores/chart.ts +3 -3
  115. package/src/stores/env.ts +88 -0
  116. package/src/stores/locale.ts +2 -1
  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/dist/multi/335.app-d01d0c66.js +0 -1
  122. package/dist/multi/378.app-d01d0c66.js +0 -1
  123. package/dist/multi/476.app-d01d0c66.js +0 -1
  124. package/dist/multi/app-d01d0c66.js +0 -2
  125. package/dist/single/app-6596cb08.js +0 -2
  126. package/src/components/ReportLogo/index.tsx +0 -16
  127. package/src/components/ReportLogo/styles.scss +0 -20
  128. package/src/components/ReportLogoFull/index.tsx +0 -20
  129. package/src/components/ReportLogoFull/styles.scss +0 -7
  130. package/src/components/TestResult/TestResultOverview.tsx +0 -43
  131. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  132. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  133. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  134. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  135. /package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +0 -0
  136. /package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +0 -0
  137. /package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +0 -0
  138. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  139. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  140. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  141. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  142. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  143. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  144. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  145. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
  146. /package/src/components/TestResult/{TestResultTabs → TrTabs}/styles.scss +0 -0
@@ -3,7 +3,6 @@
3
3
  --ad-other-modal-overlay: var(--ad-other-modal-overlay-day);
4
4
  --bg-alpha-capella-heavy: var(--bg-alpha-capella-heavy-day);
5
5
  --bg-alpha-capella: var(--bg-alpha-capella-day);
6
- --bg-alpha-castor-heavy: var(--bg-alpha-castor-heavy-day);
7
6
  --bg-base-modal: var(--bg-base-modal-day);
8
7
  --bg-base-neutral: var(--bg-base-neutral-day);
9
8
  --bg-base-primary: var(--bg-base-primary-day);
@@ -49,6 +48,11 @@
49
48
  --on-text-primary: var(--on-text-primary-day);
50
49
  --on-text-secondary: var(--on-text-secondary-day);
51
50
  --scrollbar-color: var(--gray-300);
51
+ --bg-alpha-atlas: var(--atlas-day-darken-1-8);
52
+ --bg-alpha-rau: var(--rau-day-darken-1-8);
53
+ --bg-alpha-castor: var(--castor-day-darken-1-8);
54
+ --bg-alpha-skat: var(--skat-day-darken-1-8);
55
+ --bg-alpha-castor-heavy: var(--bg-alpha-castor-heavy-day);
52
56
 
53
57
  color-scheme: light;
54
58
  }
@@ -115,5 +119,9 @@
115
119
  --on-text-secondary: var(--on-text-secondary-night);
116
120
 
117
121
  --scrollbar-color: var(--gray-400);
122
+ --bg-alpha-atlas: var(--atlas-night-darken-5-12);
123
+ --bg-alpha-rau: var(--rau-night-darken-5-12);
124
+ --bg-alpha-castor: var(--castor-night-darken-5-20);
125
+ --bg-alpha-skat: var(--skat-night-darken-5-12);
118
126
  color-scheme: dark;
119
127
  }
@@ -5,5 +5,4 @@
5
5
 
6
6
  --color-change-transition-duration: 0.15s;
7
7
  --interaction-transition-duration: 0.1s;
8
- --footer-header-sizes: 105px;
9
8
  }
@@ -23,7 +23,7 @@
23
23
 
24
24
  .test-results {
25
25
  min-height: 320px;
26
- padding-bottom: 32px;
26
+ padding-bottom: 64px;
27
27
  padding-top: 12px;
28
28
  }
29
29
 
@@ -51,10 +51,18 @@
51
51
  display: flex;
52
52
  justify-content: space-between;
53
53
  align-items: center;
54
- padding: 16px 8px;
54
+ padding: 8px;
55
55
  }
56
56
 
57
57
  .test-result-errors {
58
58
  padding: 0 24px;
59
59
  margin-top: 12px;
60
+ gap: 4px;
61
+ display: flex;
62
+ flex-wrap: wrap;
63
+ width: 100%;
64
+
65
+ & > div {
66
+ flex: 1 1 auto;
67
+ }
60
68
  }
@@ -0,0 +1,51 @@
1
+ import { DropdownButton, Menu, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import { useI18n } from "@/stores";
3
+ import { currentEnvironment, environmentsStore, setCurrentEnvironment } from "@/stores/env";
4
+ import * as styles from "./styles.scss";
5
+
6
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7
+ export const EnvironmentPicker = () => {
8
+ const { t } = useI18n("environments");
9
+ const environment = currentEnvironment.value;
10
+ const handleSelect = (selectedOption: string) => {
11
+ setCurrentEnvironment(selectedOption);
12
+ };
13
+
14
+ // TODO: use props instead
15
+ if (environmentsStore.value.data.length <= 1) {
16
+ return null;
17
+ }
18
+
19
+ return (
20
+ <div className={styles["environment-picker"]} data-testid={"environment-picker"}>
21
+ <SvgIcon id={allureIcons.environment} size={"s"} />
22
+ <Text className={styles["environment-picker-label"]} type={"ui"} size={"s"} bold>
23
+ {t("environment", { count: 1 })}:
24
+ </Text>
25
+ <Menu
26
+ size="s"
27
+ menuTrigger={({ isOpened, onClick }) => (
28
+ <DropdownButton
29
+ style="ghost"
30
+ size="s"
31
+ text={environment || t("all")}
32
+ isExpanded={isOpened}
33
+ data-testid={"environment-picker-button"}
34
+ onClick={onClick}
35
+ />
36
+ )}
37
+ >
38
+ <Menu.Section>
39
+ <Menu.ItemWithCheckmark onClick={() => handleSelect("")} isChecked={!environment}>
40
+ {t("all")}
41
+ </Menu.ItemWithCheckmark>
42
+ {environmentsStore.value.data.map((env) => (
43
+ <Menu.ItemWithCheckmark onClick={() => handleSelect(env)} key={env} isChecked={env === environment}>
44
+ {env}
45
+ </Menu.ItemWithCheckmark>
46
+ ))}
47
+ </Menu.Section>
48
+ </Menu>
49
+ </div>
50
+ );
51
+ };
@@ -0,0 +1,9 @@
1
+ .environment-picker {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 0 4px;
5
+ }
6
+
7
+ .environment-picker-label {
8
+ text-transform: capitalize;
9
+ }
@@ -1,5 +1,4 @@
1
- import { Text } from "@allurereport/web-components";
2
- import { ReportLogoFull } from "../ReportLogoFull";
1
+ import { ReportLogoFull, Text } from "@allurereport/web-components";
3
2
  import * as styles from "./styles.scss";
4
3
 
5
4
  export const FooterLogo = () => {
@@ -1,7 +1,8 @@
1
1
  import type { ClassValue } from "clsx";
2
2
  import clsx from "clsx";
3
+ import { EnvironmentPicker } from "@/components/EnvironmentPicker";
3
4
  import { LanguagePicker } from "@/components/LanguagePicker";
4
- import { TestResultBreadcrumbs } from "@/components/TestResult/TestResultHeader/TestResultBreadcrumbs";
5
+ import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
5
6
  import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
6
7
  import ToggleLayout from "@/components/ToggleLayout";
7
8
  import { route } from "@/stores/router";
@@ -17,8 +18,9 @@ export const Header = ({ className }: HeaderProps) => {
17
18
 
18
19
  return (
19
20
  <div className={clsx(styles.above, className)}>
20
- {id && <TestResultBreadcrumbs testResult={testResultStore.value?.data?.[id]} />}
21
+ {id && <TrBreadcrumbs testResult={testResultStore.value?.data?.[id]} />}
21
22
  <div className={styles.right}>
23
+ <EnvironmentPicker />
22
24
  <LanguagePicker />
23
25
  <ToggleLayout />
24
26
  <ThemeButton />
@@ -22,7 +22,7 @@ export const LanguagePicker = () => {
22
22
  <DropdownButton
23
23
  style="ghost"
24
24
  size="s"
25
- text={LANG_LOCALE[locale || "en"].short}
25
+ text={(LANG_LOCALE[locale] && LANG_LOCALE[locale].short) || LANG_LOCALE.en.short}
26
26
  isExpanded={isOpened}
27
27
  onClick={onClick}
28
28
  />
@@ -7,5 +7,6 @@
7
7
 
8
8
  .scroll-inside {
9
9
  overflow: auto;
10
- height: calc(100vh - var(--footer-header-sizes));
10
+ height: 100%;
11
+ border-radius: 0;
11
12
  }
@@ -17,6 +17,7 @@ export const MetadataList: FunctionalComponent<MetadataProps & { columns?: numbe
17
17
  <div
18
18
  class={styles["report-metadata-list"]}
19
19
  style={{ gridTemplateColumns: `repeat(${columns}, ${100 / columns - 5}%)` }}
20
+ data-testid={"metadata-list"}
20
21
  >
21
22
  {envInfo?.map(({ name, values, value }) => (
22
23
  <MetadataKeyValue key={name} size={size} title={name} value={value} values={values} />
@@ -25,7 +26,7 @@ export const MetadataList: FunctionalComponent<MetadataProps & { columns?: numbe
25
26
  );
26
27
  };
27
28
 
28
- export const TestResultMetadataList: FunctionalComponent<MetadataProps> = ({ groupedLabels, size = "m" }) => {
29
+ export const TrMetadataList: FunctionalComponent<MetadataProps> = ({ groupedLabels, size = "m" }) => {
29
30
  return (
30
31
  <div class={styles["report-metadata-list"]}>
31
32
  {groupedLabels &&
@@ -97,22 +98,23 @@ const MetadataKeyValue: FunctionalComponent<{
97
98
  size?: "s" | "m";
98
99
  }> = ({ title, value, values, size = "m" }) => {
99
100
  return (
100
- <div className={styles["report-metadata-keyvalue"]}>
101
+ <div className={styles["report-metadata-keyvalue"]} data-testid={"metadata-item"}>
101
102
  <Text
102
103
  type={"ui"}
103
104
  size={size}
104
105
  className={clsx(styles["report-metadata-keyvalue-title"], styles[`report-metadata-${size}`])}
106
+ data-testid={"metadata-item-key"}
105
107
  >
106
108
  {title}
107
109
  </Text>
108
110
  {values?.length ? (
109
- <div className={styles["report-metadata-values"]}>
111
+ <div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
110
112
  {values.map((item) => (
111
113
  <MetaDataKeyLabel key={item} value={item} />
112
114
  ))}
113
115
  </div>
114
116
  ) : (
115
- <div className={styles["report-metadata-values"]}>
117
+ <div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
116
118
  <MetaDataKeyLabel value={value} />
117
119
  </div>
118
120
  )}
@@ -11,22 +11,30 @@ interface MetadataButtonProps {
11
11
  title?: string;
12
12
  }
13
13
 
14
- export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({ isOpened, setIsOpen, counter, title }) => {
14
+ export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({
15
+ isOpened,
16
+ setIsOpen,
17
+ counter,
18
+ title,
19
+ ...rest
20
+ }) => {
15
21
  return (
16
- <div
22
+ <button
23
+ {...rest}
17
24
  className={clsx(styles["report-metadata-header"], isOpened && styles["report-metadata-header-opened"])}
25
+ type={"button"}
18
26
  onClick={() => setIsOpen(!isOpened)}
19
27
  >
20
28
  <Text size={"m"} bold>
21
29
  {title}
22
30
  </Text>
23
- {counter && <Counter count={counter} size="s" />}
31
+ {counter !== null && <Counter count={counter} size="s" />}
24
32
  <ArrowButton
25
33
  isOpened={isOpened}
26
34
  iconSize={"s"}
27
35
  buttonSize={"s"}
28
36
  className={styles["report-metadata-header-arrow"]}
29
37
  />
30
- </div>
38
+ </button>
31
39
  );
32
40
  };
@@ -8,6 +8,9 @@
8
8
  }
9
9
 
10
10
  .report-metadata-header {
11
+ border: none;
12
+ background: none;
13
+ padding: 0;
11
14
  width: max-content;
12
15
  display: flex;
13
16
  align-items: center;
@@ -1,6 +1,6 @@
1
1
  import { statusesList } from "@allurereport/core-api";
2
2
  import { Counter, Loadable } from "@allurereport/web-components";
3
- import { statsStore } from "@/stores";
3
+ import { reportStatsStore } from "@/stores";
4
4
  import { useI18n } from "@/stores/locale";
5
5
  import { treeFiltersStore } from "@/stores/tree";
6
6
  import { capitalize } from "@/utils/capitalize";
@@ -15,13 +15,14 @@ const ALL_TAB = "total";
15
15
 
16
16
  const Header = () => {
17
17
  const { t } = useI18n("statuses");
18
+
18
19
  return (
19
20
  <header className={styles.header}>
20
21
  <HeaderActions />
21
22
  <div className={styles.headerRow}>
22
23
  <TabsList>
23
24
  <Loadable
24
- source={statsStore}
25
+ source={reportStatsStore}
25
26
  renderData={(stats) => {
26
27
  const allStatuses = statusesList
27
28
  .map((status) => ({ status, value: stats[status] }))
@@ -1,10 +1,14 @@
1
+ import { getReportOptions } from "@allurereport/web-commons";
2
+ import { ReportLogo } from "@allurereport/web-components";
1
3
  import * as styles from "@/components/ReportHeader/styles.scss";
2
- import { ReportLogo } from "@/components/ReportLogo";
4
+ import type { AwesomeReportOptions } from "../../../types";
3
5
 
4
6
  export const ReportHeaderLogo = () => {
7
+ const { logo } = getReportOptions<AwesomeReportOptions>() ?? {};
8
+
5
9
  return (
6
10
  <div className={styles["report-header-logo"]}>
7
- <ReportLogo />
11
+ <ReportLogo logo={logo} />
8
12
  </div>
9
13
  );
10
14
  };
@@ -1,5 +1,4 @@
1
- import { Loadable } from "@allurereport/web-components";
2
- import { SuccessRatePieChart } from "@allurereport/web-components";
1
+ import { Loadable, SuccessRatePieChart } from "@allurereport/web-components";
3
2
  import { pieChartStore } from "@/stores/chart";
4
3
  import * as styles from "./styles.scss";
5
4
 
@@ -1,81 +1,71 @@
1
1
  import { type Statistic, statusesList } from "@allurereport/core-api";
2
- import { Loadable } from "@allurereport/web-components";
3
2
  import { computed } from "@preact/signals";
4
- import type { FunctionComponent } from "preact";
3
+ import type { FunctionalComponent } from "preact";
5
4
  import MetadataItem, { type MetadataProps } from "@/components/ReportMetadata/MetadataItem";
6
5
  import { MetadataTestType } from "@/components/ReportMetadata/MetadataTestType";
7
6
  import { MetadataWithIcon } from "@/components/ReportMetadata/MetadataWithIcon";
8
7
  import * as styles from "@/components/ReportMetadata/styles.scss";
9
- import { statsStore } from "@/stores";
10
8
  import { useI18n } from "@/stores/locale";
11
9
  import { capitalize } from "@/utils/capitalize";
12
10
 
13
- export const MetadataSummary: FunctionComponent = () => {
11
+ export interface MetadataSummaryProps {
12
+ stats: Statistic;
13
+ }
14
+
15
+ export const MetadataSummary: FunctionalComponent<MetadataSummaryProps> = ({ stats }) => {
14
16
  const { t } = useI18n("statuses");
15
17
  const { t: testSummary } = useI18n("testSummary");
18
+ const allTest = computed(() => ({
19
+ title: capitalize(t("total")),
20
+ type: "all",
21
+ count: stats.total,
22
+ }));
23
+ const metaDataTests = ["flaky", "retry"]
24
+ .map((key) => {
25
+ if (!stats[key as keyof Statistic]) {
26
+ return;
27
+ }
16
28
 
17
- return (
18
- <Loadable
19
- source={statsStore}
20
- renderError={() => null}
21
- renderData={(stats) => {
22
- const allTest = computed(() => ({
23
- title: capitalize(t("total")),
24
- type: "all",
25
- count: stats.total,
26
- }));
27
- const metaDataTests = ["flaky", "retry"]
28
- .map((key) => {
29
- if (!stats[key as keyof Statistic]) {
30
- return;
31
- }
32
- const title = testSummary(key);
33
- const props = { title, count: stats[key as keyof Statistic] || 0, type: key };
29
+ const title = testSummary(key);
30
+ const props = { title, count: stats[key as keyof Statistic] || 0, type: key };
34
31
 
35
- return (
36
- <div key={key}>
37
- <MetadataItem key={key} props={props} renderComponent={MetadataWithIcon} />
38
- </div>
39
- );
40
- })
41
- .filter(Boolean);
32
+ return (
33
+ <div key={key}>
34
+ <MetadataItem key={key} props={props} renderComponent={MetadataWithIcon} />
35
+ </div>
36
+ );
37
+ })
38
+ .filter(Boolean);
42
39
 
43
- const metadataStatuses = statusesList
44
- .map((status) => ({ status, value: stats[status] }))
45
- .filter(({ value }) => value)
46
- .map(({ status, value }) => {
47
- const title = capitalize(t(status) ?? status ?? "");
48
- const props = {
49
- title,
50
- count: value,
51
- status,
52
- } as MetadataProps;
40
+ const metadataStatuses = statusesList
41
+ .map((status) => ({ status, value: stats[status] }))
42
+ .filter(({ value }) => value)
43
+ .map(({ status, value }) => {
44
+ const title = capitalize(t(status) ?? status ?? "");
45
+ const props = {
46
+ title,
47
+ count: value,
48
+ status,
49
+ } as MetadataProps;
53
50
 
54
- return (
55
- <MetadataItem
56
- data-testid={`metadata-item-${status}`}
57
- key={status}
58
- props={props}
59
- renderComponent={MetadataTestType}
60
- />
61
- );
62
- });
51
+ return (
52
+ <MetadataItem
53
+ data-testid={`metadata-item-${status}`}
54
+ key={status}
55
+ props={props}
56
+ renderComponent={MetadataTestType}
57
+ />
58
+ );
59
+ });
63
60
 
64
- return (
65
- <div class={styles["report-metadata-summary"]}>
66
- <div className={styles["report-metadata-all-tests"]}>
67
- <MetadataItem
68
- data-testid="metadata-item-total"
69
- props={allTest.value}
70
- renderComponent={MetadataWithIcon}
71
- />
72
- {Boolean(metaDataTests.length) && <div className={styles["report-metadata-separator"]} />}
73
- {metaDataTests}
74
- </div>
75
- <div className={styles["report-metadata-status"]}>{metadataStatuses}</div>
76
- </div>
77
- );
78
- }}
79
- />
61
+ return (
62
+ <div class={styles["report-metadata-summary"]}>
63
+ <div className={styles["report-metadata-all-tests"]}>
64
+ <MetadataItem data-testid="metadata-item-total" props={allTest.value} renderComponent={MetadataWithIcon} />
65
+ {Boolean(metaDataTests.length) && <div className={styles["report-metadata-separator"]} />}
66
+ {metaDataTests}
67
+ </div>
68
+ <div className={styles["report-metadata-status"]}>{metadataStatuses}</div>
69
+ </div>
80
70
  );
81
71
  };
@@ -1,24 +1,34 @@
1
1
  import type { EnvironmentItem } from "@allurereport/core-api";
2
2
  import { Loadable } from "@allurereport/web-components";
3
3
  import type { FunctionalComponent } from "preact";
4
- import { useState } from "preact/hooks";
4
+ import { useEffect, useState } from "preact/hooks";
5
5
  import { MetadataList } from "@/components/Metadata";
6
6
  import { MetadataButton } from "@/components/MetadataButton";
7
7
  import { MetadataSummary } from "@/components/ReportMetadata/MetadataSummary";
8
+ import { reportStatsStore, statsByEnvStore, useI18n } from "@/stores";
9
+ import { currentEnvironment } from "@/stores/env";
8
10
  import { envInfoStore } from "@/stores/envInfo";
11
+ import { fetchVariables, variables } from "@/stores/variables";
9
12
  import * as styles from "./styles.scss";
10
13
 
11
14
  export interface MetadataItem extends EnvironmentItem {
12
15
  value?: string;
13
16
  }
14
17
 
18
+ // TODO: check, where do we use the component and refactor it up to our needs
15
19
  export type MetadataProps = {
16
20
  envInfo?: MetadataItem[];
17
21
  size?: "s" | "m";
18
22
  groupedLabels?: Record<string, string[]>;
19
23
  };
20
24
 
21
- const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
25
+ export type MetadataVariablesProps = {
26
+ variables?: Record<string, any>;
27
+ size?: "s" | "m";
28
+ groupedLabels?: Record<string, string[]>;
29
+ };
30
+
31
+ const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo = [] }) => {
22
32
  const [isOpened, setIsOpen] = useState(true);
23
33
  const convertedEnvInfo = envInfo.map((env) => {
24
34
  return { ...env, value: env.values.join(", ") };
@@ -32,10 +42,47 @@ const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
32
42
  );
33
43
  };
34
44
 
45
+ const MetadataVariables: FunctionalComponent<MetadataVariablesProps> = (props) => {
46
+ const { t } = useI18n("ui");
47
+ const [isOpened, setIsOpen] = useState(true);
48
+ const convertedEnvInfo = Object.entries(props.variables).map(([key, value]) => {
49
+ return {
50
+ name: key,
51
+ value,
52
+ } as MetadataItem;
53
+ });
54
+
55
+ return (
56
+ <div class={styles["report-metadata"]} data-testid={"report-variables"}>
57
+ <MetadataButton
58
+ isOpened={isOpened}
59
+ setIsOpen={setIsOpen}
60
+ title={t("variables")}
61
+ counter={Object.keys(props.variables).length}
62
+ data-testid={"report-variables-button"}
63
+ />
64
+ {isOpened && <MetadataList envInfo={convertedEnvInfo} />}
65
+ </div>
66
+ );
67
+ };
68
+
35
69
  export const ReportMetadata = () => {
70
+ const stats = currentEnvironment.value
71
+ ? statsByEnvStore.value.data[currentEnvironment.value]
72
+ : reportStatsStore.value.data;
73
+
74
+ useEffect(() => {
75
+ fetchVariables(currentEnvironment.value);
76
+ }, [currentEnvironment.value]);
77
+
36
78
  return (
37
79
  <div className={styles["report-metadata-wrapper"]}>
38
- <MetadataSummary />
80
+ {stats && <MetadataSummary stats={stats} />}
81
+ <Loadable
82
+ source={variables}
83
+ transformData={(data) => data?.[currentEnvironment.value ?? "default"] ?? {}}
84
+ renderData={(data) => !!Object.keys(data).length && <MetadataVariables variables={data} />}
85
+ />
39
86
  <Loadable
40
87
  source={envInfoStore}
41
88
  renderError={() => null}
@@ -1,13 +1,14 @@
1
1
  .side {
2
2
  width: 100%;
3
- padding: 0;
4
3
  margin: 0;
5
4
  overflow: hidden;
6
5
  display: flex;
7
6
  max-width: 1920px;
8
7
  justify-content: space-between;
9
8
  height: 100%;
9
+ padding: 0 8px;
10
10
  }
11
+
11
12
  .wrapper {
12
13
  width: 100%;
13
14
  flex-direction: column;
@@ -15,7 +16,6 @@
15
16
  }
16
17
 
17
18
  .side-left {
18
- padding: 8px 0 8px 8px;
19
19
  margin-right: auto;
20
20
  transition: width 50ms;
21
21
  will-change: width;
@@ -23,7 +23,6 @@
23
23
 
24
24
  .side-right {
25
25
  flex: 1 1 auto;
26
- padding: 8px 8px 8px 0;
27
26
  margin-left: auto;
28
27
  transition: width 200ms;
29
28
  will-change: width, height;
@@ -40,7 +40,7 @@ export const SplitLayout = () => {
40
40
  <Loadable source={treeStore} renderLoader={() => <PageLoader />} renderData={() => <MainReportWrapper />} />
41
41
  );
42
42
 
43
- const TestResultView = () => {
43
+ const TrView = () => {
44
44
  return testResultId ? (
45
45
  <Loadable
46
46
  source={testResultStore}
@@ -70,7 +70,7 @@ export const SplitLayout = () => {
70
70
  return (
71
71
  <div className={styles["side-by-side"]} data-testId={"split-layout"}>
72
72
  <Header className={styles.header} />
73
- <SideBySide left={cachedMain} right={<TestResultView />} />
73
+ <SideBySide left={cachedMain} right={<TrView />} />
74
74
  <Footer />
75
75
  </div>
76
76
  );
@@ -12,6 +12,7 @@
12
12
  flex-direction: column;
13
13
  margin: auto;
14
14
  position: relative;
15
+ height: 100%;
15
16
  }
16
17
 
17
18
  .content {
@@ -80,6 +81,6 @@
80
81
  }
81
82
 
82
83
  .header {
83
- padding: 8px 8px 0;
84
+ padding: 8px;
84
85
  margin-bottom: 0;
85
86
  }
@@ -2,7 +2,7 @@ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
2
  import { useI18n } from "@/stores";
3
3
  import * as styles from "./styles.scss";
4
4
 
5
- const TestStepsEmpty = () => {
5
+ const TrStepsEmpty = () => {
6
6
  const { t } = useI18n("empty");
7
7
  return (
8
8
  <div className={styles["test-steps-empty"]}>
@@ -20,4 +20,4 @@ const TestStepsEmpty = () => {
20
20
  );
21
21
  };
22
22
 
23
- export default TestStepsEmpty;
23
+ export default TrStepsEmpty;
@@ -1,15 +1,15 @@
1
1
  import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import type { AwesomeTestResult } from "types";
4
- import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
4
+ import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
5
5
  import { useI18n } from "@/stores";
6
6
  import * as styles from "./styles.scss";
7
7
 
8
- export type TestResultAttachmentViewProps = {
8
+ export type TrAttachmentViewProps = {
9
9
  testResult?: AwesomeTestResult;
10
10
  };
11
11
 
12
- export const TestResultAttachmentView: FunctionalComponent<TestResultAttachmentViewProps> = ({ testResult }) => {
12
+ export const TrAttachmentView: FunctionalComponent<TrAttachmentViewProps> = ({ testResult }) => {
13
13
  const { attachments } = testResult ?? {};
14
14
  const { t } = useI18n("empty");
15
15
 
@@ -17,7 +17,7 @@ export const TestResultAttachmentView: FunctionalComponent<TestResultAttachmentV
17
17
  <div className={styles["test-result-attachments-view"]}>
18
18
  {attachments.length ? (
19
19
  attachments?.map((attach, key) => (
20
- <TestResultAttachment item={attach as AttachmentTestStepResult} key={key} stepIndex={key + 1} />
20
+ <TrAttachment item={attach as AttachmentTestStepResult} key={key} stepIndex={key + 1} />
21
21
  ))
22
22
  ) : (
23
23
  <div className={styles["test-result-empty"]}>{t("no-attachments-results")}</div>