@allurereport/web-awesome 3.0.0-beta.17 → 3.0.0-beta.18
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.
- package/dist/multi/173.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/174.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/252.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/282.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/29.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/416.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/527.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/600.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/605.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/638.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/672.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/686.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/725.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/741.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/755.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/894.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/943.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/980.app-b58a8b2733d390b78773.js +1 -0
- package/dist/multi/app-b58a8b2733d390b78773.js +2 -0
- package/dist/multi/{app-3f57abaa5734556b2988.js.LICENSE.txt → app-b58a8b2733d390b78773.js.LICENSE.txt} +0 -8
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-9475296a2cbcd0e5d2d0.css → styles-3610e3d9923b6a2a1c67.css} +12 -10
- package/dist/single/app-51defb8852956a2ff6f1.js +2 -0
- package/dist/single/{app-800f7e75bb52ecb2ae21.js.LICENSE.txt → app-51defb8852956a2ff6f1.js.LICENSE.txt} +0 -8
- package/dist/single/manifest.json +1 -1
- package/package.json +5 -4
- package/src/components/Charts/index.tsx +12 -3
- package/src/components/MainReport/index.tsx +65 -2
- package/src/components/MainReport/styles.scss +8 -0
- package/src/components/NavTabs/index.tsx +70 -0
- package/src/components/ReportBody/index.tsx +1 -1
- package/src/components/ReportBody/styles.scss +2 -2
- package/src/components/ReportGlobalAttachments/index.tsx +34 -0
- package/src/components/ReportGlobalAttachments/styles.scss +11 -0
- package/src/components/ReportGlobalErrors/index.tsx +30 -0
- package/src/components/ReportGlobalErrors/styles.scss +12 -0
- package/src/components/ReportHeader/index.tsx +28 -10
- package/src/components/ReportHeader/styles.scss +7 -1
- package/src/components/ReportMetadata/MetadataSummary.tsx +1 -1
- package/src/components/ReportMetadata/styles.scss +0 -2
- package/src/components/TestResult/TrAttachmentsView/index.tsx +5 -3
- package/src/components/TestResult/TrInfo/TrInfoStatuses.tsx +1 -1
- package/src/components/TestResult/TrPrevStatuses/index.tsx +1 -2
- package/src/components/TestResult/TrSeverity/index.tsx +1 -1
- package/src/components/TestResult/TrStatus/index.tsx +1 -1
- package/src/components/TestResult/TrSteps/TrStepInfo.tsx +4 -4
- package/src/components/TestResult/TrSteps/styles.scss +10 -1
- package/src/components/TestResult/TrTabs/index.tsx +19 -57
- package/src/components/TestResult/index.tsx +0 -1
- package/src/index.tsx +9 -1
- package/src/locales/az.json +8 -2
- package/src/locales/de.json +8 -2
- package/src/locales/en.json +8 -2
- package/src/locales/es.json +8 -2
- package/src/locales/fr.json +8 -2
- package/src/locales/he.json +8 -2
- package/src/locales/hy.json +8 -2
- package/src/locales/it.json +8 -2
- package/src/locales/ja.json +8 -2
- package/src/locales/ka.json +8 -2
- package/src/locales/kr.json +8 -2
- package/src/locales/nl.json +8 -2
- package/src/locales/pl.json +8 -2
- package/src/locales/pt.json +8 -2
- package/src/locales/ru.json +8 -2
- package/src/locales/sv.json +8 -2
- package/src/locales/tr.json +8 -2
- package/src/locales/zh.json +8 -2
- package/src/stores/chart.ts +7 -7
- package/src/stores/globals.ts +28 -0
- package/vitest.config.ts +15 -1
- package/dist/multi/173.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/174.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/252.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/282.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/29.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/416.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/527.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/600.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/605.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/638.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/672.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/686.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/725.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/741.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/755.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/894.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/943.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/980.app-3f57abaa5734556b2988.js +0 -1
- package/dist/multi/app-3f57abaa5734556b2988.js +0 -2
- package/dist/single/app-800f7e75bb52ecb2ae21.js +0 -2
- package/src/utils/capitalize.ts +0 -6
- package/src/utils/charts.ts +0 -167
- /package/src/components/{TestResult/TrTabs → NavTabs}/styles.scss +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-awesome",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.18",
|
|
4
4
|
"description": "The static files for Allure Awesome Report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
"IE 11"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/
|
|
36
|
-
"@allurereport/web-
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.18",
|
|
35
|
+
"@allurereport/plugin-api": "3.0.0-beta.18",
|
|
36
|
+
"@allurereport/web-commons": "3.0.0-beta.18",
|
|
37
|
+
"@allurereport/web-components": "3.0.0-beta.18",
|
|
37
38
|
"@preact/signals": "^1.3.0",
|
|
38
39
|
"clsx": "^2.1.1",
|
|
39
40
|
"d3-shape": "^3.2.0",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
-
import { ChartType
|
|
2
|
+
import { ChartType } from "@allurereport/core-api";
|
|
3
|
+
import { type UIChartData, capitalize } from "@allurereport/web-commons";
|
|
3
4
|
import {
|
|
5
|
+
ComingSoonChartWidget,
|
|
4
6
|
Grid,
|
|
5
7
|
GridItem,
|
|
6
8
|
Loadable,
|
|
@@ -12,11 +14,10 @@ import {
|
|
|
12
14
|
import { useEffect } from "preact/hooks";
|
|
13
15
|
import { chartsStore, fetchChartsData } from "@/stores/chart";
|
|
14
16
|
import { useI18n } from "@/stores/locale";
|
|
15
|
-
import type { ChartData } from "@/utils/charts";
|
|
16
17
|
import * as styles from "./styles.scss";
|
|
17
18
|
|
|
18
19
|
const getChartWidgetByType = (
|
|
19
|
-
chartData:
|
|
20
|
+
chartData: UIChartData,
|
|
20
21
|
{ t, empty }: Record<string, (key: string, options?: any) => string>,
|
|
21
22
|
) => {
|
|
22
23
|
switch (chartData.type) {
|
|
@@ -50,6 +51,14 @@ const getChartWidgetByType = (
|
|
|
50
51
|
</Widget>
|
|
51
52
|
);
|
|
52
53
|
}
|
|
54
|
+
case ChartType.HeatMap:
|
|
55
|
+
case ChartType.Bar:
|
|
56
|
+
case ChartType.Funnel:
|
|
57
|
+
case ChartType.TreeMap: {
|
|
58
|
+
const title = chartData.title ?? t(`charts.${chartData.type}.title`, { fallback: `${chartData.type} Chart` });
|
|
59
|
+
|
|
60
|
+
return <ComingSoonChartWidget title={title} />;
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
};
|
|
55
64
|
|
|
@@ -1,17 +1,80 @@
|
|
|
1
|
+
import { Counter, Loadable } from "@allurereport/web-components";
|
|
1
2
|
import clsx from "clsx";
|
|
3
|
+
import { NavTab, NavTabs, NavTabsList, useNavTabsContext } from "@/components/NavTabs";
|
|
2
4
|
import { ReportBody } from "@/components/ReportBody";
|
|
5
|
+
import { ReportGlobalAttachments } from "@/components/ReportGlobalAttachments";
|
|
6
|
+
import { ReportGlobalErrors } from "@/components/ReportGlobalErrors";
|
|
3
7
|
import { ReportHeader } from "@/components/ReportHeader";
|
|
4
8
|
import { ReportMetadata } from "@/components/ReportMetadata";
|
|
9
|
+
import { reportStatsStore } from "@/stores";
|
|
10
|
+
import { useI18n } from "@/stores";
|
|
11
|
+
import { globalsStore } from "@/stores/globals";
|
|
5
12
|
import { isSplitMode } from "@/stores/layout";
|
|
6
13
|
import * as styles from "./styles.scss";
|
|
7
14
|
|
|
15
|
+
enum ReportRootTab {
|
|
16
|
+
Results = "results",
|
|
17
|
+
GlobalAttachments = "globalAttachments",
|
|
18
|
+
GlobalErrors = "globalErrors",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const viewsByTab = {
|
|
22
|
+
[ReportRootTab.Results]: () => (
|
|
23
|
+
<>
|
|
24
|
+
<ReportMetadata />
|
|
25
|
+
<ReportBody />
|
|
26
|
+
</>
|
|
27
|
+
),
|
|
28
|
+
[ReportRootTab.GlobalAttachments]: () => <ReportGlobalAttachments />,
|
|
29
|
+
[ReportRootTab.GlobalErrors]: () => <ReportGlobalErrors />,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const MainReportContent = () => {
|
|
33
|
+
const { currentTab } = useNavTabsContext();
|
|
34
|
+
const tab = (currentTab as ReportRootTab) || ReportRootTab.Results;
|
|
35
|
+
const Content = viewsByTab[tab];
|
|
36
|
+
|
|
37
|
+
return <Content />;
|
|
38
|
+
};
|
|
39
|
+
|
|
8
40
|
const MainReport = () => {
|
|
41
|
+
const { t } = useI18n("tabs");
|
|
42
|
+
|
|
9
43
|
return (
|
|
10
44
|
<>
|
|
11
45
|
<div className={clsx(styles.content, isSplitMode.value ? styles["scroll-inside"] : "")}>
|
|
12
46
|
<ReportHeader />
|
|
13
|
-
<
|
|
14
|
-
|
|
47
|
+
<div className={styles["main-report-tabs"]}>
|
|
48
|
+
<NavTabs initialTab={ReportRootTab.Results}>
|
|
49
|
+
<NavTabsList>
|
|
50
|
+
<Loadable
|
|
51
|
+
source={reportStatsStore}
|
|
52
|
+
renderData={(stats) => (
|
|
53
|
+
<NavTab id={ReportRootTab.Results}>
|
|
54
|
+
{t("results")} <Counter count={stats?.total ?? 0} />
|
|
55
|
+
</NavTab>
|
|
56
|
+
)}
|
|
57
|
+
/>
|
|
58
|
+
<Loadable
|
|
59
|
+
source={globalsStore}
|
|
60
|
+
renderData={({ attachments = [], errors = [] }) => (
|
|
61
|
+
<>
|
|
62
|
+
<NavTab id={ReportRootTab.GlobalAttachments}>
|
|
63
|
+
{t("globalAttachments")} <Counter count={attachments.length} />
|
|
64
|
+
</NavTab>
|
|
65
|
+
<NavTab id={ReportRootTab.GlobalErrors}>
|
|
66
|
+
{t("globalErrors")}{" "}
|
|
67
|
+
<Counter status={errors.length > 0 ? "failed" : undefined} count={errors.length} />
|
|
68
|
+
</NavTab>
|
|
69
|
+
</>
|
|
70
|
+
)}
|
|
71
|
+
/>
|
|
72
|
+
</NavTabsList>
|
|
73
|
+
<div className={styles["main-report-tabs-content"]}>
|
|
74
|
+
<MainReportContent />
|
|
75
|
+
</div>
|
|
76
|
+
</NavTabs>
|
|
77
|
+
</div>
|
|
15
78
|
</div>
|
|
16
79
|
</>
|
|
17
80
|
);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Text } from "@allurereport/web-components";
|
|
2
|
+
import { type ComponentChildren, createContext } from "preact";
|
|
3
|
+
import { useContext, useState } from "preact/hooks";
|
|
4
|
+
import * as styles from "./styles.scss";
|
|
5
|
+
|
|
6
|
+
type NavTabsContextT = {
|
|
7
|
+
currentTab: string | undefined;
|
|
8
|
+
setCurrentTab: (id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const NavTabsContext = createContext<NavTabsContextT | null>(null);
|
|
12
|
+
|
|
13
|
+
export const useNavTabsContext = () => {
|
|
14
|
+
const context = useContext(NavTabsContext);
|
|
15
|
+
|
|
16
|
+
if (!context) {
|
|
17
|
+
throw new Error("NavTabs components must be used within a NavTabs component");
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return context;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const NavTabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
|
|
24
|
+
const { children, initialTab } = props;
|
|
25
|
+
const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
|
|
26
|
+
|
|
27
|
+
return <NavTabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</NavTabsContext.Provider>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const NavTabs = (props: { children: ComponentChildren; initialTab?: string }) => {
|
|
31
|
+
return <NavTabsProvider {...props} />;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const NavTabsList = (props: { children: ComponentChildren }) => {
|
|
35
|
+
return <div className={styles.tabsList}>{props.children}</div>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const NavTab = (props: {
|
|
39
|
+
"id": string;
|
|
40
|
+
"children": ComponentChildren;
|
|
41
|
+
"onClick"?: () => void;
|
|
42
|
+
"data-testid"?: string;
|
|
43
|
+
"isCurrentTab"?: boolean;
|
|
44
|
+
}) => {
|
|
45
|
+
const { currentTab, setCurrentTab } = useNavTabsContext();
|
|
46
|
+
const { id, children, onClick, "data-testid": dataTestId, "isCurrentTab": overrideIsCurrentTab } = props;
|
|
47
|
+
const isCurrentTab = overrideIsCurrentTab !== undefined ? overrideIsCurrentTab : currentTab === id;
|
|
48
|
+
const handleTabClick = () => {
|
|
49
|
+
if (onClick) {
|
|
50
|
+
onClick();
|
|
51
|
+
} else if (isCurrentTab) {
|
|
52
|
+
return;
|
|
53
|
+
} else {
|
|
54
|
+
setCurrentTab(id);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<button
|
|
60
|
+
className={styles.tab}
|
|
61
|
+
onClick={handleTabClick}
|
|
62
|
+
data-testid={dataTestId || `nav-tab-${id}`}
|
|
63
|
+
aria-current={isCurrentTab ? true : undefined}
|
|
64
|
+
>
|
|
65
|
+
<Text type="paragraph" size="m">
|
|
66
|
+
{children}
|
|
67
|
+
</Text>
|
|
68
|
+
</button>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { statusesList } from "@allurereport/core-api";
|
|
2
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
2
3
|
import { Counter, Loadable } from "@allurereport/web-components";
|
|
3
4
|
import { reportStatsStore, statsByEnvStore } from "@/stores";
|
|
4
5
|
import { currentEnvironment } from "@/stores/env";
|
|
5
6
|
import { useI18n } from "@/stores/locale";
|
|
6
7
|
import { setTreeStatus, treeFiltersStore } from "@/stores/tree";
|
|
7
|
-
import { capitalize } from "@/utils/capitalize";
|
|
8
8
|
import { Tab, Tabs, TabsList, useTabsContext } from "../Tabs";
|
|
9
9
|
import { TreeList } from "../Tree";
|
|
10
10
|
import { HeaderActions } from "./HeaderActions";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { Loadable } from "@allurereport/web-components";
|
|
3
|
+
import { TrAttachmentView } from "@/components/TestResult/TrAttachmentsView";
|
|
4
|
+
import { useI18n } from "@/stores";
|
|
5
|
+
import { globalsStore } from "@/stores/globals";
|
|
6
|
+
import { AwesomeTestResult } from "../../../types";
|
|
7
|
+
import * as styles from "./styles.scss";
|
|
8
|
+
|
|
9
|
+
export const ReportGlobalAttachments = () => {
|
|
10
|
+
const { t } = useI18n("empty");
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Loadable
|
|
14
|
+
source={globalsStore}
|
|
15
|
+
renderData={({ attachments }) => {
|
|
16
|
+
if (!attachments.length) {
|
|
17
|
+
return <div className={styles["report-global-attachments-empty"]}>{t("no-attachments-results")}</div>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const attachmentSteps: AttachmentTestStepResult[] = attachments.map((attachment: any) => ({
|
|
21
|
+
link: attachment,
|
|
22
|
+
type: "attachment",
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<TrAttachmentView
|
|
27
|
+
className={styles["report-global-attachments"]}
|
|
28
|
+
testResult={{ attachments: attachmentSteps } as AwesomeTestResult}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Loadable } from "@allurereport/web-components";
|
|
2
|
+
import { TrError } from "@/components/TestResult/TrError";
|
|
3
|
+
import { useI18n } from "@/stores";
|
|
4
|
+
import { globalsStore } from "@/stores/globals";
|
|
5
|
+
import * as styles from "./styles.scss";
|
|
6
|
+
|
|
7
|
+
export const ReportGlobalErrors = () => {
|
|
8
|
+
const { t } = useI18n("empty");
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<Loadable
|
|
12
|
+
source={globalsStore}
|
|
13
|
+
renderData={({ errors }) => {
|
|
14
|
+
if (!errors.length) {
|
|
15
|
+
return <div className={styles["report-global-errors-empty"]}>{t("no-global-errors-results")}</div>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<ul className={styles["report-global-errors"]}>
|
|
20
|
+
{errors.map((error, i) => (
|
|
21
|
+
<li key={i} style={{ marginBottom: "8px" }}>
|
|
22
|
+
<TrError {...error} />
|
|
23
|
+
</li>
|
|
24
|
+
))}
|
|
25
|
+
</ul>
|
|
26
|
+
);
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
-
import { Heading, Text } from "@allurereport/web-components";
|
|
2
|
+
import { Heading, Loadable, Text, TooltipWrapper } from "@allurereport/web-components";
|
|
3
3
|
import type { AwesomeReportOptions } from "types";
|
|
4
4
|
import { ReportHeaderLogo } from "@/components/ReportHeader/ReportHeaderLogo";
|
|
5
5
|
import { ReportHeaderPie } from "@/components/ReportHeader/ReportHeaderPie";
|
|
6
|
-
import {
|
|
6
|
+
import { TrStatus } from "@/components/TestResult/TrStatus";
|
|
7
|
+
import { currentLocaleIso, useI18n } from "@/stores";
|
|
8
|
+
import { globalsStore } from "@/stores/globals";
|
|
7
9
|
import * as styles from "./styles.scss";
|
|
8
10
|
|
|
9
11
|
export const ReportHeader = () => {
|
|
10
12
|
const { reportName, createdAt } = getReportOptions<AwesomeReportOptions>() ?? {};
|
|
13
|
+
const { t } = useI18n("ui");
|
|
11
14
|
const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
|
|
12
15
|
month: "long",
|
|
13
16
|
day: "numeric",
|
|
@@ -21,14 +24,29 @@ export const ReportHeader = () => {
|
|
|
21
24
|
<div className={styles["report-header"]}>
|
|
22
25
|
<div className={styles["report-wrapper"]}>
|
|
23
26
|
<ReportHeaderLogo />
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
<Loadable
|
|
28
|
+
source={globalsStore}
|
|
29
|
+
renderData={({ exitCode }) => {
|
|
30
|
+
const code = exitCode?.actual ?? exitCode.original;
|
|
31
|
+
const status = code === 0 ? "passed" : "failed";
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className={styles["report-wrapper-text"]}>
|
|
35
|
+
<div className={styles["report-header-title"]}>
|
|
36
|
+
<TrStatus status={status} />
|
|
37
|
+
<Heading size={"s"} tag={"h2"} className={styles["wrapper-header"]} data-testid="report-title">
|
|
38
|
+
{reportName}
|
|
39
|
+
</Heading>
|
|
40
|
+
</div>
|
|
41
|
+
<Text type="paragraph" size="m" className={styles["report-date"]} data-testid="report-data">
|
|
42
|
+
{exitCode.actual !== undefined
|
|
43
|
+
? t("finishedAtBoth", { formattedCreatedAt, actual: exitCode.actual, original: exitCode.original })
|
|
44
|
+
: t("finishedAtOriginal", { formattedCreatedAt, original: exitCode.original })}
|
|
45
|
+
</Text>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
32
50
|
</div>
|
|
33
51
|
<ReportHeaderPie />
|
|
34
52
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
column-gap: 12px;
|
|
4
4
|
justify-content: space-between;
|
|
5
|
-
padding: 24px;
|
|
5
|
+
padding: 24px 24px 0;
|
|
6
6
|
align-items: flex-start;
|
|
7
7
|
background: var(--bg-base-primary);
|
|
8
8
|
border-radius: 8px;
|
|
@@ -49,3 +49,9 @@
|
|
|
49
49
|
.report-header-pie-chart {
|
|
50
50
|
width: 88px;
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
.report-header-title {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 0 4px;
|
|
57
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Statistic, statusesList } from "@allurereport/core-api";
|
|
2
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
2
3
|
import { computed } from "@preact/signals";
|
|
3
4
|
import type { FunctionalComponent } from "preact";
|
|
4
5
|
import MetadataItem, { type MetadataProps } from "@/components/ReportMetadata/MetadataItem";
|
|
@@ -6,7 +7,6 @@ import { MetadataTestType } from "@/components/ReportMetadata/MetadataTestType";
|
|
|
6
7
|
import { MetadataWithIcon } from "@/components/ReportMetadata/MetadataWithIcon";
|
|
7
8
|
import * as styles from "@/components/ReportMetadata/styles.scss";
|
|
8
9
|
import { useI18n } from "@/stores/locale";
|
|
9
|
-
import { capitalize } from "@/utils/capitalize";
|
|
10
10
|
|
|
11
11
|
export interface MetadataSummaryProps {
|
|
12
12
|
stats: Statistic;
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.report-metadata-wrapper {
|
|
9
|
-
padding: 0 24px;
|
|
10
9
|
align-items: center;
|
|
11
10
|
}
|
|
12
11
|
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
justify-content: space-between;
|
|
28
27
|
align-items: baseline;
|
|
29
28
|
padding: 16px 0;
|
|
30
|
-
border-top: 1px solid var(--on-border-primary);
|
|
31
29
|
border-bottom: 1px solid var(--on-border-primary);
|
|
32
30
|
width: 100%;
|
|
33
31
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import cx from "clsx";
|
|
2
3
|
import type { FunctionalComponent } from "preact";
|
|
3
4
|
import type { AwesomeTestResult } from "types";
|
|
4
5
|
import { TrAttachment } from "@/components/TestResult/TrSteps/TrAttachment";
|
|
@@ -6,15 +7,16 @@ import { useI18n } from "@/stores";
|
|
|
6
7
|
import * as styles from "./styles.scss";
|
|
7
8
|
|
|
8
9
|
export type TrAttachmentViewProps = {
|
|
10
|
+
className?: string;
|
|
9
11
|
testResult?: AwesomeTestResult;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
|
-
export const TrAttachmentView: FunctionalComponent<TrAttachmentViewProps> = ({ testResult }) => {
|
|
14
|
+
export const TrAttachmentView: FunctionalComponent<TrAttachmentViewProps> = ({ testResult, className }) => {
|
|
13
15
|
const { attachments } = testResult ?? {};
|
|
14
|
-
const { t } = useI18n("
|
|
16
|
+
const { t } = useI18n("ui");
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
|
-
<div className={styles["test-result-attachments-view"]}>
|
|
19
|
+
<div className={cx(styles["test-result-attachments-view"], className)}>
|
|
18
20
|
{attachments.length ? (
|
|
19
21
|
attachments?.map((attach, key) => (
|
|
20
22
|
<TrAttachment item={attach as AttachmentTestStepResult} key={key} stepIndex={key + 1} />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
1
2
|
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
3
|
import { type FunctionalComponent } from "preact";
|
|
3
4
|
import { useI18n } from "@/stores";
|
|
4
|
-
import { capitalize } from "@/utils/capitalize";
|
|
5
5
|
import * as styles from "./styles.scss";
|
|
6
6
|
|
|
7
7
|
const icons: Record<string, string> = {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type HistoryTestResult } from "@allurereport/core-api";
|
|
2
|
-
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
+
import { capitalize, getReportOptions } from "@allurereport/web-commons";
|
|
3
3
|
import { SvgIcon, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
4
4
|
import type { FunctionalComponent } from "preact";
|
|
5
5
|
import type { AwesomeReportOptions, AwesomeTestResult } from "types";
|
|
6
6
|
import { useI18n } from "@/stores";
|
|
7
|
-
import { capitalize } from "@/utils/capitalize";
|
|
8
7
|
import { timestampToDate } from "@/utils/time";
|
|
9
8
|
import * as styles from "./styles.scss";
|
|
10
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
1
2
|
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import { useI18n } from "@/stores/locale";
|
|
4
|
-
import { capitalize } from "@/utils/capitalize";
|
|
5
5
|
import * as styles from "./styles.scss";
|
|
6
6
|
|
|
7
7
|
const icons: Record<string, string> = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { TestStatus } from "@allurereport/core-api";
|
|
2
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
2
3
|
import { Text, TreeItemIcon } from "@allurereport/web-components";
|
|
3
4
|
import clsx from "clsx";
|
|
4
5
|
import { useI18n } from "@/stores";
|
|
5
|
-
import { capitalize } from "@/utils/capitalize";
|
|
6
6
|
import * as styles from "./styles.scss";
|
|
7
7
|
|
|
8
8
|
export const TrStatus = ({ status }: { status: TestStatus }) => {
|
|
@@ -50,18 +50,18 @@ export const TrStepInfo = (props: { item: DefaultTestStepResult }) => {
|
|
|
50
50
|
const stepLength = item.steps?.length;
|
|
51
51
|
const attachmentLength = item.steps?.filter((step) => step.type === "attachment")?.length;
|
|
52
52
|
|
|
53
|
-
const failedStepsInTree = countErrorStatuses(item);
|
|
53
|
+
const failedStepsInTree = countErrorStatuses(item) || {};
|
|
54
54
|
|
|
55
55
|
const FailedSteps = () => (
|
|
56
|
-
<div>
|
|
56
|
+
<div className={styles["failed-steps"]}>
|
|
57
57
|
{Object.entries(failedStepsInTree).map(([status, count], index) => (
|
|
58
58
|
<div className={styles["item-status"]} key={index}>
|
|
59
59
|
<SvgIcon
|
|
60
|
-
size="
|
|
60
|
+
size="s"
|
|
61
61
|
id={icons[status as TestStatus]}
|
|
62
62
|
className={clsx(styles["item-status-icon"], styles[`status-${status}`])}
|
|
63
63
|
/>
|
|
64
|
-
{count && <
|
|
64
|
+
{count && <Text size={"s"}>{count}</Text>}
|
|
65
65
|
</div>
|
|
66
66
|
))}
|
|
67
67
|
</div>
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
align-items: center;
|
|
93
93
|
gap: 4px;
|
|
94
94
|
color: var(--on-icon-secondary);
|
|
95
|
-
min-width:
|
|
95
|
+
min-width: 56px;
|
|
96
96
|
justify-content: flex-end;
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -253,3 +253,12 @@
|
|
|
253
253
|
color: var(--bg-support-skat);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
+
|
|
257
|
+
.failed-steps {
|
|
258
|
+
display: flex;
|
|
259
|
+
gap: 8px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:global(.code-toolbar .toolbar) {
|
|
263
|
+
display: none;
|
|
264
|
+
}
|