@allurereport/web-summary 3.0.0-beta.16 → 3.0.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Prism: Lightweight, robust, elegant syntax highlighting
3
+ *
4
+ * @license MIT <https://opensource.org/licenses/MIT>
5
+ * @author Lea Verou <https://lea.verou.me>
6
+ * @namespace
7
+ * @public
8
+ */
@@ -1,3 +1,3 @@
1
1
  {
2
- "main.js": "app-b6e0bd53352fd2fa88a3.js"
2
+ "main.js": "app-e9de039e5780204bcbb8.js"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/web-summary",
3
- "version": "3.0.0-beta.16",
3
+ "version": "3.0.0-beta.18",
4
4
  "description": "The static files for Allure Report Summary",
5
5
  "keywords": [
6
6
  "allure",
@@ -27,9 +27,9 @@
27
27
  "IE 11"
28
28
  ],
29
29
  "dependencies": {
30
- "@allurereport/core-api": "3.0.0-beta.16",
31
- "@allurereport/web-commons": "3.0.0-beta.16",
32
- "@allurereport/web-components": "3.0.0-beta.16",
30
+ "@allurereport/core-api": "3.0.0-beta.18",
31
+ "@allurereport/web-commons": "3.0.0-beta.18",
32
+ "@allurereport/web-components": "3.0.0-beta.18",
33
33
  "@preact/signals": "^1.3.0",
34
34
  "clsx": "^2.1.1",
35
35
  "i18next": "^24.0.2",
@@ -72,7 +72,7 @@
72
72
  "html-webpack-plugin": "^5.6.3",
73
73
  "mini-css-extract-plugin": "^2.9.1",
74
74
  "npm-run-all2": "^7.0.1",
75
- "postcss": "^8.5.0",
75
+ "postcss": "^8.5.6",
76
76
  "rimraf": "^6.0.1",
77
77
  "sass": "^1.79.1",
78
78
  "sass-loader": "^16.0.1",
@@ -82,7 +82,7 @@
82
82
  "typescript-eslint": "^8.6.0",
83
83
  "webpack": "^5.99.9",
84
84
  "webpack-cli": "^5.1.4",
85
- "webpack-dev-server": "^5.2.1",
85
+ "webpack-dev-server": "^5.2.2",
86
86
  "webpack-manifest-plugin": "^5.0.0"
87
87
  }
88
88
  }
@@ -0,0 +1,37 @@
1
+ import { SvgIcon, Text, TooltipWrapper } from "@allurereport/web-components";
2
+ import cx from "clsx";
3
+ import type { FunctionalComponent } from "preact";
4
+ import * as styles from "./styles.scss";
5
+
6
+ export type IconLabelProps = {
7
+ icon: string;
8
+ tooltip?: string;
9
+ className?: string;
10
+ };
11
+
12
+ export const IconLabel: FunctionalComponent<IconLabelProps> = ({ icon, children, tooltip, className, ...rest }) => {
13
+ const content = (
14
+ <div className={cx(styles["icon-label-wrapper"], className)}>
15
+ <SvgIcon className={styles["icon-label-icon"]} id={icon} />
16
+ <Text className={styles["icon-label-text"]} type="ui" size="s" bold>
17
+ {children}
18
+ </Text>
19
+ </div>
20
+ );
21
+
22
+ if (tooltip) {
23
+ return (
24
+ <div className={styles["icon-label"]} {...rest}>
25
+ <TooltipWrapper tooltipText={tooltip}>{content}</TooltipWrapper>
26
+ </div>
27
+ );
28
+ }
29
+
30
+ return (
31
+ <div className={styles["icon-label"]} {...rest}>
32
+ {content}
33
+ </div>
34
+ );
35
+ };
36
+
37
+ export default IconLabel;
@@ -0,0 +1,17 @@
1
+ .icon-label {
2
+ display: inline-block;
3
+ }
4
+
5
+ .icon-label-wrapper {
6
+ display: flex;
7
+ align-items: center;
8
+ gap: 6px;
9
+ }
10
+
11
+ .icon-label-icon {
12
+ color: var(--on-icon-secondary);
13
+ }
14
+
15
+ .icon-label-text {
16
+ color: var(--on-text-secondary);
17
+ }
@@ -1,7 +1,8 @@
1
- import { type Statistic, type TestStatus, formatDuration } from "@allurereport/core-api";
1
+ import { type Statistic, type TestStatus, formatDuration, getPieChartValues } from "@allurereport/core-api";
2
2
  import { capitalize } from "@allurereport/web-commons";
3
- import { Heading, StatusLabel, SuccessRatePieChart, Text, getChartData } from "@allurereport/web-components";
3
+ import { Heading, StatusLabel, SuccessRatePieChart, Text, allureIcons } from "@allurereport/web-components";
4
4
  import type { FunctionalComponent } from "preact";
5
+ import IconLabel from "@/components/IconLabel";
5
6
  import type { MetadataProps } from "@/components/MetadataRow/MetadataItem";
6
7
  import MetadataItem, { MetadataTestType } from "@/components/MetadataRow/MetadataItem";
7
8
  import { currentLocaleIso, useI18n } from "@/stores";
@@ -12,6 +13,10 @@ export type ReportCardProps = {
12
13
  name: string;
13
14
  status: TestStatus;
14
15
  stats: Statistic;
16
+ // TODO: use SummaryTestResult in the package
17
+ newTests: any[];
18
+ retryTests: any[];
19
+ flakyTests: any[];
15
20
  duration: number;
16
21
  plugin?: string;
17
22
  createdAt?: number;
@@ -25,9 +30,12 @@ export const ReportCard: FunctionalComponent<ReportCardProps> = ({
25
30
  duration,
26
31
  plugin,
27
32
  createdAt,
33
+ newTests,
34
+ flakyTests,
35
+ retryTests,
28
36
  }) => {
29
37
  const { t } = useI18n("summary");
30
- const { percentage, slices } = getChartData(stats);
38
+ const { percentage, slices } = getPieChartValues(stats);
31
39
  const formattedDuration = formatDuration(duration);
32
40
  const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
33
41
  month: "long",
@@ -46,7 +54,7 @@ export const ReportCard: FunctionalComponent<ReportCardProps> = ({
46
54
  target={"_blank"}
47
55
  rel="noreferrer"
48
56
  >
49
- <div className={styles["report-card-content"]}>
57
+ <div>
50
58
  {plugin && (
51
59
  <Text type={"ui"} tag={"div"} size={"s"} className={styles["report-card-plugin"]}>
52
60
  {plugin}
@@ -71,6 +79,17 @@ export const ReportCard: FunctionalComponent<ReportCardProps> = ({
71
79
  {formattedDuration}
72
80
  </Text>
73
81
  </div>
82
+ <div className={styles["report-card-metadata-icons"]}>
83
+ <IconLabel tooltip={capitalize(t("new"))} icon={allureIcons.testNew}>
84
+ {newTests?.length ?? 0}
85
+ </IconLabel>
86
+ <IconLabel tooltip={capitalize(t("flaky"))} icon={allureIcons.lineIconBomb2}>
87
+ {flakyTests?.length ?? 0}
88
+ </IconLabel>
89
+ <IconLabel tooltip={capitalize(t("retry"))} icon={allureIcons.lineGeneralZap}>
90
+ {retryTests?.length ?? 0}
91
+ </IconLabel>
92
+ </div>
74
93
  <div className={styles["report-card-metadata"]}>
75
94
  {[
76
95
  { label: "total", value: stats?.total },
@@ -55,3 +55,10 @@
55
55
  display: flex;
56
56
  gap: 12px;
57
57
  }
58
+
59
+ .report-card-metadata-icons {
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 12px;
63
+ margin-bottom: 8px;
64
+ }
@@ -6,7 +6,10 @@
6
6
  "skipped": "keçildi",
7
7
  "unknown": "naməlum",
8
8
  "total": "cəmi",
9
- "in": "içində"
9
+ "in": "içində",
10
+ "new": "yeni testlər",
11
+ "flaky": "qeyri-sabit testlər",
12
+ "retry": "təkrar testlər"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Hesabat tapılmadı"
@@ -6,7 +6,10 @@
6
6
  "skipped": "übersprungen",
7
7
  "unknown": "unbekannt",
8
8
  "total": "gesamt",
9
- "in": "in"
9
+ "in": "in",
10
+ "new": "neue Tests",
11
+ "flaky": "instabile Tests",
12
+ "retry": "wiederholte Tests"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Keine Berichte gefunden"
@@ -6,7 +6,10 @@
6
6
  "skipped": "skipped",
7
7
  "unknown": "unknown",
8
8
  "total": "total",
9
- "in": "in"
9
+ "in": "in",
10
+ "new": "new tests",
11
+ "flaky": "flaky tests",
12
+ "retry": "retry tests"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "No reports found"
@@ -6,7 +6,10 @@
6
6
  "skipped": "omitido",
7
7
  "unknown": "desconocido",
8
8
  "total": "total",
9
- "in": "en"
9
+ "in": "en",
10
+ "new": "nuevos tests",
11
+ "flaky": "tests inestables",
12
+ "retry": "tests repetidos"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "No se encontraron informes"
@@ -6,7 +6,10 @@
6
6
  "skipped": "ignoré",
7
7
  "unknown": "inconnu",
8
8
  "total": "total",
9
- "in": "dans"
9
+ "in": "dans",
10
+ "new": "nouveaux tests",
11
+ "flaky": "tests instables",
12
+ "retry": "tests répétés"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Aucun rapport trouvé"
@@ -6,7 +6,10 @@
6
6
  "skipped": "דלג",
7
7
  "unknown": "לא ידוע",
8
8
  "total": "סה\"כ",
9
- "in": "ב-"
9
+ "in": "ב-",
10
+ "new": "בדיקות חדשות",
11
+ "flaky": "בדיקות לא יציבות",
12
+ "retry": "בדיקות חוזרות"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "לא נמצאו דוחות"
@@ -5,7 +5,11 @@
5
5
  "broken": "կոտրված",
6
6
  "skipped": "բաց թողնված",
7
7
  "unknown": "անհայտ",
8
- "in": "մեջ"
8
+ "total": "ընդհանուր",
9
+ "in": "մեջ",
10
+ "new": "նոր թեստեր",
11
+ "flaky": "անկայուն թեստեր",
12
+ "retry": "կրկնվող թեստեր"
9
13
  },
10
14
  "empty": {
11
15
  "no-reports": "Ոչ մի հաշվետվություն չի գտնվել"
@@ -6,7 +6,10 @@
6
6
  "skipped": "saltato",
7
7
  "unknown": "sconosciuto",
8
8
  "total": "totale",
9
- "in": "in"
9
+ "in": "in",
10
+ "new": "nuovi test",
11
+ "flaky": "test instabili",
12
+ "retry": "test ripetuti"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Nessun report trovato"
@@ -6,7 +6,10 @@
6
6
  "skipped": "スキップ",
7
7
  "unknown": "不明",
8
8
  "total": "合計",
9
- "in": "中"
9
+ "in": "中",
10
+ "new": "新規テスト",
11
+ "flaky": "不安定テスト",
12
+ "retry": "再試行テスト"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "レポートが見つかりません"
@@ -6,7 +6,10 @@
6
6
  "skipped": "გამოტოვებული",
7
7
  "unknown": "უცნობი",
8
8
  "total": "ჯამი",
9
- "in": "ში"
9
+ "in": "ში",
10
+ "new": "ახალი ტესტები",
11
+ "flaky": "არასტაბილური ტესტები",
12
+ "retry": "განმეორებითი ტესტები"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "არ მოიძებნა არცერთი ანგარიში"
@@ -6,7 +6,10 @@
6
6
  "skipped": "건너뜀",
7
7
  "unknown": "알 수 없음",
8
8
  "total": "총계",
9
- "in": "중"
9
+ "in": "중",
10
+ "new": "새로운 테스트",
11
+ "flaky": "불안정한 테스트",
12
+ "retry": "재시도 테스트"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "보고서가 없습니다"
@@ -6,7 +6,10 @@
6
6
  "skipped": "overgeslagen",
7
7
  "unknown": "onbekend",
8
8
  "total": "totaal",
9
- "in": "in"
9
+ "in": "in",
10
+ "new": "nieuwe tests",
11
+ "flaky": "onstabiele tests",
12
+ "retry": "herhaalde tests"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Geen rapporten gevonden"
@@ -6,7 +6,10 @@
6
6
  "skipped": "pominięty",
7
7
  "unknown": "nieznany",
8
8
  "total": "wszystkie",
9
- "in": "za"
9
+ "in": "za",
10
+ "new": "nowe testy",
11
+ "flaky": "niestabilne testy",
12
+ "retry": "powtórzone testy"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Brak raportów"
@@ -6,7 +6,10 @@
6
6
  "skipped": "ignorado",
7
7
  "unknown": "desconhecido",
8
8
  "total": "total",
9
- "in": "em"
9
+ "in": "em",
10
+ "new": "novos testes",
11
+ "flaky": "testes instáveis",
12
+ "retry": "testes repetidos"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Nenhum relatório encontrado"
@@ -6,7 +6,10 @@
6
6
  "skipped": "пропущенный",
7
7
  "unknown": "неизвестный",
8
8
  "total": "все",
9
- "in": "за"
9
+ "in": "за",
10
+ "new": "новые тесты",
11
+ "flaky": "нестабильные тесты",
12
+ "retry": "повторные тесты"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Отчеты не найдены"
@@ -6,7 +6,10 @@
6
6
  "skipped": "hoppad över",
7
7
  "unknown": "okänd",
8
8
  "total": "totalt",
9
- "in": "i"
9
+ "in": "i",
10
+ "new": "nya tester",
11
+ "flaky": "instabila tester",
12
+ "retry": "upprepade tester"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Inga rapporter"
@@ -6,7 +6,10 @@
6
6
  "skipped": "atlandı",
7
7
  "unknown": "bilinmeyen",
8
8
  "total": "toplam",
9
- "in": "içinde"
9
+ "in": "içinde",
10
+ "new": "yeni testler",
11
+ "flaky": "kararsız testler",
12
+ "retry": "tekrar testleri"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "Rapor bulunamadı"
@@ -6,7 +6,10 @@
6
6
  "skipped": "跳过",
7
7
  "unknown": "未知",
8
8
  "total": "总计",
9
- "in": "在"
9
+ "in": "在",
10
+ "new": "新测试",
11
+ "flaky": "不稳定测试",
12
+ "retry": "重试测试"
10
13
  },
11
14
  "empty": {
12
15
  "no-reports": "未找到报告"
package/src/index.html CHANGED
@@ -35,6 +35,48 @@
35
35
  },
36
36
  duration: 1240812,
37
37
  status: "failed",
38
+ newTests: [
39
+ {
40
+ name: "New test 1",
41
+ id: "1",
42
+ status: "passed",
43
+ duration: 100
44
+ },
45
+ {
46
+ name: "New test 2",
47
+ id: "2",
48
+ status: "passed",
49
+ duration: 100
50
+ },
51
+ {
52
+ name: "New test 3",
53
+ id: "3",
54
+ status: "passed",
55
+ duration: 100
56
+ },
57
+ ],
58
+ flakyTests: [
59
+ {
60
+ name: "New test 1",
61
+ id: "1",
62
+ status: "passed",
63
+ duration: 100
64
+ },
65
+ ],
66
+ retryTests: [
67
+ {
68
+ name: "New test 1",
69
+ id: "1",
70
+ status: "passed",
71
+ duration: 100
72
+ },
73
+ {
74
+ name: "New test 2",
75
+ id: "2",
76
+ status: "passed",
77
+ duration: 100
78
+ },
79
+ ]
38
80
  },
39
81
  {
40
82
  name: "Second sample report with longer title",
@@ -45,6 +87,16 @@
45
87
  },
46
88
  duration: 31290,
47
89
  status: "passed",
90
+ newTests: [
91
+ {
92
+ name: "New test 1",
93
+ id: "1",
94
+ status: "failed",
95
+ duration: 100
96
+ },
97
+ ],
98
+ flakyTests: [],
99
+ retryTests: [],
48
100
  },
49
101
  {
50
102
  name: "Third report",
@@ -56,6 +108,9 @@
56
108
  },
57
109
  duration: 512341,
58
110
  status: "broken",
111
+ newTests: [],
112
+ flakyTests: [],
113
+ retryTests: [],
59
114
  },
60
115
  {
61
116
  name: "Fourth report",
@@ -68,6 +123,9 @@
68
123
  },
69
124
  duration: 12341,
70
125
  status: "broken",
126
+ newTests: [],
127
+ flakyTests: [],
128
+ retryTests: [],
71
129
  },
72
130
  {
73
131
  name: "Fifth report with a very long title that should not be truncated and should be displayed in full",
@@ -79,6 +137,22 @@
79
137
  },
80
138
  duration: 0,
81
139
  status: "unknown",
140
+ newTests: [
141
+ {
142
+ name: "New test 1",
143
+ id: "1",
144
+ status: "passed",
145
+ duration: 100
146
+ },
147
+ {
148
+ name: "New test 2",
149
+ id: "2",
150
+ status: "failed",
151
+ duration: 100
152
+ }
153
+ ],
154
+ flakyTests: [],
155
+ retryTests: [],
82
156
  },
83
157
  ]
84
158
  </script>