@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.
Files changed (196) hide show
  1. package/.babelrc.js +46 -0
  2. package/.eslintrc.cjs +18 -0
  3. package/CONTRIBUTING.md +34 -0
  4. package/README.md +27 -0
  5. package/dist/multi/141.app-d01d0c66.js +1 -0
  6. package/dist/multi/222.app-d01d0c66.js +1 -0
  7. package/dist/multi/335.app-d01d0c66.js +1 -0
  8. package/dist/multi/34.app-d01d0c66.js +1 -0
  9. package/dist/multi/349.app-d01d0c66.js +1 -0
  10. package/dist/multi/378.app-d01d0c66.js +1 -0
  11. package/dist/multi/406.app-d01d0c66.js +1 -0
  12. package/dist/multi/476.app-d01d0c66.js +1 -0
  13. package/dist/multi/53.app-d01d0c66.js +1 -0
  14. package/dist/multi/584.app-d01d0c66.js +1 -0
  15. package/dist/multi/690.app-d01d0c66.js +1 -0
  16. package/dist/multi/747.app-d01d0c66.js +1 -0
  17. package/dist/multi/767.app-d01d0c66.js +1 -0
  18. package/dist/multi/816.app-d01d0c66.js +1 -0
  19. package/dist/multi/83.app-d01d0c66.js +1 -0
  20. package/dist/multi/873.app-d01d0c66.js +1 -0
  21. package/dist/multi/920.app-d01d0c66.js +1 -0
  22. package/dist/multi/991.app-d01d0c66.js +1 -0
  23. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  24. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  25. package/dist/multi/app-d01d0c66.js +2 -0
  26. package/dist/multi/app-d01d0c66.js.LICENSE.txt +16 -0
  27. package/dist/multi/manifest.json +26 -0
  28. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  29. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  30. package/dist/multi/styles-d01d0c66.css +39 -0
  31. package/dist/single/app-6596cb08.js +2 -0
  32. package/dist/single/app-6596cb08.js.LICENSE.txt +16 -0
  33. package/dist/single/manifest.json +3 -0
  34. package/package.json +107 -0
  35. package/postcss.config.js +5 -0
  36. package/src/assets/scss/_common.scss +143 -0
  37. package/src/assets/scss/day.scss +51 -0
  38. package/src/assets/scss/fonts.scss +3 -0
  39. package/src/assets/scss/index.scss +7 -0
  40. package/src/assets/scss/night.scss +61 -0
  41. package/src/assets/scss/palette.scss +393 -0
  42. package/src/assets/scss/theme.scss +119 -0
  43. package/src/assets/scss/vars.scss +9 -0
  44. package/src/assets/svg/line-alerts-alert-circle.svg +12 -0
  45. package/src/assets/svg/line-general-eye.svg +7 -0
  46. package/src/assets/svg/line-icon-bomb-2.svg +12 -0
  47. package/src/components/ArrowButton/index.tsx +36 -0
  48. package/src/components/ArrowButton/styles.scss +35 -0
  49. package/src/components/BaseLayout/index.tsx +43 -0
  50. package/src/components/BaseLayout/styles.scss +60 -0
  51. package/src/components/Footer/FooterLogo.tsx +16 -0
  52. package/src/components/Footer/FooterVersion.tsx +37 -0
  53. package/src/components/Footer/index.tsx +13 -0
  54. package/src/components/Footer/styles.scss +14 -0
  55. package/src/components/Header/index.tsx +28 -0
  56. package/src/components/Header/styles.scss +33 -0
  57. package/src/components/LanguagePicker/index.tsx +40 -0
  58. package/src/components/MainReport/index.tsx +21 -0
  59. package/src/components/MainReport/styles.scss +11 -0
  60. package/src/components/Metadata/index.tsx +121 -0
  61. package/src/components/Metadata/styles.scss +146 -0
  62. package/src/components/MetadataButton/index.tsx +32 -0
  63. package/src/components/MetadataButton/styles.scss +53 -0
  64. package/src/components/Modal/index.tsx +22 -0
  65. package/src/components/ReportBody/Filters.tsx +90 -0
  66. package/src/components/ReportBody/HeaderActions.tsx +21 -0
  67. package/src/components/ReportBody/SortBy.tsx +132 -0
  68. package/src/components/ReportBody/context.tsx +106 -0
  69. package/src/components/ReportBody/index.tsx +72 -0
  70. package/src/components/ReportBody/styles.scss +69 -0
  71. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  72. package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
  73. package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
  74. package/src/components/ReportHeader/index.tsx +33 -0
  75. package/src/components/ReportHeader/styles.scss +51 -0
  76. package/src/components/ReportLogo/index.tsx +16 -0
  77. package/src/components/ReportLogo/styles.scss +20 -0
  78. package/src/components/ReportLogoFull/index.tsx +20 -0
  79. package/src/components/ReportLogoFull/styles.scss +7 -0
  80. package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
  81. package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
  82. package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
  83. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  84. package/src/components/ReportMetadata/index.tsx +46 -0
  85. package/src/components/ReportMetadata/styles.scss +99 -0
  86. package/src/components/SideBySide/index.tsx +52 -0
  87. package/src/components/SideBySide/styles.scss +65 -0
  88. package/src/components/SplitLayout/index.tsx +77 -0
  89. package/src/components/SplitLayout/styles.scss +85 -0
  90. package/src/components/Tabs/index.tsx +62 -0
  91. package/src/components/Tabs/styles.scss +56 -0
  92. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  93. package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  94. package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
  95. package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
  96. package/src/components/TestResult/TestResultDropdown/index.tsx +26 -0
  97. package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
  98. package/src/components/TestResult/TestResultEmpty/index.tsx +34 -0
  99. package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
  100. package/src/components/TestResult/TestResultHeader/TestResultBreadcrumbs.tsx +44 -0
  101. package/src/components/TestResult/TestResultHeader/index.tsx +21 -0
  102. package/src/components/TestResult/TestResultHeader/styles.scss +48 -0
  103. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +66 -0
  104. package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
  105. package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
  106. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
  107. package/src/components/TestResult/TestResultInfo/index.tsx +81 -0
  108. package/src/components/TestResult/TestResultInfo/styles.scss +68 -0
  109. package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
  110. package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
  111. package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
  112. package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
  113. package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
  114. package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
  115. package/src/components/TestResult/TestResultOverview.tsx +43 -0
  116. package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
  117. package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
  118. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
  119. package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  120. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +51 -0
  121. package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
  122. package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
  123. package/src/components/TestResult/TestResultSetup/index.tsx +58 -0
  124. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  125. package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
  126. package/src/components/TestResult/TestResultStatus/index.tsx +25 -0
  127. package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
  128. package/src/components/TestResult/TestResultSteps/index.tsx +58 -0
  129. package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
  130. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +76 -0
  131. package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
  132. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +84 -0
  133. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  134. package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  135. package/src/components/TestResult/TestResultTabs/index.tsx +68 -0
  136. package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
  137. package/src/components/TestResult/TestResultTeardown/index.tsx +59 -0
  138. package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
  139. package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
  140. package/src/components/TestResult/TrError/TrDiff.tsx +124 -0
  141. package/src/components/TestResult/TrError/index.tsx +78 -0
  142. package/src/components/TestResult/TrError/styles.scss +133 -0
  143. package/src/components/TestResult/index.tsx +62 -0
  144. package/src/components/TestResult/styles.scss +11 -0
  145. package/src/components/ThemeButton/ThemeButton.tsx +20 -0
  146. package/src/components/ToggleLayout/index.tsx +17 -0
  147. package/src/components/Tree/index.tsx +75 -0
  148. package/src/components/Tree/styles.scss +189 -0
  149. package/src/i18n/constants.ts +124 -0
  150. package/src/i18n/locales/am.json +133 -0
  151. package/src/i18n/locales/az.json +133 -0
  152. package/src/i18n/locales/de.json +133 -0
  153. package/src/i18n/locales/en.json +134 -0
  154. package/src/i18n/locales/es.json +133 -0
  155. package/src/i18n/locales/fr.json +133 -0
  156. package/src/i18n/locales/he.json +133 -0
  157. package/src/i18n/locales/it.json +133 -0
  158. package/src/i18n/locales/ja.json +133 -0
  159. package/src/i18n/locales/ka.json +133 -0
  160. package/src/i18n/locales/kr.json +133 -0
  161. package/src/i18n/locales/nl.json +133 -0
  162. package/src/i18n/locales/pl.json +131 -0
  163. package/src/i18n/locales/pt.json +133 -0
  164. package/src/i18n/locales/ru.json +131 -0
  165. package/src/i18n/locales/sv.json +133 -0
  166. package/src/i18n/locales/tr.json +133 -0
  167. package/src/i18n/locales/zh.json +133 -0
  168. package/src/index.html +40 -0
  169. package/src/index.tsx +96 -0
  170. package/src/stores/chart.ts +32 -0
  171. package/src/stores/envInfo.ts +34 -0
  172. package/src/stores/index.ts +4 -0
  173. package/src/stores/layout.ts +36 -0
  174. package/src/stores/locale.ts +75 -0
  175. package/src/stores/modal.ts +22 -0
  176. package/src/stores/router.ts +48 -0
  177. package/src/stores/stats.ts +36 -0
  178. package/src/stores/testResults.ts +66 -0
  179. package/src/stores/theme.ts +32 -0
  180. package/src/stores/tree.ts +157 -0
  181. package/src/stores/types.ts +5 -0
  182. package/src/styles.scss +45 -0
  183. package/src/types/globals.d.ts +13 -0
  184. package/src/types/window.d.ts +8 -0
  185. package/src/utils/capitalize.ts +6 -0
  186. package/src/utils/copyToClipboard.ts +16 -0
  187. package/src/utils/isMac.ts +8 -0
  188. package/src/utils/loadFromLocalStorage.ts +8 -0
  189. package/src/utils/statuses.ts +55 -0
  190. package/src/utils/time.ts +17 -0
  191. package/src/utils/treeFilters.ts +147 -0
  192. package/test/utils/treeFilters.test.ts +448 -0
  193. package/tsconfig.json +27 -0
  194. package/types.d.ts +99 -0
  195. package/vitest.config.ts +18 -0
  196. 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
+ }
@@ -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
+ };