@allurereport/core-api 3.0.0-beta.11 → 3.0.0-beta.13

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.
@@ -5,4 +5,6 @@ export type Statistic = {
5
5
  skipped?: number;
6
6
  unknown?: number;
7
7
  total: number;
8
+ retries?: number;
9
+ flaky?: number;
8
10
  };
@@ -1,6 +1,8 @@
1
1
  import type { Statistic } from "./aggregate.js";
2
- import type { TestStatus } from "./model.js";
3
- export declare const statusesList: TestStatus[];
2
+ import type { SeverityLevel, TestStatus } from "./model.js";
3
+ export declare const statusesList: readonly TestStatus[];
4
+ export declare const severityLevels: readonly SeverityLevel[];
5
+ export declare const severityLabelName = "severity";
4
6
  export declare const unsuccessfulStatuses: Set<TestStatus>;
5
7
  export declare const successfulStatuses: Set<TestStatus>;
6
8
  export declare const includedInSuccessRate: Set<TestStatus>;
package/dist/constants.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export const statusesList = ["failed", "broken", "passed", "skipped", "unknown"];
2
+ export const severityLevels = ["blocker", "critical", "normal", "minor", "trivial"];
3
+ export const severityLabelName = "severity";
2
4
  export const unsuccessfulStatuses = new Set(["failed", "broken"]);
3
5
  export const successfulStatuses = new Set(["passed"]);
4
6
  export const includedInSuccessRate = new Set([...unsuccessfulStatuses, ...successfulStatuses]);
package/dist/history.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { TestLabel } from "./metadata.js";
1
2
  import type { TestError, TestStatus } from "./model.js";
2
3
  export interface HistoryTestResult {
3
4
  id: string;
@@ -8,6 +9,7 @@ export interface HistoryTestResult {
8
9
  start?: number;
9
10
  stop?: number;
10
11
  duration?: number;
12
+ labels?: TestLabel[];
11
13
  }
12
14
  export interface HistoryDataPoint {
13
15
  uuid: string;
package/dist/model.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { TestLabel, TestLink, TestParameter } from "./metadata.js";
2
2
  import type { TestCase } from "./testCase.js";
3
3
  export type TestStatus = "failed" | "broken" | "passed" | "skipped" | "unknown";
4
+ export type SeverityLevel = "blocker" | "critical" | "normal" | "minor" | "trivial";
4
5
  export interface SourceMetadata {
5
6
  readerId: string;
6
7
  metadata: {
@@ -78,6 +79,9 @@ export interface DefaultTestStepResult {
78
79
  steps: TestStepResult[];
79
80
  stepId?: string;
80
81
  type: "step";
82
+ message?: string;
83
+ trace?: string;
84
+ hasSimilarErrorInSubSteps?: boolean;
81
85
  }
82
86
  export interface AttachmentLinkFile {
83
87
  id: string;
@@ -1,3 +1,5 @@
1
1
  import type { EnvironmentsConfig } from "../environment.js";
2
- import type { TestResult } from "../model.js";
2
+ import type { TestEnvGroup, TestResult } from "../model.js";
3
+ export declare const DEFAULT_ENVIRONMENT = "default";
3
4
  export declare const matchEnvironment: (envConfig: EnvironmentsConfig, tr: TestResult) => string;
5
+ export declare const getRealEnvsCount: (group: TestEnvGroup) => number;
@@ -1,3 +1,12 @@
1
+ export const DEFAULT_ENVIRONMENT = "default";
1
2
  export const matchEnvironment = (envConfig, tr) => {
2
- return Object.entries(envConfig).find(([, { matcher }]) => matcher({ labels: tr.labels }))?.[0] ?? "default";
3
+ return (Object.entries(envConfig).find(([, { matcher }]) => matcher({ labels: tr.labels }))?.[0] ?? DEFAULT_ENVIRONMENT);
4
+ };
5
+ export const getRealEnvsCount = (group) => {
6
+ const { testResultsByEnv = {} } = group ?? {};
7
+ const envsCount = Object.keys(testResultsByEnv).length ?? 0;
8
+ if (envsCount <= 1 && DEFAULT_ENVIRONMENT in testResultsByEnv) {
9
+ return 0;
10
+ }
11
+ return envsCount;
3
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/core-api",
3
- "version": "3.0.0-beta.11",
3
+ "version": "3.0.0-beta.13",
4
4
  "description": "Allure Core API",
5
5
  "keywords": [
6
6
  "allure"