@allurereport/plugin-dashboard 3.0.0-beta.13 → 3.0.0-beta.15

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/README.md CHANGED
@@ -66,7 +66,7 @@ Trend charts allow you to track metrics over time. Available configurations:
66
66
  type: "trend",
67
67
  dataType: "status",
68
68
  mode: "percent", // optional, default: "raw"
69
- limit: 10, // optional: limit number of builds
69
+ limit: 10, // optional: limit number of builds, default: 10
70
70
  title: "Custom Status Trend", // optional
71
71
  metadata: { // optional
72
72
  executionIdAccessor: (executionOrder) => `build-${executionOrder}`,
@@ -1,4 +1,4 @@
1
- import { createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, } from "@allurereport/web-commons";
1
+ import { createBaseUrlScript, createFontLinkTag, createReportDataScript, createScriptTag, createStylesLinkTag, DEFAULT_CHART_HISTORY_LIMIT, } from "@allurereport/web-commons";
2
2
  import { randomUUID } from "crypto";
3
3
  import Handlebars from "handlebars";
4
4
  import { readFile } from "node:fs/promises";
@@ -51,13 +51,14 @@ export const readTemplateManifest = async (singleFileMode) => {
51
51
  return JSON.parse(templateManifest);
52
52
  };
53
53
  const generateTrendChart = (options, stores, context) => {
54
- const { dataType } = options;
54
+ const newOptions = { limit: DEFAULT_CHART_HISTORY_LIMIT, ...options };
55
+ const { dataType } = newOptions;
55
56
  const { statistic, historyDataPoints, testResults } = stores;
56
57
  if (dataType === ChartData.Status) {
57
- return getStatusTrendData(statistic, context.reportName, historyDataPoints, options);
58
+ return getStatusTrendData(statistic, context.reportName, historyDataPoints, newOptions);
58
59
  }
59
60
  else if (dataType === ChartData.Severity) {
60
- return getSeverityTrendData(testResults, context.reportName, historyDataPoints, options);
61
+ return getSeverityTrendData(testResults, context.reportName, historyDataPoints, newOptions);
61
62
  }
62
63
  };
63
64
  const generatePieChart = (options, stores) => {
package/dist/plugin.js CHANGED
@@ -54,11 +54,14 @@ export class DashboardPlugin {
54
54
  const allTrs = (await store.allTestResults()).filter(this.options.filter ? this.options.filter : () => true);
55
55
  const duration = allTrs.reduce((acc, { duration: trDuration = 0 }) => acc + trDuration, 0);
56
56
  const worstStatus = getWorstStatus(allTrs.map(({ status }) => status));
57
+ const createdAt = allTrs.reduce((acc, { stop }) => Math.max(acc, stop || 0), 0);
57
58
  return {
58
59
  name: this.options.reportName || context.reportName,
59
60
  stats: await store.testsStatistic(this.options.filter),
60
61
  status: worstStatus ?? "passed",
61
62
  duration,
63
+ createdAt,
64
+ plugin: "Dashboard",
62
65
  };
63
66
  }
64
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/plugin-dashboard",
3
- "version": "3.0.0-beta.13",
3
+ "version": "3.0.0-beta.15",
4
4
  "description": "Allure Dashboard Plugin – plugin for generating dashboard with a mix of charts",
5
5
  "keywords": [
6
6
  "allure",
@@ -32,10 +32,10 @@
32
32
  "test": "rimraf ./out && vitest run"
33
33
  },
34
34
  "dependencies": {
35
- "@allurereport/core-api": "3.0.0-beta.13",
36
- "@allurereport/plugin-api": "3.0.0-beta.13",
37
- "@allurereport/web-commons": "3.0.0-beta.13",
38
- "@allurereport/web-dashboard": "3.0.0-beta.13",
35
+ "@allurereport/core-api": "3.0.0-beta.15",
36
+ "@allurereport/plugin-api": "3.0.0-beta.15",
37
+ "@allurereport/web-commons": "3.0.0-beta.15",
38
+ "@allurereport/web-dashboard": "3.0.0-beta.15",
39
39
  "d3-shape": "^3.2.0",
40
40
  "handlebars": "^4.7.8"
41
41
  },