@allurereport/web-awesome 3.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.js +46 -0
- package/.eslintrc.cjs +18 -0
- package/CONTRIBUTING.md +34 -0
- package/README.md +27 -0
- package/dist/multi/141.app-d01d0c66.js +1 -0
- package/dist/multi/222.app-d01d0c66.js +1 -0
- package/dist/multi/335.app-d01d0c66.js +1 -0
- package/dist/multi/34.app-d01d0c66.js +1 -0
- package/dist/multi/349.app-d01d0c66.js +1 -0
- package/dist/multi/378.app-d01d0c66.js +1 -0
- package/dist/multi/406.app-d01d0c66.js +1 -0
- package/dist/multi/476.app-d01d0c66.js +1 -0
- package/dist/multi/53.app-d01d0c66.js +1 -0
- package/dist/multi/584.app-d01d0c66.js +1 -0
- package/dist/multi/690.app-d01d0c66.js +1 -0
- package/dist/multi/747.app-d01d0c66.js +1 -0
- package/dist/multi/767.app-d01d0c66.js +1 -0
- package/dist/multi/816.app-d01d0c66.js +1 -0
- package/dist/multi/83.app-d01d0c66.js +1 -0
- package/dist/multi/873.app-d01d0c66.js +1 -0
- package/dist/multi/920.app-d01d0c66.js +1 -0
- package/dist/multi/991.app-d01d0c66.js +1 -0
- package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
- package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
- package/dist/multi/app-d01d0c66.js +2 -0
- package/dist/multi/app-d01d0c66.js.LICENSE.txt +16 -0
- package/dist/multi/manifest.json +26 -0
- package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
- package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
- package/dist/multi/styles-d01d0c66.css +39 -0
- package/dist/single/app-6596cb08.js +2 -0
- package/dist/single/app-6596cb08.js.LICENSE.txt +16 -0
- package/dist/single/manifest.json +3 -0
- package/package.json +107 -0
- package/postcss.config.js +5 -0
- package/src/assets/scss/_common.scss +143 -0
- package/src/assets/scss/day.scss +51 -0
- package/src/assets/scss/fonts.scss +3 -0
- package/src/assets/scss/index.scss +7 -0
- package/src/assets/scss/night.scss +61 -0
- package/src/assets/scss/palette.scss +393 -0
- package/src/assets/scss/theme.scss +119 -0
- package/src/assets/scss/vars.scss +9 -0
- package/src/assets/svg/line-alerts-alert-circle.svg +12 -0
- package/src/assets/svg/line-general-eye.svg +7 -0
- package/src/assets/svg/line-icon-bomb-2.svg +12 -0
- package/src/components/ArrowButton/index.tsx +36 -0
- package/src/components/ArrowButton/styles.scss +35 -0
- package/src/components/BaseLayout/index.tsx +43 -0
- package/src/components/BaseLayout/styles.scss +60 -0
- package/src/components/Footer/FooterLogo.tsx +16 -0
- package/src/components/Footer/FooterVersion.tsx +37 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Footer/styles.scss +14 -0
- package/src/components/Header/index.tsx +28 -0
- package/src/components/Header/styles.scss +33 -0
- package/src/components/LanguagePicker/index.tsx +40 -0
- package/src/components/MainReport/index.tsx +21 -0
- package/src/components/MainReport/styles.scss +11 -0
- package/src/components/Metadata/index.tsx +121 -0
- package/src/components/Metadata/styles.scss +146 -0
- package/src/components/MetadataButton/index.tsx +32 -0
- package/src/components/MetadataButton/styles.scss +53 -0
- package/src/components/Modal/index.tsx +22 -0
- package/src/components/ReportBody/Filters.tsx +90 -0
- package/src/components/ReportBody/HeaderActions.tsx +21 -0
- package/src/components/ReportBody/SortBy.tsx +132 -0
- package/src/components/ReportBody/context.tsx +106 -0
- package/src/components/ReportBody/index.tsx +72 -0
- package/src/components/ReportBody/styles.scss +69 -0
- package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
- package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
- package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
- package/src/components/ReportHeader/index.tsx +33 -0
- package/src/components/ReportHeader/styles.scss +51 -0
- package/src/components/ReportLogo/index.tsx +16 -0
- package/src/components/ReportLogo/styles.scss +20 -0
- package/src/components/ReportLogoFull/index.tsx +20 -0
- package/src/components/ReportLogoFull/styles.scss +7 -0
- package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
- package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
- package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
- package/src/components/ReportMetadata/index.tsx +46 -0
- package/src/components/ReportMetadata/styles.scss +99 -0
- package/src/components/SideBySide/index.tsx +52 -0
- package/src/components/SideBySide/styles.scss +65 -0
- package/src/components/SplitLayout/index.tsx +77 -0
- package/src/components/SplitLayout/styles.scss +85 -0
- package/src/components/Tabs/index.tsx +62 -0
- package/src/components/Tabs/styles.scss +56 -0
- package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
- package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
- package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
- package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
- package/src/components/TestResult/TestResultDropdown/index.tsx +26 -0
- package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
- package/src/components/TestResult/TestResultEmpty/index.tsx +34 -0
- package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
- package/src/components/TestResult/TestResultHeader/TestResultBreadcrumbs.tsx +44 -0
- package/src/components/TestResult/TestResultHeader/index.tsx +21 -0
- package/src/components/TestResult/TestResultHeader/styles.scss +48 -0
- package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +66 -0
- package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
- package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
- package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
- package/src/components/TestResult/TestResultInfo/index.tsx +81 -0
- package/src/components/TestResult/TestResultInfo/styles.scss +68 -0
- package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
- package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
- package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
- package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
- package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
- package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
- package/src/components/TestResult/TestResultOverview.tsx +43 -0
- package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
- package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
- package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
- package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +51 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
- package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
- package/src/components/TestResult/TestResultSetup/index.tsx +58 -0
- package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
- package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
- package/src/components/TestResult/TestResultStatus/index.tsx +25 -0
- package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
- package/src/components/TestResult/TestResultSteps/index.tsx +58 -0
- package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +76 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
- package/src/components/TestResult/TestResultSteps/testResultStep.tsx +84 -0
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
- package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
- package/src/components/TestResult/TestResultTabs/index.tsx +68 -0
- package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
- package/src/components/TestResult/TestResultTeardown/index.tsx +59 -0
- package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
- package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
- package/src/components/TestResult/TrError/TrDiff.tsx +124 -0
- package/src/components/TestResult/TrError/index.tsx +78 -0
- package/src/components/TestResult/TrError/styles.scss +133 -0
- package/src/components/TestResult/index.tsx +62 -0
- package/src/components/TestResult/styles.scss +11 -0
- package/src/components/ThemeButton/ThemeButton.tsx +20 -0
- package/src/components/ToggleLayout/index.tsx +17 -0
- package/src/components/Tree/index.tsx +75 -0
- package/src/components/Tree/styles.scss +189 -0
- package/src/i18n/constants.ts +124 -0
- package/src/i18n/locales/am.json +133 -0
- package/src/i18n/locales/az.json +133 -0
- package/src/i18n/locales/de.json +133 -0
- package/src/i18n/locales/en.json +134 -0
- package/src/i18n/locales/es.json +133 -0
- package/src/i18n/locales/fr.json +133 -0
- package/src/i18n/locales/he.json +133 -0
- package/src/i18n/locales/it.json +133 -0
- package/src/i18n/locales/ja.json +133 -0
- package/src/i18n/locales/ka.json +133 -0
- package/src/i18n/locales/kr.json +133 -0
- package/src/i18n/locales/nl.json +133 -0
- package/src/i18n/locales/pl.json +131 -0
- package/src/i18n/locales/pt.json +133 -0
- package/src/i18n/locales/ru.json +131 -0
- package/src/i18n/locales/sv.json +133 -0
- package/src/i18n/locales/tr.json +133 -0
- package/src/i18n/locales/zh.json +133 -0
- package/src/index.html +40 -0
- package/src/index.tsx +96 -0
- package/src/stores/chart.ts +32 -0
- package/src/stores/envInfo.ts +34 -0
- package/src/stores/index.ts +4 -0
- package/src/stores/layout.ts +36 -0
- package/src/stores/locale.ts +75 -0
- package/src/stores/modal.ts +22 -0
- package/src/stores/router.ts +48 -0
- package/src/stores/stats.ts +36 -0
- package/src/stores/testResults.ts +66 -0
- package/src/stores/theme.ts +32 -0
- package/src/stores/tree.ts +157 -0
- package/src/stores/types.ts +5 -0
- package/src/styles.scss +45 -0
- package/src/types/globals.d.ts +13 -0
- package/src/types/window.d.ts +8 -0
- package/src/utils/capitalize.ts +6 -0
- package/src/utils/copyToClipboard.ts +16 -0
- package/src/utils/isMac.ts +8 -0
- package/src/utils/loadFromLocalStorage.ts +8 -0
- package/src/utils/statuses.ts +55 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/treeFilters.ts +147 -0
- package/test/utils/treeFilters.test.ts +448 -0
- package/tsconfig.json +27 -0
- package/types.d.ts +99 -0
- package/vitest.config.ts +18 -0
- package/webpack.config.js +112 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.test-result-info {
|
|
2
|
+
padding: 20px 24px 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.sticky {
|
|
6
|
+
position: sticky;
|
|
7
|
+
left: 0;
|
|
8
|
+
top: 0;
|
|
9
|
+
width: 100%;
|
|
10
|
+
background: var(--bg-base-primary);
|
|
11
|
+
z-index: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.sticky {
|
|
15
|
+
position: sticky;
|
|
16
|
+
left: 0;
|
|
17
|
+
top: 0;
|
|
18
|
+
width: 100%;
|
|
19
|
+
background: var(--bg-base-primary);
|
|
20
|
+
z-index: 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.test-result-info-data {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 12px;
|
|
26
|
+
align-items: center;
|
|
27
|
+
margin-bottom: 8px;
|
|
28
|
+
|
|
29
|
+
& > *:not(:first-child):not(:empty) {
|
|
30
|
+
border-left: 1px solid var(--on-border-primary);
|
|
31
|
+
padding-left: 12px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.test-result-name {
|
|
36
|
+
margin-bottom: 8px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.test-result-duration {
|
|
40
|
+
color: var(--on-text-secondary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.test-result-tabs {
|
|
44
|
+
border-bottom: 1px solid var(--on-border-primary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.test-result-tab {
|
|
48
|
+
display: flex;
|
|
49
|
+
gap: 4px;
|
|
50
|
+
align-items: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.test-result-info-statuses {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 8px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.test-result-info-status {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.metadata-icon {
|
|
66
|
+
margin-right: 8px;
|
|
67
|
+
color: var(--on-icon-secondary);
|
|
68
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import type { FunctionalComponent } from "preact";
|
|
3
|
+
import { useState } from "preact/hooks";
|
|
4
|
+
import type { AwesomeTestResult } from "types";
|
|
5
|
+
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
|
+
import { useI18n } from "@/stores/locale";
|
|
7
|
+
import * as styles from "./styles.scss";
|
|
8
|
+
|
|
9
|
+
interface TestResultLinkProps {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const linksIconMap: Record<string, string> = {
|
|
16
|
+
issue: allureIcons.lineDevBug2,
|
|
17
|
+
link: allureIcons.lineGeneralLink1,
|
|
18
|
+
tms: allureIcons.lineGeneralChecklist3,
|
|
19
|
+
github: allureIcons.github,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const TestResultLink: FunctionalComponent<{
|
|
23
|
+
link: TestResultLinkProps;
|
|
24
|
+
}> = ({ link }) => {
|
|
25
|
+
const { url, type } = link;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<div className={styles["test-result-link"]}>
|
|
29
|
+
<SvgIcon id={linksIconMap[type] ?? allureIcons.lineGeneralLink1} />
|
|
30
|
+
<Text tag={"a"} href={url} target={"_blank"} size={"m"} className={styles["test-result-link-text"]}>
|
|
31
|
+
{url}
|
|
32
|
+
</Text>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type TestResultLinksProps = {
|
|
38
|
+
links: AwesomeTestResult["links"];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const TestResultLinks: FunctionalComponent<TestResultLinksProps> = ({ links }) => {
|
|
42
|
+
const [isOpened, setIsOpen] = useState(true);
|
|
43
|
+
const { t } = useI18n("ui");
|
|
44
|
+
const linkMap = links.map((link, index) => {
|
|
45
|
+
return <TestResultLink link={link as TestResultLinkProps} key={index} />;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className={styles["test-result-links"]}>
|
|
50
|
+
<div className={styles["test-result-links-wrapper"]}>
|
|
51
|
+
<MetadataButton isOpened={isOpened} setIsOpen={setIsOpen} counter={links.length} title={t("links")} />
|
|
52
|
+
{isOpened && <div className={styles["test-result-links-list"]}>{linkMap}</div>}
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.test-result-links {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 4px;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 12px 24px 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.test-result-links-wrapper {
|
|
9
|
+
width: 100%;
|
|
10
|
+
border-bottom: 1px solid var(--on-border-primary);
|
|
11
|
+
padding-bottom: 12px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.test-result-link {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 4px;
|
|
17
|
+
padding: 6px;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.test-result-link-text {
|
|
22
|
+
color: var(--on-support-aldebaran);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.test-result-links-list {
|
|
26
|
+
display: grid;
|
|
27
|
+
column-gap: 32px;
|
|
28
|
+
grid-template-columns: repeat(2, 1fr);
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import { useState } from "preact/hooks";
|
|
3
|
+
import type { AwesomeTestResult } from "types";
|
|
4
|
+
import { TestResultMetadataList } from "@/components/Metadata";
|
|
5
|
+
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
|
+
import { useI18n } from "@/stores/locale";
|
|
7
|
+
import * as styles from "./styles.scss";
|
|
8
|
+
|
|
9
|
+
export type TestResultMetadataProps = {
|
|
10
|
+
testResult?: AwesomeTestResult;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TestResultMetadata: FunctionalComponent<TestResultMetadataProps> = ({ testResult }) => {
|
|
14
|
+
const { t } = useI18n("ui");
|
|
15
|
+
const { labels, groupedLabels } = testResult ?? {};
|
|
16
|
+
const [isOpened, setIsOpened] = useState(true);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={styles["test-result-metadata"]}>
|
|
20
|
+
<MetadataButton isOpened={isOpened} setIsOpen={setIsOpened} counter={labels?.length} title={t("labels")} />
|
|
21
|
+
|
|
22
|
+
<div className={styles["test-result-metadata-wrapper"]}>
|
|
23
|
+
{isOpened && <TestResultMetadataList groupedLabels={groupedLabels} />}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Code, IconButton, Loadable, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import type { FunctionalComponent } from "preact";
|
|
3
|
+
import type { AwesomeTestResult } from "types";
|
|
4
|
+
import { useI18n } from "@/stores";
|
|
5
|
+
import { navigateTo } from "@/stores/router";
|
|
6
|
+
import { testResultNavStore } from "@/stores/testResults";
|
|
7
|
+
import { copyToClipboard } from "@/utils/copyToClipboard";
|
|
8
|
+
import * as styles from "./styles.scss";
|
|
9
|
+
|
|
10
|
+
export type TestResultNavigationProps = {
|
|
11
|
+
testResult?: AwesomeTestResult;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps> = ({ testResult }) => {
|
|
15
|
+
const { fullName, id: testResultId } = testResult ?? {};
|
|
16
|
+
const id = testResultId || "";
|
|
17
|
+
const { t: tooltip } = useI18n("controls");
|
|
18
|
+
const FullName = () => {
|
|
19
|
+
return (
|
|
20
|
+
<div data-testid="test-result-fullname" className={styles["test-result-fullName"]}>
|
|
21
|
+
<TooltipWrapper tooltipText={tooltip("clipboard")} tooltipTextAfterClick={tooltip("clipboardSuccess")}>
|
|
22
|
+
<IconButton
|
|
23
|
+
data-testid="test-result-fullname-copy"
|
|
24
|
+
style={"ghost"}
|
|
25
|
+
size={"s"}
|
|
26
|
+
icon={allureIcons.lineGeneralCopy3}
|
|
27
|
+
onClick={() => copyToClipboard(fullName)}
|
|
28
|
+
/>
|
|
29
|
+
</TooltipWrapper>
|
|
30
|
+
<Code tag={"div"} size={"s"} className={styles["test-result-fullName-text"]}>
|
|
31
|
+
{fullName && fullName}
|
|
32
|
+
</Code>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Loadable
|
|
39
|
+
source={testResultNavStore}
|
|
40
|
+
renderData={(data) => {
|
|
41
|
+
const currentIndex = data.indexOf(id) + 1;
|
|
42
|
+
return (
|
|
43
|
+
<div className={styles["test-result-nav"]}>
|
|
44
|
+
{fullName && <FullName />}
|
|
45
|
+
{data && !testResult?.hidden && (
|
|
46
|
+
<div className={styles["test-result-navigator"]}>
|
|
47
|
+
<TooltipWrapper tooltipText={tooltip("prevTR")} isTriggerActive={currentIndex > 1}>
|
|
48
|
+
<IconButton
|
|
49
|
+
icon={allureIcons.lineArrowsChevronDown}
|
|
50
|
+
style={"ghost"}
|
|
51
|
+
isDisabled={currentIndex === data.length}
|
|
52
|
+
data-testid="test-result-nav-prev"
|
|
53
|
+
className={styles["test-result-nav-prev"]}
|
|
54
|
+
onClick={() => navigateTo(data[currentIndex])}
|
|
55
|
+
/>
|
|
56
|
+
</TooltipWrapper>
|
|
57
|
+
<Code
|
|
58
|
+
data-testid="test-result-nav-current"
|
|
59
|
+
size={"s"}
|
|
60
|
+
className={styles["test-result-navigator-numbers"]}
|
|
61
|
+
>
|
|
62
|
+
{currentIndex}/{data.length}
|
|
63
|
+
</Code>
|
|
64
|
+
<TooltipWrapper tooltipText={tooltip("nextTR")}>
|
|
65
|
+
<IconButton
|
|
66
|
+
icon={allureIcons.lineArrowsChevronDown}
|
|
67
|
+
style={"ghost"}
|
|
68
|
+
isDisabled={currentIndex <= 1}
|
|
69
|
+
data-testid="test-result-nav-next"
|
|
70
|
+
onClick={() => navigateTo(data[currentIndex - 2])}
|
|
71
|
+
/>
|
|
72
|
+
</TooltipWrapper>
|
|
73
|
+
</div>
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.test-result-nav {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
margin-bottom: 12px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.test-result-fullName {
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 4px;
|
|
11
|
+
align-items: center;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
min-height: 32px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.test-result-fullName-text {
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
width: 100%;
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
color: var(--on-text-secondary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.test-result-fullName-icon {
|
|
28
|
+
--allure-btn-icon-color: var(--on-icon-secondary);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.test-result-navigator {
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 4px;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-left: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.test-result-navigator-numbers {
|
|
39
|
+
color: var(--on-text-secondary);
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.test-result-nav-prev {
|
|
44
|
+
transform: rotate(-180deg);
|
|
45
|
+
&:active {
|
|
46
|
+
transform: scale(var(--allure-btn-pressed-scale)) rotate(-180deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import type { AwesomeTestResult } from "types";
|
|
3
|
+
import * as styles from "@/components/BaseLayout/styles.scss";
|
|
4
|
+
import { TestResultDescription } from "@/components/TestResult/TestResultDescription";
|
|
5
|
+
import { TestResultLinks } from "@/components/TestResult/TestResultLinks";
|
|
6
|
+
import { TestResultMetadata } from "@/components/TestResult/TestResultMetadata";
|
|
7
|
+
import { TestResultParameters } from "@/components/TestResult/TestResultParameters";
|
|
8
|
+
import { TestResultSetup } from "@/components/TestResult/TestResultSetup";
|
|
9
|
+
import { TestResultSteps } from "@/components/TestResult/TestResultSteps";
|
|
10
|
+
import { TestResultTeardown } from "@/components/TestResult/TestResultTeardown";
|
|
11
|
+
import TestStepsEmpty from "@/components/TestResult/TestStepsEmpty";
|
|
12
|
+
import { TrError } from "@/components/TestResult/TrError";
|
|
13
|
+
|
|
14
|
+
export type TestResultOverviewProps = {
|
|
15
|
+
testResult?: AwesomeTestResult;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> = ({ testResult }) => {
|
|
19
|
+
const { error, parameters, groupedLabels, links, description, setup, steps, teardown, id } = testResult || {};
|
|
20
|
+
const isNoSteps = !setup?.length && !steps.length && !teardown.length;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{Boolean(error?.message) && (
|
|
25
|
+
<div className={styles["test-result-errors"]}>
|
|
26
|
+
<TrError {...error} />
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
{Boolean(parameters?.length) && <TestResultParameters parameters={parameters} />}
|
|
30
|
+
{Boolean(groupedLabels && Object.keys(groupedLabels || {})?.length) && (
|
|
31
|
+
<TestResultMetadata testResult={testResult} />
|
|
32
|
+
)}
|
|
33
|
+
{Boolean(links?.length) && <TestResultLinks links={links} />}
|
|
34
|
+
{Boolean(description) && <TestResultDescription description={description} />}
|
|
35
|
+
<div className={styles["test-results"]}>
|
|
36
|
+
{isNoSteps && <TestStepsEmpty />}
|
|
37
|
+
{Boolean(setup?.length) && <TestResultSetup id={id} setup={setup} />}
|
|
38
|
+
{Boolean(steps?.length) && <TestResultSteps id={id} steps={steps} />}
|
|
39
|
+
{Boolean(teardown?.length) && <TestResultTeardown id={id} teardown={teardown} />}
|
|
40
|
+
</div>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import { useState } from "preact/hooks";
|
|
3
|
+
import type { AwesomeTestResult } from "types";
|
|
4
|
+
import { MetadataList } from "@/components/Metadata";
|
|
5
|
+
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
|
+
import { useI18n } from "@/stores/locale";
|
|
7
|
+
import * as styles from "./styles.scss";
|
|
8
|
+
|
|
9
|
+
export type TestResultParametersProps = {
|
|
10
|
+
parameters: AwesomeTestResult["parameters"];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TestResultParameters: FunctionalComponent<TestResultParametersProps> = ({ parameters }) => {
|
|
14
|
+
const [isOpened, setIsOpened] = useState(true);
|
|
15
|
+
const { t } = useI18n("ui");
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className={styles["test-result-metadata"]}>
|
|
19
|
+
<MetadataButton
|
|
20
|
+
isOpened={isOpened}
|
|
21
|
+
setIsOpen={setIsOpened}
|
|
22
|
+
counter={parameters?.length}
|
|
23
|
+
title={t("parameters")}
|
|
24
|
+
/>
|
|
25
|
+
{/* FIXME: use proper type in the MetadataList component */}
|
|
26
|
+
{/* @ts-ignore */}
|
|
27
|
+
<div className={styles["test-result-metadata-wrapper"]}>{isOpened && <MetadataList envInfo={parameters} />}</div>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type HistoryTestResult } from "@allurereport/core-api";
|
|
2
|
+
import { SvgIcon, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import type { AwesomeTestResult } from "types";
|
|
5
|
+
import { useI18n } from "@/stores";
|
|
6
|
+
import { navigateTo } from "@/stores/router";
|
|
7
|
+
import { capitalize } from "@/utils/capitalize";
|
|
8
|
+
import { timestampToDate } from "@/utils/time";
|
|
9
|
+
import * as styles from "./styles.scss";
|
|
10
|
+
|
|
11
|
+
const TestResultPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles["test-result-prev-status"]} onClick={() => navigateTo(`${item.id}`)}>
|
|
14
|
+
<SvgIcon id={allureIcons.lineShapesDotCircle} className={styles[`status-${item?.status}`]} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
|
|
19
|
+
const convertedStop = item.stop && timestampToDate(item.stop);
|
|
20
|
+
const { t } = useI18n("statuses");
|
|
21
|
+
const status = t(item.status);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div className={styles["test-result-prev-status-tooltip"]}>
|
|
25
|
+
<Text tag={"div"} size={"m"} bold>
|
|
26
|
+
{capitalize(status)}
|
|
27
|
+
</Text>
|
|
28
|
+
<Text size={"m"}>{convertedStop}</Text>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type TestResultPrevStatusesProps = {
|
|
34
|
+
history: AwesomeTestResult["history"];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const TestResultPrevStatuses: FunctionalComponent<TestResultPrevStatusesProps> = ({ history }) => {
|
|
38
|
+
return (
|
|
39
|
+
<div className={styles["test-result-prev-statuses"]}>
|
|
40
|
+
{history?.slice(0, 6).map((item, key) => (
|
|
41
|
+
<div key={key} className={styles["test-result-prev-status"]}>
|
|
42
|
+
<TooltipWrapper key={key} tooltipComponent={<TestResultPrevStatusTooltip item={item} />}>
|
|
43
|
+
<TestResultPrevStatus item={item} />
|
|
44
|
+
</TooltipWrapper>
|
|
45
|
+
</div>
|
|
46
|
+
))}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
.test-result-prev-statuses {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.test-result-prev-status {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
|
|
11
|
+
&:not(:first-child) {
|
|
12
|
+
padding-left: 8px;
|
|
13
|
+
|
|
14
|
+
&:before {
|
|
15
|
+
content: "";
|
|
16
|
+
width: 8px;
|
|
17
|
+
position: absolute;
|
|
18
|
+
height: 2px;
|
|
19
|
+
left: 0;
|
|
20
|
+
top: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
margin: auto;
|
|
23
|
+
background: var(--on-border-medium);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.status-passed {
|
|
29
|
+
color: var(--bg-support-castor);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.status-failed {
|
|
33
|
+
color: var(--bg-support-capella);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.status-broken {
|
|
37
|
+
color: var(--bg-support-atlas);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.status-skipped {
|
|
41
|
+
color: var(--bg-support-rau);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.status-unknown {
|
|
45
|
+
color: var(--bg-support-skat);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.test-result-prev-status-tooltip {
|
|
49
|
+
text-align: center;
|
|
50
|
+
background-color: var(--constant-bg-base-modal);
|
|
51
|
+
color: var(--constant-on-text-primary);
|
|
52
|
+
padding: 2px 8px;
|
|
53
|
+
border-radius: 6px;
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
max-width: 600px;
|
|
56
|
+
min-width: max-content;
|
|
57
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { formatDuration } from "@allurereport/core-api";
|
|
2
|
+
import { IconButton, Text, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import { useState } from "preact/hooks";
|
|
5
|
+
import type { AwesomeTestResult } from "types";
|
|
6
|
+
import { ArrowButton } from "@/components/ArrowButton";
|
|
7
|
+
import * as styles from "@/components/TestResult/TestResultRetriesView/styles.scss";
|
|
8
|
+
import { TrError } from "@/components/TestResult/TrError";
|
|
9
|
+
import { navigateTo } from "@/stores/router";
|
|
10
|
+
import { timestampToDate } from "@/utils/time";
|
|
11
|
+
|
|
12
|
+
export const TestResultRetriesItem: FunctionalComponent<{
|
|
13
|
+
testResultItem: AwesomeTestResult;
|
|
14
|
+
}> = ({ testResultItem }) => {
|
|
15
|
+
const { id, status, error, stop, duration } = testResultItem;
|
|
16
|
+
const [isOpened, setIsOpen] = useState(false);
|
|
17
|
+
const convertedStop = timestampToDate(stop);
|
|
18
|
+
const formattedDuration = typeof duration === "number" ? formatDuration(duration) : undefined;
|
|
19
|
+
const navigateUrl = id;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<div className={styles["test-result-retries-item-header"]} onClick={() => setIsOpen(!isOpened)}>
|
|
24
|
+
{Boolean(error) && <ArrowButton isOpened={isOpened} icon={allureIcons.lineArrowsChevronDown} />}
|
|
25
|
+
<div className={styles["test-result-retries-item-wrap"]}>
|
|
26
|
+
<TreeItemIcon status={status} className={styles["test-result-retries-item-status"]} />
|
|
27
|
+
<Text className={styles["test-result-retries-item-text"]}>{convertedStop}</Text>
|
|
28
|
+
<div className={styles["test-result-retries-item-info"]}>
|
|
29
|
+
{Boolean(formattedDuration) && (
|
|
30
|
+
<Text type="ui" size={"s"} className={styles["item-time"]}>
|
|
31
|
+
{formattedDuration}
|
|
32
|
+
</Text>
|
|
33
|
+
)}
|
|
34
|
+
<IconButton
|
|
35
|
+
icon={allureIcons.lineGeneralLinkExternal}
|
|
36
|
+
style={"ghost"}
|
|
37
|
+
size={"s"}
|
|
38
|
+
className={styles["test-result-retries-item-link"]}
|
|
39
|
+
onClick={() => navigateTo(navigateUrl)}
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
{isOpened && error && (
|
|
45
|
+
<div className={styles["test-result-retries-item-content"]}>
|
|
46
|
+
<TrError {...error} />
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import type { AwesomeTestResult } from "types";
|
|
3
|
+
import * as styles from "@/components/TestResult/TestResultHistory/styles.scss";
|
|
4
|
+
import { TestResultRetriesItem } from "@/components/TestResult/TestResultRetriesView/TestResultRetriesItem";
|
|
5
|
+
import { useI18n } from "@/stores";
|
|
6
|
+
|
|
7
|
+
export const TestResultRetriesView: FunctionalComponent<{
|
|
8
|
+
testResult: AwesomeTestResult;
|
|
9
|
+
}> = ({ testResult }) => {
|
|
10
|
+
const { retries } = testResult ?? {};
|
|
11
|
+
const { t } = useI18n("empty");
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={styles["test-result-history"]}>
|
|
15
|
+
{retries.length ? (
|
|
16
|
+
retries?.map((item, key) => (
|
|
17
|
+
<TestResultRetriesItem testResultItem={item as unknown as AwesomeTestResult} key={key} />
|
|
18
|
+
))
|
|
19
|
+
) : (
|
|
20
|
+
<div className={styles["test-result-empty"]}>{t("no-retries-results")}</div>
|
|
21
|
+
)}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.test-result-retries {
|
|
2
|
+
padding: 12px 24px 32px;
|
|
3
|
+
min-height: 320px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.test-result-retries-item-header {
|
|
7
|
+
display: flex;
|
|
8
|
+
width: 100%;
|
|
9
|
+
gap: 4px;
|
|
10
|
+
align-items: center;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
a {
|
|
14
|
+
color: inherit;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
display: contents;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.test-result-retries-item-wrap {
|
|
22
|
+
transition: background-color 300ms;
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
border-radius: 6px;
|
|
27
|
+
padding: 4px;
|
|
28
|
+
width: 100%;
|
|
29
|
+
align-items: flex-start;
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
background: var(--bg-control-flat-medium);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.test-result-retries-item-text {
|
|
37
|
+
padding-top: 2px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.test-result-retries-item-info {
|
|
41
|
+
display: flex;
|
|
42
|
+
gap: 4px;
|
|
43
|
+
align-items: center;
|
|
44
|
+
margin-left: auto;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.item-time {
|
|
48
|
+
margin-left: auto;
|
|
49
|
+
line-height: 20px;
|
|
50
|
+
color: var(--on-text-secondary);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.test-result-retries-item-content {
|
|
54
|
+
padding-left: 24px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.test-result-retries-item-link {
|
|
58
|
+
color: var(--on-icon-secondary);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.test-result-retries-item-status {
|
|
62
|
+
padding-top: 4px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.test-result-empty {
|
|
66
|
+
display: flex;
|
|
67
|
+
width: 100%;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
}
|