@allurereport/web-awesome 3.0.0-beta.7 → 3.0.0-beta.9
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/.eslintrc.cjs +4 -1
- package/dist/multi/141.app-f32e4213.js +1 -0
- package/dist/multi/222.app-f32e4213.js +1 -0
- package/dist/multi/335.app-f32e4213.js +1 -0
- package/dist/multi/34.app-f32e4213.js +1 -0
- package/dist/multi/349.app-f32e4213.js +1 -0
- package/dist/multi/378.app-f32e4213.js +1 -0
- package/dist/multi/406.app-f32e4213.js +1 -0
- package/dist/multi/476.app-f32e4213.js +1 -0
- package/dist/multi/53.app-f32e4213.js +1 -0
- package/dist/multi/584.app-f32e4213.js +1 -0
- package/dist/multi/690.app-f32e4213.js +1 -0
- package/dist/multi/747.app-f32e4213.js +1 -0
- package/dist/multi/767.app-f32e4213.js +1 -0
- package/dist/multi/{816.app-4468f0e2.js → 816.app-f32e4213.js} +1 -1
- package/dist/multi/83.app-f32e4213.js +1 -0
- package/dist/multi/873.app-f32e4213.js +1 -0
- package/dist/multi/920.app-f32e4213.js +1 -0
- package/dist/multi/991.app-f32e4213.js +1 -0
- package/dist/multi/app-f32e4213.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/styles-f32e4213.css +284 -0
- package/dist/single/app-7fa8e43f.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +7 -4
- package/src/assets/scss/fonts.scss +2 -20
- package/src/components/{app/ArrowButton → ArrowButton}/index.tsx +3 -4
- package/src/components/{app/BaseLayout → BaseLayout}/index.tsx +18 -16
- package/src/components/{app/Footer → Footer}/FooterLogo.tsx +2 -2
- package/src/components/Footer/FooterVersion.tsx +33 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Header/index.tsx +14 -0
- package/src/components/{app/LanguagePicker → LanguagePicker}/index.tsx +2 -3
- package/src/components/MainReport/index.tsx +19 -0
- package/src/components/{app/Metadata → Metadata}/index.tsx +23 -16
- package/src/components/{app/Metadata → Metadata}/styles.scss +1 -1
- package/src/components/{app/MetadataButton → MetadataButton}/index.tsx +3 -4
- package/src/components/{app/Modal → Modal}/index.tsx +9 -19
- package/src/components/{app/ReportBody → ReportBody}/Filters.tsx +5 -11
- package/src/components/{app/ReportBody → ReportBody}/HeaderActions.tsx +1 -1
- package/src/components/{app/ReportBody → ReportBody}/SortBy.tsx +12 -14
- package/src/components/{app/ReportBody → ReportBody}/index.tsx +4 -3
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLabelList.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderLogo.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/ReportHeaderPie.tsx +2 -2
- package/src/components/{app/ReportHeader → ReportHeader}/index.tsx +5 -5
- package/src/components/{app/ReportLogo → ReportLogo}/index.tsx +3 -4
- package/src/components/{app/ReportLogoFull → ReportLogoFull}/index.tsx +3 -4
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataItem.tsx +2 -2
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataSummary.tsx +8 -10
- package/src/components/{app/ReportMetadata → ReportMetadata}/MetadataTestType.tsx +5 -5
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
- package/src/components/{app/ReportMetadata → ReportMetadata}/index.tsx +5 -5
- package/src/components/{app/ReportMetadata → ReportMetadata}/styles.scss +1 -1
- package/src/components/{app/Tabs → Tabs}/index.tsx +6 -1
- package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/index.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultDescription/index.tsx +4 -4
- package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
- package/src/components/{app/TestResult → TestResult}/TestResultEmpty/index.tsx +7 -7
- package/src/components/TestResult/TestResultError/index.tsx +59 -0
- package/src/components/{app/TestResult → TestResult}/TestResultHeader/index.tsx +10 -10
- package/src/components/{app/TestResult → TestResult}/TestResultHistory/TestResultHistoryItem.tsx +16 -17
- package/src/components/{app/TestResult → TestResult}/TestResultHistory/index.tsx +2 -2
- package/src/components/{app/TestResult → TestResult}/TestResultInfo/TestResultInfoStatuses.tsx +8 -9
- package/src/components/{app/TestResult → TestResult}/TestResultInfo/index.tsx +8 -10
- package/src/components/{app/TestResult → TestResult}/TestResultLinks/index.tsx +12 -16
- package/src/components/{app/TestResult → TestResult}/TestResultMetadata/index.tsx +4 -4
- package/src/components/{app/TestResult → TestResult}/TestResultNavigation/index.tsx +7 -9
- package/src/components/TestResult/TestResultOverview.tsx +43 -0
- package/src/components/{app/TestResult → TestResult}/TestResultParameters/index.tsx +4 -4
- package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/index.tsx +6 -9
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +52 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSetup/index.tsx +20 -12
- package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
- package/src/components/{app/TestResult → TestResult}/TestResultStatus/index.tsx +2 -2
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachment.tsx +10 -10
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentCode.tsx +7 -2
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/attachmentImage.tsx +6 -3
- package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/index.tsx +17 -8
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachment.tsx +25 -27
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachmentInfo.tsx +8 -12
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultStep.tsx +34 -20
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
- package/src/components/{app/TestResult → TestResult}/TestResultSteps/wrongAttachment.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultTabs/index.tsx +1 -1
- package/src/components/{app/TestResult → TestResult}/TestResultTeardown/index.tsx +19 -9
- package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
- package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
- package/src/components/{app/TestResult → TestResult}/index.tsx +10 -10
- package/src/components/{app/ThemeButton → ThemeButton}/ThemeButton.tsx +2 -4
- package/src/components/{app/Tree → Tree}/Tree.tsx +10 -10
- package/src/components/{app/Tree → Tree}/TreeHeader.tsx +3 -3
- package/src/components/{app/Tree → Tree}/TreeItem.tsx +2 -2
- package/src/components/Tree/TreeItemIcon.tsx +32 -0
- package/src/components/{app/Tree → Tree}/index.tsx +5 -13
- package/src/i18n/locales/am.json +3 -1
- package/src/i18n/locales/az.json +3 -1
- package/src/i18n/locales/de.json +3 -1
- package/src/i18n/locales/en.json +4 -1
- package/src/i18n/locales/es.json +3 -1
- package/src/i18n/locales/fr.json +3 -1
- package/src/i18n/locales/he.json +3 -1
- package/src/i18n/locales/it.json +3 -1
- package/src/i18n/locales/ja.json +3 -1
- package/src/i18n/locales/ka.json +3 -1
- package/src/i18n/locales/kr.json +3 -1
- package/src/i18n/locales/nl.json +3 -1
- package/src/i18n/locales/pl.json +3 -1
- package/src/i18n/locales/pt.json +3 -1
- package/src/i18n/locales/ru.json +3 -1
- package/src/i18n/locales/sv.json +3 -1
- package/src/i18n/locales/tr.json +3 -1
- package/src/i18n/locales/zh.json +3 -1
- package/src/index.html +1 -0
- package/src/index.tsx +2 -2
- package/src/stores/index.ts +1 -1
- package/src/stores/testResults.ts +6 -2
- package/src/stores/tree.ts +43 -12
- package/src/utils/isMac.ts +6 -5
- package/src/utils/loadFromLocalStorage.ts +8 -0
- package/src/utils/treeFilters.ts +107 -58
- package/test/utils/treeFilters.test.ts +25 -1
- package/tsconfig.json +5 -3
- package/types.d.ts +15 -2
- package/vitest.config.ts +7 -1
- package/webpack.config.js +4 -0
- package/dist/multi/141.app-4468f0e2.js +0 -1
- package/dist/multi/222.app-4468f0e2.js +0 -1
- package/dist/multi/335.app-4468f0e2.js +0 -1
- package/dist/multi/34.app-4468f0e2.js +0 -1
- package/dist/multi/349.app-4468f0e2.js +0 -1
- package/dist/multi/378.app-4468f0e2.js +0 -1
- package/dist/multi/406.app-4468f0e2.js +0 -1
- package/dist/multi/476.app-4468f0e2.js +0 -1
- package/dist/multi/53.app-4468f0e2.js +0 -1
- package/dist/multi/584.app-4468f0e2.js +0 -1
- package/dist/multi/690.app-4468f0e2.js +0 -1
- package/dist/multi/747.app-4468f0e2.js +0 -1
- package/dist/multi/767.app-4468f0e2.js +0 -1
- package/dist/multi/83.app-4468f0e2.js +0 -1
- package/dist/multi/873.app-4468f0e2.js +0 -1
- package/dist/multi/920.app-4468f0e2.js +0 -1
- package/dist/multi/991.app-4468f0e2.js +0 -1
- package/dist/multi/app-4468f0e2.js +0 -2
- package/dist/multi/styles-4468f0e2.css +0 -363
- package/dist/single/app-33b3c367.js +0 -2
- package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
- package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
- package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
- package/src/assets/scss/mixins.scss +0 -26
- package/src/assets/svg/arrows-chevron-down.svg +0 -5
- package/src/assets/svg/github.svg +0 -5
- package/src/assets/svg/line-alerts-notification-box.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-down-double.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-down.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-right.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-up-double.svg +0 -3
- package/src/assets/svg/line-arrows-chevron-up.svg +0 -3
- package/src/assets/svg/line-arrows-corner-down-right.svg +0 -3
- package/src/assets/svg/line-arrows-expand-3.svg +0 -3
- package/src/assets/svg/line-arrows-refresh-ccw-1.svg +0 -3
- package/src/assets/svg/line-arrows-sort-line-asc.svg +0 -3
- package/src/assets/svg/line-arrows-sort-line-desc.svg +0 -3
- package/src/assets/svg/line-arrows-switch-vertical-1.svg +0 -3
- package/src/assets/svg/line-dev-bug-2.svg +0 -3
- package/src/assets/svg/line-dev-code-square.svg +0 -3
- package/src/assets/svg/line-files-file-attachment-2.svg +0 -3
- package/src/assets/svg/line-general-check.svg +0 -3
- package/src/assets/svg/line-general-checklist3.svg +0 -3
- package/src/assets/svg/line-general-copy-3.svg +0 -3
- package/src/assets/svg/line-general-download-cloud.svg +0 -3
- package/src/assets/svg/line-general-equal.svg +0 -3
- package/src/assets/svg/line-general-home-line.svg +0 -3
- package/src/assets/svg/line-general-link-1.svg +0 -3
- package/src/assets/svg/line-general-link-external.svg +0 -3
- package/src/assets/svg/line-general-search-md.svg +0 -3
- package/src/assets/svg/line-general-settings-1.svg +0 -3
- package/src/assets/svg/line-general-x-close.svg +0 -3
- package/src/assets/svg/line-general-zap.svg +0 -3
- package/src/assets/svg/line-helpers-flag.svg +0 -4
- package/src/assets/svg/line-helpers-play-circle.svg +0 -4
- package/src/assets/svg/line-images-image.svg +0 -3
- package/src/assets/svg/line-security-key.svg +0 -3
- package/src/assets/svg/line-shapes-dot-circle.svg +0 -3
- package/src/assets/svg/line-shapes-moon.svg +0 -3
- package/src/assets/svg/line-shapes-sun.svg +0 -3
- package/src/assets/svg/line-time-clock-stopwatch.svg +0 -3
- package/src/assets/svg/report-logo.svg +0 -64
- package/src/assets/svg/solid-alert-circle.svg +0 -3
- package/src/assets/svg/solid-check-circle.svg +0 -3
- package/src/assets/svg/solid-help-circle.svg +0 -3
- package/src/assets/svg/solid-minus-circle.svg +0 -3
- package/src/assets/svg/solid-x-circle.svg +0 -3
- package/src/assets/svg/spinner.svg +0 -18
- package/src/assets/svg/view-off.svg +0 -12
- package/src/assets/svg/view.svg +0 -11
- package/src/components/app/Footer/FooterVersion.tsx +0 -27
- package/src/components/app/Footer/index.tsx +0 -13
- package/src/components/app/Header/index.tsx +0 -17
- package/src/components/app/MainReport/index.tsx +0 -19
- package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +0 -25
- package/src/components/app/TestResult/TestResultDropdown/index.tsx +0 -19
- package/src/components/app/TestResult/TestResultError/index.tsx +0 -53
- package/src/components/app/TestResult/TestResultOverview.tsx +0 -40
- package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -50
- package/src/components/app/TestResult/TestResultRetriesView/index.tsx +0 -24
- package/src/components/app/TestResult/TestResultSeverity/index.tsx +0 -34
- package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +0 -12
- package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -33
- package/src/components/app/Tree/TreeItemIcon.tsx +0 -35
- package/src/components/commons/Button/index.tsx +0 -176
- package/src/components/commons/Button/styles.scss +0 -560
- package/src/components/commons/Counter/index.tsx +0 -29
- package/src/components/commons/Counter/styles.scss +0 -21
- package/src/components/commons/Label/index.tsx +0 -11
- package/src/components/commons/Label/styles.scss +0 -7
- package/src/components/commons/Link/index.tsx +0 -20
- package/src/components/commons/Link/styles.scss +0 -46
- package/src/components/commons/Loadable/index.tsx +0 -32
- package/src/components/commons/Menu/index.tsx +0 -198
- package/src/components/commons/Menu/styles.scss +0 -94
- package/src/components/commons/PageLoader/index.tsx +0 -10
- package/src/components/commons/PageLoader/styles.scss +0 -29
- package/src/components/commons/SearchBox/index.tsx +0 -64
- package/src/components/commons/SearchBox/styles.scss +0 -58
- package/src/components/commons/Spinner/index.tsx +0 -8
- package/src/components/commons/SuccessRatePieChart/index.tsx +0 -52
- package/src/components/commons/SuccessRatePieChart/styles.scss +0 -11
- package/src/components/commons/SvgIcon/index.tsx +0 -46
- package/src/components/commons/SvgIcon/styles.scss +0 -26
- package/src/components/commons/Toggle/index.tsx +0 -30
- package/src/components/commons/Toggle/styles.scss +0 -48
- package/src/components/commons/Tooltip/index.tsx +0 -123
- package/src/components/commons/Tooltip/styles.scss +0 -38
- package/src/components/commons/Typography/index.tsx +0 -99
- package/src/hooks/useDebouncedCallback.ts +0 -31
- /package/dist/multi/{app-4468f0e2.js.LICENSE.txt → app-f32e4213.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-33b3c367.js.LICENSE.txt → app-7fa8e43f.js.LICENSE.txt} +0 -0
- /package/src/assets/scss/{code.css → code.scss} +0 -0
- /package/src/components/{app/ArrowButton → ArrowButton}/styles.scss +0 -0
- /package/src/components/{app/BaseLayout → BaseLayout}/styles.scss +0 -0
- /package/src/components/{app/Footer → Footer}/styles.scss +0 -0
- /package/src/components/{app/Header → Header}/styles.scss +0 -0
- /package/src/components/{app/MetadataButton → MetadataButton}/styles.scss +0 -0
- /package/src/components/{app/Modal → Modal}/styles.scss +0 -0
- /package/src/components/{app/ReportBody → ReportBody}/context.tsx +0 -0
- /package/src/components/{app/ReportBody → ReportBody}/styles.scss +0 -0
- /package/src/components/{app/ReportHeader → ReportHeader}/styles.scss +0 -0
- /package/src/components/{app/ReportLogo → ReportLogo}/styles.scss +0 -0
- /package/src/components/{app/ReportLogoFull → ReportLogoFull}/styles.scss +0 -0
- /package/src/components/{app/Tabs → Tabs}/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultAttachmentsView/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultDescription/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultDropdown/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultEmpty/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultError/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultHeader/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultHistory/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultInfo/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultLinks/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultMetadata/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultNavigation/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultParameters/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultPrevStatuses/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultRetriesView/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSeverity/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultStatus/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSteps/HtmlAttachmentPreview.tsx +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultSteps/styles.scss +0 -0
- /package/src/components/{app/TestResult → TestResult}/TestResultTabs/styles.scss +0 -0
- /package/src/components/{app/Tree → Tree}/styles.scss +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import type { AllureAwesomeTestResult } from "types";
|
|
3
|
+
import * as styles from "@/components/BaseLayout/styles.scss";
|
|
4
|
+
import { TestResultDescription } from "@/components/TestResult/TestResultDescription";
|
|
5
|
+
import { TestResultError } from "@/components/TestResult/TestResultError";
|
|
6
|
+
import { TestResultLinks } from "@/components/TestResult/TestResultLinks";
|
|
7
|
+
import { TestResultMetadata } from "@/components/TestResult/TestResultMetadata";
|
|
8
|
+
import { TestResultParameters } from "@/components/TestResult/TestResultParameters";
|
|
9
|
+
import { TestResultSetup } from "@/components/TestResult/TestResultSetup";
|
|
10
|
+
import { TestResultSteps } from "@/components/TestResult/TestResultSteps";
|
|
11
|
+
import { TestResultTeardown } from "@/components/TestResult/TestResultTeardown";
|
|
12
|
+
import TestStepsEmpty from "@/components/TestResult/TestStepsEmpty";
|
|
13
|
+
|
|
14
|
+
export type TestResultOverviewProps = {
|
|
15
|
+
testResult?: AllureAwesomeTestResult;
|
|
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
|
+
<TestResultError {...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
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FunctionalComponent } from "preact";
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
2
|
import { useState } from "preact/hooks";
|
|
3
|
-
import { AllureAwesomeTestResult } from "types";
|
|
4
|
-
import { MetadataList } from "@/components/
|
|
5
|
-
import { MetadataButton } from "@/components/
|
|
3
|
+
import type { AllureAwesomeTestResult } from "types";
|
|
4
|
+
import { MetadataList } from "@/components/Metadata";
|
|
5
|
+
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
6
|
import { useI18n } from "@/stores/locale";
|
|
7
7
|
import * as styles from "./styles.scss";
|
|
8
8
|
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
+
import { type HistoryTestResult } from "@allurereport/core-api";
|
|
2
|
+
import { SvgIcon, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
1
3
|
import type { FunctionalComponent } from "preact";
|
|
2
4
|
import type { AllureAwesomeTestResult } from "types";
|
|
3
|
-
import
|
|
4
|
-
import { useTestResultTabsContext } from "@/components/app/TestResult/TestResultTabs";
|
|
5
|
-
import { SvgIcon } from "@/components/commons/SvgIcon";
|
|
6
|
-
import { TooltipWrapper } from "@/components/commons/Tooltip";
|
|
7
|
-
import { Text } from "@/components/commons/Typography";
|
|
8
|
-
import { navigateTo, openInNewTab } from "@/index";
|
|
5
|
+
import { navigateTo } from "@/index";
|
|
9
6
|
import { useI18n } from "@/stores";
|
|
10
7
|
import { capitalize } from "@/utils/capitalize";
|
|
11
8
|
import { timestampToDate } from "@/utils/time";
|
|
12
9
|
import * as styles from "./styles.scss";
|
|
13
10
|
|
|
14
|
-
const TestResultPrevStatus = ({ item }) => {
|
|
11
|
+
const TestResultPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
|
|
15
12
|
return (
|
|
16
13
|
<div className={styles["test-result-prev-status"]} onClick={() => navigateTo(`testresult/${item.id}`)}>
|
|
17
|
-
<SvgIcon id={
|
|
14
|
+
<SvgIcon id={allureIcons.lineShapesDotCircle} className={styles[`status-${item?.status}`]} />
|
|
18
15
|
</div>
|
|
19
16
|
);
|
|
20
17
|
};
|
|
21
|
-
const TestResultPrevStatusTooltip = ({ item }) => {
|
|
18
|
+
const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
|
|
22
19
|
const convertedStop = item.stop && timestampToDate(item.stop);
|
|
23
20
|
const { t } = useI18n("statuses");
|
|
24
21
|
const status = t(item.status);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { formatDuration } from "@allurereport/core-api";
|
|
2
|
+
import { IconButton, Text, allureIcons } from "@allurereport/web-components";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import { useState } from "preact/hooks";
|
|
5
|
+
import type { AllureAwesomeTestResult } from "types";
|
|
6
|
+
import { ArrowButton } from "@/components/ArrowButton";
|
|
7
|
+
import { TestResultError } from "@/components/TestResult/TestResultError";
|
|
8
|
+
import * as styles from "@/components/TestResult/TestResultRetriesView/styles.scss";
|
|
9
|
+
import TreeItemIcon from "@/components/Tree/TreeItemIcon";
|
|
10
|
+
import { navigateTo } from "@/index";
|
|
11
|
+
import { timestampToDate } from "@/utils/time";
|
|
12
|
+
|
|
13
|
+
export const TestResultRetriesItem: FunctionalComponent<{
|
|
14
|
+
testResultItem: AllureAwesomeTestResult;
|
|
15
|
+
}> = ({ testResultItem }) => {
|
|
16
|
+
const { id, status, error, stop, duration } = testResultItem;
|
|
17
|
+
const [isOpened, setIsOpen] = useState(false);
|
|
18
|
+
const convertedStop = timestampToDate(stop);
|
|
19
|
+
const formattedDuration = typeof duration === "number" ? formatDuration(duration as number) : undefined;
|
|
20
|
+
const navigateUrl = `/testresult/${id}`;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<div className={styles["test-result-retries-item-header"]} onClick={() => setIsOpen(!isOpened)}>
|
|
25
|
+
{Boolean(error) && <ArrowButton isOpened={isOpened} icon={allureIcons.lineArrowsChevronDown} />}
|
|
26
|
+
<div className={styles["test-result-retries-item-wrap"]}>
|
|
27
|
+
<TreeItemIcon status={status} className={styles["test-result-retries-item-status"]} />
|
|
28
|
+
<Text className={styles["test-result-retries-item-text"]}>{convertedStop}</Text>
|
|
29
|
+
<div className={styles["test-result-retries-item-info"]}>
|
|
30
|
+
{Boolean(formattedDuration) && (
|
|
31
|
+
<Text type="ui" size={"s"} className={styles["item-time"]}>
|
|
32
|
+
{formattedDuration}
|
|
33
|
+
</Text>
|
|
34
|
+
)}
|
|
35
|
+
<IconButton
|
|
36
|
+
icon={allureIcons.lineGeneralLinkExternal}
|
|
37
|
+
style={"ghost"}
|
|
38
|
+
size={"s"}
|
|
39
|
+
className={styles["test-result-retries-item-link"]}
|
|
40
|
+
onClick={() => navigateTo(navigateUrl)}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
{isOpened && error && (
|
|
46
|
+
<div className={styles["test-result-retries-item-content"]}>
|
|
47
|
+
<TestResultError {...error} />
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FunctionalComponent } from "preact";
|
|
2
|
+
import type { AllureAwesomeTestResult } 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: AllureAwesomeTestResult;
|
|
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 AllureAwesomeTestResult} key={key} />
|
|
18
|
+
))
|
|
19
|
+
) : (
|
|
20
|
+
<div className={styles["test-result-empty"]}>{t("no-retries-results")}</div>
|
|
21
|
+
)}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { FunctionalComponent } from "preact";
|
|
1
|
+
import { allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import type { FunctionalComponent } from "preact";
|
|
3
3
|
import { useState } from "preact/hooks";
|
|
4
|
-
import { AllureAwesomeTestResult } from "types";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { TestResultStep } from "@/components/app/TestResult/TestResultSteps/testResultStep";
|
|
4
|
+
import type { AllureAwesomeTestResult } from "types";
|
|
5
|
+
import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
|
|
6
|
+
import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
|
|
7
|
+
import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
|
|
8
|
+
import { TestResultStep } from "@/components/TestResult/TestResultSteps/testResultStep";
|
|
10
9
|
import { useI18n } from "@/stores/locale";
|
|
10
|
+
import { collapsedTrees, toggleTree } from "@/stores/tree";
|
|
11
11
|
|
|
12
12
|
const typeMap = {
|
|
13
13
|
before: TestResultStep,
|
|
@@ -18,18 +18,26 @@ const typeMap = {
|
|
|
18
18
|
|
|
19
19
|
export type TestResultSetupProps = {
|
|
20
20
|
setup: AllureAwesomeTestResult["setup"];
|
|
21
|
+
id?: string;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
|
-
export const TestResultSetup: FunctionalComponent<TestResultSetupProps> = ({ setup }) => {
|
|
24
|
-
const
|
|
24
|
+
export const TestResultSetup: FunctionalComponent<TestResultSetupProps> = ({ setup, id }) => {
|
|
25
|
+
const teardownId = `${id}-setup`;
|
|
26
|
+
const isEarlyCollapsed = Boolean(!collapsedTrees.value.has(teardownId));
|
|
27
|
+
const [isOpened, setIsOpen] = useState<boolean>(isEarlyCollapsed);
|
|
28
|
+
|
|
29
|
+
const handleClick = () => {
|
|
30
|
+
setIsOpen(!isOpened);
|
|
31
|
+
toggleTree(teardownId);
|
|
32
|
+
};
|
|
25
33
|
const { t } = useI18n("execution");
|
|
26
34
|
|
|
27
35
|
return (
|
|
28
36
|
<div className={styles["test-result-steps"]}>
|
|
29
37
|
<TestResultDropdown
|
|
30
|
-
icon={
|
|
38
|
+
icon={allureIcons.lineTimeClockStopwatch}
|
|
31
39
|
isOpened={isOpened}
|
|
32
|
-
setIsOpen={
|
|
40
|
+
setIsOpen={handleClick}
|
|
33
41
|
counter={setup?.length}
|
|
34
42
|
title={t("setup")}
|
|
35
43
|
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { useI18n } from "@/stores/locale";
|
|
4
|
+
import { capitalize } from "@/utils/capitalize";
|
|
5
|
+
import * as styles from "./styles.scss";
|
|
6
|
+
|
|
7
|
+
const icons: Record<string, string> = {
|
|
8
|
+
blocker: allureIcons.lineArrowsChevronUpDouble,
|
|
9
|
+
critical: allureIcons.lineArrowsChevronUp,
|
|
10
|
+
normal: allureIcons.lineGeneralEqual,
|
|
11
|
+
minor: allureIcons.lineArrowsChevronDown,
|
|
12
|
+
trivial: allureIcons.lineArrowsChevronDownDouble,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TestResultSeverity = ({ severity = "normal" }: { severity?: string }) => {
|
|
16
|
+
const { t } = useI18n("severity");
|
|
17
|
+
const statusClass = clsx(styles[`severity-${severity}`]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={styles["test-result-severity"]}>
|
|
21
|
+
<SvgIcon className={statusClass} id={icons[severity]} />
|
|
22
|
+
<Text size={"s"} bold className={styles["test-result-severity-text"]}>
|
|
23
|
+
{capitalize(t(severity))}
|
|
24
|
+
</Text>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TestStatus } from "@allurereport/core-api";
|
|
2
|
+
import { Text } from "@allurereport/web-components";
|
|
2
3
|
import clsx from "clsx";
|
|
3
|
-
import TreeItemIcon from "@/components/
|
|
4
|
-
import { Text } from "@/components/commons/Typography";
|
|
4
|
+
import TreeItemIcon from "@/components/Tree/TreeItemIcon";
|
|
5
5
|
import { useI18n } from "@/stores";
|
|
6
6
|
import { capitalize } from "@/utils/capitalize";
|
|
7
7
|
import * as styles from "./styles.scss";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { Spinner } from "@allurereport/web-components";
|
|
2
3
|
import type { FunctionalComponent } from "preact";
|
|
3
4
|
import { useEffect, useState } from "preact/hooks";
|
|
4
|
-
import { modalData } from "@/components/
|
|
5
|
-
import { HtmlAttachmentPreview } from "@/components/
|
|
6
|
-
import { AttachmentCode } from "@/components/
|
|
7
|
-
import { AttachmentImage } from "@/components/
|
|
8
|
-
import { AttachmentVideo } from "@/components/
|
|
9
|
-
import { EmptyComponent } from "@/components/
|
|
10
|
-
import { Spinner } from "@/components/commons/Spinner";
|
|
5
|
+
import { modalData } from "@/components/Modal";
|
|
6
|
+
import { HtmlAttachmentPreview } from "@/components/TestResult/TestResultSteps/HtmlAttachmentPreview";
|
|
7
|
+
import { AttachmentCode } from "@/components/TestResult/TestResultSteps/attachmentCode";
|
|
8
|
+
import { AttachmentImage } from "@/components/TestResult/TestResultSteps/attachmentImage";
|
|
9
|
+
import { AttachmentVideo } from "@/components/TestResult/TestResultSteps/attachmentVideo";
|
|
10
|
+
import { EmptyComponent } from "@/components/TestResult/TestResultSteps/wrongAttachment";
|
|
11
11
|
import { type Attachments, attachmentType, fetchAttachment } from "@/utils/attachments";
|
|
12
12
|
import * as styles from "./styles.scss";
|
|
13
13
|
|
|
14
|
-
const componentsByAttachmentType = {
|
|
14
|
+
const componentsByAttachmentType: Record<string, any> = {
|
|
15
15
|
image: AttachmentImage,
|
|
16
16
|
svg: AttachmentImage,
|
|
17
17
|
json: AttachmentCode,
|
|
@@ -23,7 +23,7 @@ const componentsByAttachmentType = {
|
|
|
23
23
|
text: AttachmentCode,
|
|
24
24
|
video: AttachmentVideo,
|
|
25
25
|
};
|
|
26
|
-
const previewComponentsByAttachmentType = {
|
|
26
|
+
const previewComponentsByAttachmentType: Record<string, any> = {
|
|
27
27
|
html: HtmlAttachmentPreview,
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -49,7 +49,7 @@ export const Attachment: FunctionalComponent<AttachmentTestStepResultProps> = ({
|
|
|
49
49
|
setAttachment(result);
|
|
50
50
|
};
|
|
51
51
|
fetchData();
|
|
52
|
-
}, [
|
|
52
|
+
}, [contentType, id, ext]);
|
|
53
53
|
|
|
54
54
|
if (!loaded) {
|
|
55
55
|
return (
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { type AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { type FunctionalComponent } from "preact";
|
|
1
3
|
import { useEffect } from "preact/hooks";
|
|
2
4
|
import Prism from "prismjs";
|
|
3
|
-
import "@/assets/scss/code.
|
|
5
|
+
import "@/assets/scss/code.scss";
|
|
4
6
|
|
|
5
|
-
export const AttachmentCode
|
|
7
|
+
export const AttachmentCode: FunctionalComponent<{
|
|
8
|
+
item: AttachmentTestStepResult;
|
|
9
|
+
attachment: { text?: string };
|
|
10
|
+
}> = ({ attachment, item }) => {
|
|
6
11
|
useEffect(() => {
|
|
7
12
|
Prism.highlightAll();
|
|
8
13
|
}, [attachment]);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type FunctionalComponent } from "preact";
|
|
1
2
|
import { useEffect, useState } from "preact/hooks";
|
|
2
|
-
import * as styles from "@/components/
|
|
3
|
-
import { EmptyComponent } from "@/components/
|
|
3
|
+
import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
|
|
4
|
+
import { EmptyComponent } from "@/components/TestResult/TestResultSteps/wrongAttachment";
|
|
4
5
|
|
|
5
|
-
export const AttachmentImage
|
|
6
|
+
export const AttachmentImage: FunctionalComponent<{
|
|
7
|
+
attachment: { img: string; originalFileName: string };
|
|
8
|
+
}> = ({ attachment }) => {
|
|
6
9
|
const [isValidImage, setIsValidImage] = useState(true);
|
|
7
10
|
|
|
8
11
|
useEffect(() => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Spinner } from "@allurereport/web-components";
|
|
2
|
+
import { type FunctionalComponent } from "preact";
|
|
3
|
+
|
|
4
|
+
export const AttachmentVideo: FunctionalComponent<{
|
|
5
|
+
attachment: { src: string; contentType?: string };
|
|
6
|
+
}> = ({ attachment }) => {
|
|
7
|
+
if (!attachment) {
|
|
8
|
+
return <Spinner />;
|
|
9
|
+
}
|
|
10
|
+
return (
|
|
11
|
+
<video controls loop muted>
|
|
12
|
+
<source src={attachment?.src} type={attachment?.contentType} />
|
|
13
|
+
</video>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { allureIcons } from "@allurereport/web-components";
|
|
1
2
|
import type { FunctionalComponent } from "preact";
|
|
2
3
|
import { useState } from "preact/hooks";
|
|
3
4
|
import type { AllureAwesomeTestResult, AllureAwesomeTestStepResult } from "types";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { TestResultStep } from "@/components/app/TestResult/TestResultSteps/testResultStep";
|
|
5
|
+
import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
|
|
6
|
+
import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
|
|
7
|
+
import { TestResultStep } from "@/components/TestResult/TestResultSteps/testResultStep";
|
|
8
8
|
import { useI18n } from "@/stores/locale";
|
|
9
|
+
import { collapsedTrees, toggleTree } from "@/stores/tree";
|
|
9
10
|
import * as styles from "./styles.scss";
|
|
10
11
|
|
|
11
12
|
const typeMap = {
|
|
@@ -15,6 +16,7 @@ const typeMap = {
|
|
|
15
16
|
|
|
16
17
|
export type TestResultStepsProps = {
|
|
17
18
|
steps: AllureAwesomeTestResult["steps"];
|
|
19
|
+
id?: string;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
type StepComponentProps = FunctionalComponent<{
|
|
@@ -22,16 +24,23 @@ type StepComponentProps = FunctionalComponent<{
|
|
|
22
24
|
stepIndex?: number;
|
|
23
25
|
}>;
|
|
24
26
|
|
|
25
|
-
export const TestResultSteps: FunctionalComponent<TestResultStepsProps> = ({ steps }) => {
|
|
26
|
-
const
|
|
27
|
+
export const TestResultSteps: FunctionalComponent<TestResultStepsProps> = ({ steps, id }) => {
|
|
28
|
+
const stepsId = `${id}-steps`;
|
|
29
|
+
const isEarlyCollapsed = Boolean(!collapsedTrees.value.has(stepsId));
|
|
30
|
+
const [isOpened, setIsOpen] = useState<boolean>(isEarlyCollapsed);
|
|
31
|
+
|
|
32
|
+
const handleClick = () => {
|
|
33
|
+
setIsOpen(!isOpened);
|
|
34
|
+
toggleTree(stepsId);
|
|
35
|
+
};
|
|
27
36
|
|
|
28
37
|
const { t } = useI18n("execution");
|
|
29
38
|
return (
|
|
30
39
|
<div className={styles["test-result-steps"]}>
|
|
31
40
|
<TestResultDropdown
|
|
32
|
-
icon={
|
|
41
|
+
icon={allureIcons.lineHelpersPlayCircle}
|
|
33
42
|
isOpened={isOpened}
|
|
34
|
-
setIsOpen={
|
|
43
|
+
setIsOpen={handleClick}
|
|
35
44
|
counter={steps?.length}
|
|
36
45
|
title={t("body")}
|
|
37
46
|
/>
|
package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachment.tsx
RENAMED
|
@@ -1,33 +1,31 @@
|
|
|
1
1
|
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { Code, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
3
|
import type { FunctionComponent } from "preact";
|
|
3
4
|
import { useState } from "preact/hooks";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { Attachment } from "@/components/app/TestResult/TestResultSteps/attachment";
|
|
9
|
-
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
10
|
-
import { TestResultAttachmentInfo } from "@/components/app/TestResult/TestResultSteps/testResultAttachmentInfo";
|
|
11
|
-
import { SvgIcon } from "@/components/commons/SvgIcon";
|
|
12
|
-
import { Code, Text } from "@/components/commons/Typography";
|
|
5
|
+
import { ArrowButton } from "@/components/ArrowButton";
|
|
6
|
+
import { Attachment } from "@/components/TestResult/TestResultSteps/attachment";
|
|
7
|
+
import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
|
|
8
|
+
import { TestResultAttachmentInfo } from "@/components/TestResult/TestResultSteps/testResultAttachmentInfo";
|
|
13
9
|
import { attachmentType } from "@/utils/attachments";
|
|
14
10
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"text/
|
|
19
|
-
"
|
|
20
|
-
"text/
|
|
21
|
-
"text/
|
|
22
|
-
"text/
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"video/
|
|
30
|
-
"
|
|
11
|
+
const { lineImagesImage, lineFilesFileAttachment2 } = allureIcons;
|
|
12
|
+
|
|
13
|
+
const iconMap: Record<string, string> = {
|
|
14
|
+
"text/plain": lineFilesFileAttachment2,
|
|
15
|
+
"application/xml": lineFilesFileAttachment2,
|
|
16
|
+
"text/html": lineFilesFileAttachment2,
|
|
17
|
+
"text/csv": lineFilesFileAttachment2,
|
|
18
|
+
"text/tab-separated-values": lineFilesFileAttachment2,
|
|
19
|
+
"text/css": lineFilesFileAttachment2,
|
|
20
|
+
"text/uri-list": lineFilesFileAttachment2,
|
|
21
|
+
"image/svg+xml": lineImagesImage,
|
|
22
|
+
"image/png": lineImagesImage,
|
|
23
|
+
"application/json": lineFilesFileAttachment2,
|
|
24
|
+
"application/zip": lineFilesFileAttachment2,
|
|
25
|
+
"video/webm": lineImagesImage,
|
|
26
|
+
"image/jpeg": lineImagesImage,
|
|
27
|
+
"video/mp4": lineImagesImage,
|
|
28
|
+
"application/vnd.allure.image.diff": lineImagesImage,
|
|
31
29
|
};
|
|
32
30
|
|
|
33
31
|
export const TestResultAttachment: FunctionComponent<{
|
|
@@ -50,9 +48,9 @@ export const TestResultAttachment: FunctionComponent<{
|
|
|
50
48
|
setIsOpen((prev) => !prev);
|
|
51
49
|
}}
|
|
52
50
|
>
|
|
53
|
-
<ArrowButton isOpened={isOpened}
|
|
51
|
+
<ArrowButton isOpened={isOpened} />
|
|
54
52
|
<div className={styles["test-result-attachment-icon"]}>
|
|
55
|
-
<SvgIcon size="s" id={iconMap[link.contentType]
|
|
53
|
+
<SvgIcon size="s" id={iconMap[link.contentType] ?? lineFilesFileAttachment2} />
|
|
56
54
|
</div>
|
|
57
55
|
|
|
58
56
|
<Code size="s" className={styles["test-result-step-number"]}>
|
package/src/components/{app/TestResult → TestResult}/TestResultSteps/testResultAttachmentInfo.tsx
RENAMED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import type { AttachmentTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
|
|
2
3
|
import { filesize } from "filesize";
|
|
3
4
|
import type { FunctionalComponent } from "preact";
|
|
4
5
|
import { useEffect } from "preact/hooks";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Attachment } from "@/components/app/TestResult/TestResultSteps/attachment";
|
|
9
|
-
import * as styles from "@/components/app/TestResult/TestResultSteps/styles.scss";
|
|
10
|
-
import { IconButton } from "@/components/commons/Button";
|
|
11
|
-
import { TooltipWrapper } from "@/components/commons/Tooltip";
|
|
12
|
-
import { Text } from "@/components/commons/Typography";
|
|
6
|
+
import { isModalOpen, openModal } from "@/components/Modal";
|
|
7
|
+
import { Attachment } from "@/components/TestResult/TestResultSteps/attachment";
|
|
8
|
+
import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
|
|
13
9
|
import { useI18n } from "@/stores";
|
|
14
10
|
import { downloadAttachment } from "@/utils/attachments";
|
|
15
11
|
|
|
@@ -26,7 +22,7 @@ export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentI
|
|
|
26
22
|
const { t: tooltip } = useI18n("controls");
|
|
27
23
|
const contentLength = item.link.missed === false ? item.link.contentLength : undefined;
|
|
28
24
|
const contentSize = contentLength
|
|
29
|
-
? filesize(contentLength
|
|
25
|
+
? filesize(contentLength, {
|
|
30
26
|
base: 2,
|
|
31
27
|
round: 1,
|
|
32
28
|
})
|
|
@@ -47,7 +43,7 @@ export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentI
|
|
|
47
43
|
component: <Attachment item={item} />,
|
|
48
44
|
});
|
|
49
45
|
}
|
|
50
|
-
}, []);
|
|
46
|
+
}, [item]);
|
|
51
47
|
|
|
52
48
|
const downloadData = async (e: MouseEvent) => {
|
|
53
49
|
e.stopPropagation();
|
|
@@ -66,7 +62,7 @@ export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentI
|
|
|
66
62
|
style={"ghost"}
|
|
67
63
|
size={"s"}
|
|
68
64
|
iconSize={"s"}
|
|
69
|
-
icon={
|
|
65
|
+
icon={allureIcons.lineArrowsExpand3}
|
|
70
66
|
onClick={expandAttachment}
|
|
71
67
|
/>
|
|
72
68
|
</TooltipWrapper>
|
|
@@ -77,7 +73,7 @@ export const TestResultAttachmentInfo: FunctionalComponent<TestResultAttachmentI
|
|
|
77
73
|
size={"s"}
|
|
78
74
|
iconSize={"s"}
|
|
79
75
|
className={styles["item-button"]}
|
|
80
|
-
icon={
|
|
76
|
+
icon={allureIcons.lineGeneralDownloadCloud}
|
|
81
77
|
onClick={(e: MouseEvent) => downloadData(e)}
|
|
82
78
|
/>
|
|
83
79
|
</TooltipWrapper>
|
|
@@ -1,35 +1,43 @@
|
|
|
1
1
|
import type { DefaultTestStepResult } from "@allurereport/core-api";
|
|
2
|
+
import { Code, Text, allureIcons } from "@allurereport/web-components";
|
|
2
3
|
import type { FunctionComponent } from "preact";
|
|
3
4
|
import { useState } from "preact/hooks";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import * as styles from "@/components/
|
|
8
|
-
import { TestResultAttachment } from "@/components/
|
|
9
|
-
import { TestResultStepInfo } from "@/components/
|
|
10
|
-
import TreeItemIcon from "@/components/
|
|
11
|
-
import {
|
|
5
|
+
import { ArrowButton } from "@/components/ArrowButton";
|
|
6
|
+
import { MetadataList } from "@/components/Metadata";
|
|
7
|
+
import { type MetadataItem } from "@/components/ReportMetadata";
|
|
8
|
+
import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
|
|
9
|
+
import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
|
|
10
|
+
import { TestResultStepInfo } from "@/components/TestResult/TestResultSteps/testResultStepInfo";
|
|
11
|
+
import TreeItemIcon from "@/components/Tree/TreeItemIcon";
|
|
12
|
+
import { collapsedTrees, toggleTree } from "@/stores/tree";
|
|
13
|
+
|
|
14
|
+
export const TestResultStepParameters = (props: { parameters: DefaultTestStepResult["parameters"] }) => {
|
|
15
|
+
const { parameters } = props;
|
|
12
16
|
|
|
13
|
-
export const TestResultStepParameters = ({ parameters }) => {
|
|
14
17
|
return (
|
|
15
18
|
<div className={styles["test-result-parameters"]}>
|
|
16
|
-
<MetadataList size={"s"} envInfo={parameters} columns={1} />
|
|
19
|
+
<MetadataList size={"s"} envInfo={parameters as unknown as MetadataItem[]} columns={1} />
|
|
17
20
|
</div>
|
|
18
21
|
);
|
|
19
22
|
};
|
|
20
|
-
export const TestResultStepsContent = ({ item }) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
attachment: TestResultAttachment,
|
|
24
|
-
};
|
|
23
|
+
export const TestResultStepsContent = (props: { item: DefaultTestStepResult }) => {
|
|
24
|
+
const { item } = props;
|
|
25
|
+
|
|
25
26
|
return (
|
|
26
27
|
<div className={styles["test-result-step-content"]}>
|
|
27
28
|
{Boolean(item?.parameters?.length) && <TestResultStepParameters parameters={item.parameters} />}
|
|
28
29
|
{Boolean(item?.steps?.length) && (
|
|
29
30
|
<>
|
|
30
31
|
{item.steps?.map((subItem, key) => {
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
if (subItem.type === "step") {
|
|
33
|
+
return <TestResultStep stepIndex={key + 1} key={key} item={subItem} />;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (subItem.type === "attachment") {
|
|
37
|
+
return <TestResultAttachment stepIndex={key + 1} key={key} item={subItem} />;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return null;
|
|
33
41
|
})}
|
|
34
42
|
</>
|
|
35
43
|
)}
|
|
@@ -42,18 +50,24 @@ export const TestResultStep: FunctionComponent<{
|
|
|
42
50
|
stepIndex?: number;
|
|
43
51
|
className?: string;
|
|
44
52
|
}> = ({ item, stepIndex }) => {
|
|
45
|
-
const
|
|
53
|
+
const isEarlyOpened = collapsedTrees.value.has(item.stepId);
|
|
54
|
+
const [isOpened, setIsOpen] = useState(isEarlyOpened || false);
|
|
46
55
|
const hasContent = Boolean(item?.steps?.length || item?.parameters?.length);
|
|
47
56
|
|
|
57
|
+
const handleClick = () => {
|
|
58
|
+
setIsOpen(!isOpened);
|
|
59
|
+
toggleTree(item.stepId);
|
|
60
|
+
};
|
|
61
|
+
|
|
48
62
|
return (
|
|
49
63
|
<div className={styles["test-result-step"]}>
|
|
50
|
-
<div className={styles["test-result-step-header"]} onClick={
|
|
64
|
+
<div className={styles["test-result-step-header"]} onClick={handleClick}>
|
|
51
65
|
{!hasContent ? (
|
|
52
66
|
<div className={styles["test-result-strut"]} />
|
|
53
67
|
) : (
|
|
54
68
|
<ArrowButton
|
|
55
69
|
isOpened={isOpened}
|
|
56
|
-
icon={arrowsChevronDown
|
|
70
|
+
icon={allureIcons.arrowsChevronDown}
|
|
57
71
|
iconSize={"xs"}
|
|
58
72
|
className={!hasContent ? styles["test-result-visibility-hidden"] : ""}
|
|
59
73
|
/>
|