@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
package/types.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AttachmentTestStepResult,
|
|
3
|
+
DefaultTreeGroup,
|
|
4
|
+
HistoryTestResult,
|
|
5
|
+
TestFixtureResult,
|
|
6
|
+
TestResult,
|
|
7
|
+
TestStatus,
|
|
8
|
+
TestStepResult,
|
|
9
|
+
TreeData,
|
|
10
|
+
WithChildren,
|
|
11
|
+
} from "@allurereport/core-api";
|
|
12
|
+
|
|
13
|
+
export type Layout = "base" | "split";
|
|
14
|
+
|
|
15
|
+
export type AwesomeReportOptions = {
|
|
16
|
+
allureVersion: string;
|
|
17
|
+
reportName?: string;
|
|
18
|
+
logo?: string;
|
|
19
|
+
theme?: "light" | "dark";
|
|
20
|
+
groupBy?: string[];
|
|
21
|
+
reportLanguage?: "en" | "ru";
|
|
22
|
+
createdAt: number;
|
|
23
|
+
reportUuid: string;
|
|
24
|
+
layout?: Layout;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type AwesomeFixtureResult = Omit<
|
|
28
|
+
TestFixtureResult,
|
|
29
|
+
"testResultIds" | "start" | "stop" | "sourceMetadata" | "steps"
|
|
30
|
+
> & {
|
|
31
|
+
steps: AwesomeTestStepResult[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type AwesomeStatus = TestStatus | "total";
|
|
35
|
+
|
|
36
|
+
export type AwesomeTestStepResult = TestStepResult;
|
|
37
|
+
|
|
38
|
+
type AwesomeBreadcrumbItem = string[] | string[][];
|
|
39
|
+
|
|
40
|
+
export interface AwesomeCategory {
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
descriptionHtml?: string;
|
|
44
|
+
messageRegex?: string;
|
|
45
|
+
traceRegex?: string;
|
|
46
|
+
matchedStatuses?: TestStatus[];
|
|
47
|
+
flaky?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type AwesomeTestResult = Omit<
|
|
51
|
+
TestResult,
|
|
52
|
+
| "runSelector"
|
|
53
|
+
| "sourceMetadata"
|
|
54
|
+
| "expectedResult"
|
|
55
|
+
| "expectedResultHtml"
|
|
56
|
+
| "precondition"
|
|
57
|
+
| "preconditionHtml"
|
|
58
|
+
| "steps"
|
|
59
|
+
| "environment"
|
|
60
|
+
> & {
|
|
61
|
+
setup: AwesomeFixtureResult[];
|
|
62
|
+
teardown: AwesomeFixtureResult[];
|
|
63
|
+
steps: AwesomeTestStepResult[];
|
|
64
|
+
history: HistoryTestResult[];
|
|
65
|
+
retries?: TestResult[];
|
|
66
|
+
groupedLabels: Record<string, string[]>;
|
|
67
|
+
attachments?: AttachmentTestStepResult[];
|
|
68
|
+
breadcrumbs: AwesomeBreadcrumbItem[];
|
|
69
|
+
order?: number;
|
|
70
|
+
groupOrder?: number;
|
|
71
|
+
retry: boolean;
|
|
72
|
+
categories?: AwesomeCategory[];
|
|
73
|
+
environment?: string | "default";
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type AwesomeTreeLeaf = Pick<
|
|
77
|
+
AwesomeTestResult,
|
|
78
|
+
"duration" | "name" | "start" | "status" | "groupOrder" | "flaky" | "retry"
|
|
79
|
+
> & {
|
|
80
|
+
nodeId: string;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type AwesomeTreeGroup = WithChildren & DefaultTreeGroup & { nodeId: string };
|
|
84
|
+
|
|
85
|
+
export type AwesomeTree = TreeData<AwesomeTreeLeaf, AwesomeTreeGroup>;
|
|
86
|
+
/**
|
|
87
|
+
* Tree which contains tree leaves instead of their IDs and recursive trees structure instead of groups
|
|
88
|
+
*/
|
|
89
|
+
export type AwesomeRecursiveTree = DefaultTreeGroup & {
|
|
90
|
+
nodeId: string;
|
|
91
|
+
leaves: AwesomeTreeLeaf[];
|
|
92
|
+
trees: AwesomeRecursiveTree[];
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// TODO: maybe it should call `TestCase` instead of Group
|
|
96
|
+
// TODO: add worst status
|
|
97
|
+
export type AwesomeTestResultGroup = Pick<AwesomeTestResult, "name" | "fullName" | "groupOrder"> & {
|
|
98
|
+
testResults: AwesomeTestResult[];
|
|
99
|
+
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
const require = createRequire(import.meta.url);
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
test: {
|
|
8
|
+
include: ["./test/**/*.test.ts"],
|
|
9
|
+
setupFiles: [require.resolve("allure-vitest/setup")],
|
|
10
|
+
reporters: [
|
|
11
|
+
"default",
|
|
12
|
+
[
|
|
13
|
+
"allure-vitest/reporter",
|
|
14
|
+
{ resultsDir: "./out/allure-results", globalLabels: [{ name: "module", value: "web-awesome" }] },
|
|
15
|
+
],
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import HtmlWebpackPlugin from "html-webpack-plugin";
|
|
2
|
+
import MiniCssExtractPlugin from "mini-css-extract-plugin";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { env } from "node:process";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import SpriteLoaderPlugin from "svg-sprite-loader/plugin.js";
|
|
7
|
+
import webpack from "webpack";
|
|
8
|
+
import { WebpackManifestPlugin } from "webpack-manifest-plugin";
|
|
9
|
+
import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin";
|
|
10
|
+
|
|
11
|
+
const { SINGLE_FILE_MODE } = env;
|
|
12
|
+
const baseDir = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
|
|
14
|
+
export default (env, argv) => {
|
|
15
|
+
const devMode = argv?.mode === "development";
|
|
16
|
+
const config = {
|
|
17
|
+
entry: "./src/index.tsx",
|
|
18
|
+
output: {
|
|
19
|
+
path: join(baseDir, SINGLE_FILE_MODE ? "dist/single" : "dist/multi"),
|
|
20
|
+
filename: devMode ? "app.js" : "app-[hash:8].js",
|
|
21
|
+
assetModuleFilename: devMode ? `[name].[ext]` : `[name]-[hash:8].[ext]`,
|
|
22
|
+
},
|
|
23
|
+
devtool: devMode ? "inline-source-map" : false,
|
|
24
|
+
module: {
|
|
25
|
+
rules: [
|
|
26
|
+
{
|
|
27
|
+
test: /\.tsx?$/,
|
|
28
|
+
use: "babel-loader",
|
|
29
|
+
exclude: /node_modules/,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
test: /\.css$/,
|
|
33
|
+
use: [SINGLE_FILE_MODE ? "style-loader" : MiniCssExtractPlugin.loader, "css-loader"],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
test: /\.scss$/,
|
|
37
|
+
use: [
|
|
38
|
+
SINGLE_FILE_MODE ? "style-loader" : MiniCssExtractPlugin.loader,
|
|
39
|
+
{
|
|
40
|
+
loader: "css-loader",
|
|
41
|
+
options: {
|
|
42
|
+
modules: {
|
|
43
|
+
localIdentName: devMode ? "[path][name]__[local]" : "[hash:base64:8]",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
"sass-loader",
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
test: /\.svg$/,
|
|
52
|
+
loader: "svg-sprite-loader",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
test: /\.(png|jpe?g|gif|woff2?|otf|ttf)$/i,
|
|
56
|
+
type: SINGLE_FILE_MODE ? "asset/inline" : "asset/resource",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
devServer: {
|
|
61
|
+
hot: true,
|
|
62
|
+
static: "./out/dev",
|
|
63
|
+
historyApiFallback: true,
|
|
64
|
+
watchFiles: ["./src"],
|
|
65
|
+
devMiddleware: {
|
|
66
|
+
index: true,
|
|
67
|
+
mimeTypes: { phtml: "text/html" },
|
|
68
|
+
serverSideRender: false,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
plugins: [
|
|
72
|
+
new ForkTsCheckerPlugin(),
|
|
73
|
+
new webpack.DefinePlugin({
|
|
74
|
+
DEVELOPMENT: devMode,
|
|
75
|
+
}),
|
|
76
|
+
new MiniCssExtractPlugin({
|
|
77
|
+
filename: devMode ? "styles.css" : "styles-[hash:8].css",
|
|
78
|
+
}),
|
|
79
|
+
new SpriteLoaderPlugin(),
|
|
80
|
+
new WebpackManifestPlugin({
|
|
81
|
+
publicPath: "",
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
resolve: {
|
|
85
|
+
modules: ["node_modules"],
|
|
86
|
+
extensions: [".js", ".ts", ".tsx"],
|
|
87
|
+
alias: {
|
|
88
|
+
"@": join(baseDir, "src"),
|
|
89
|
+
"react": "@preact/compat",
|
|
90
|
+
"react-dom": "@preact/compat",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
if (SINGLE_FILE_MODE) {
|
|
96
|
+
config.plugins.push(
|
|
97
|
+
new webpack.optimize.LimitChunkCountPlugin({
|
|
98
|
+
maxChunks: 1,
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (devMode) {
|
|
104
|
+
config.plugins.push(
|
|
105
|
+
new HtmlWebpackPlugin({
|
|
106
|
+
template: "src/index.html",
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return config;
|
|
112
|
+
};
|