From e8570686148b10c2697eee566453fe9d53f1f8ca Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sat, 10 Oct 2026 08:38:07 +0100 Subject: [PATCH 1/4] Support final attempt identity in CTRF 0.2.0 --- README.md | 14 +- docs/classes/TestBuilder.md | 92 +-- docs/functions/hasInsights.md | 2 +- docs/functions/isAttemptHistoryEntry.md | 2 +- docs/functions/isCTRFReport.md | 2 +- docs/functions/isRetryAttempt.md | 2 +- docs/functions/isTest.md | 2 +- docs/functions/isTestStatus.md | 2 +- docs/functions/isValid.md | 2 +- docs/functions/validate.md | 2 +- docs/functions/validateStrict.md | 2 +- docs/interfaces/Attachment.md | 12 +- docs/interfaces/AttemptHistoryEntry.md | 30 +- docs/interfaces/Baseline.md | 18 +- docs/interfaces/Environment.md | 38 +- docs/interfaces/FilterCriteria.md | 22 +- docs/interfaces/Insights.md | 18 +- docs/interfaces/InsightsOptions.md | 6 +- docs/interfaces/MergeOptions.md | 8 +- docs/interfaces/MetricDelta.md | 8 +- docs/interfaces/ParseOptions.md | 4 +- docs/interfaces/ReportBuilderOptions.md | 6 +- docs/interfaces/Step.md | 8 +- docs/interfaces/StringifyOptions.md | 6 +- docs/interfaces/SummaryOptions.md | 6 +- docs/interfaces/Test.md | 70 ++- docs/interfaces/TestBuilderOptions.md | 4 +- docs/interfaces/TestInsights.md | 16 +- docs/interfaces/ValidateOptions.md | 4 +- docs/interfaces/ValidationErrorDetail.md | 8 +- docs/interfaces/ValidationResult.md | 6 +- docs/type-aliases/LabelPrimitive.md | 2 +- docs/type-aliases/LabelValue.md | 2 +- docs/type-aliases/RetryAttempt.md | 2 +- docs/type-aliases/SchemaSelector.md | 2 +- docs/type-aliases/SupportedSpecVersion.md | 2 +- docs/type-aliases/TestStatus.md | 2 +- docs/variables/CTRF_NAMESPACE.md | 2 +- docs/variables/CURRENT_SPEC_VERSION.md | 2 +- docs/variables/SUPPORTED_SPEC_VERSIONS.md | 2 +- package-lock.json | 10 +- package.json | 2 +- src/builder.test.ts | 12 + src/builder.ts | 14 + src/cli/types.ts | 2 + src/constants.test.ts | 3 +- src/constants.ts | 3 +- src/ctrf-schema-0.2.0.json | 718 ++++++++++++++++++++++ src/types.ts | 2 + src/validate.test.ts | 21 +- src/validate.ts | 3 +- 51 files changed, 1015 insertions(+), 215 deletions(-) create mode 100644 src/ctrf-schema-0.2.0.json diff --git a/README.md b/README.md index d0303d7..99c7110 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ const report = new ReportBuilder() const test = new TestBuilder() .testId('authentication/login') .executionId('execution-123') + .attemptId('attempt-1') .name('User login test') .status('passed') .duration(1500) @@ -141,10 +142,11 @@ of history entries. ```typescript const flakyTest = new TestBuilder() .name('eventually succeeds') + .attemptId('attempt-3') .status('passed') // Final attempt .duration(120) - .addAttemptHistoryEntry({ attempt: 1, status: 'failed', duration: 80 }) - .addAttemptHistoryEntry({ attempt: 2, status: 'failed', duration: 90 }) + .addAttemptHistoryEntry({ attempt: 1, attemptId: 'attempt-1', status: 'failed', duration: 80 }) + .addAttemptHistoryEntry({ attempt: 2, attemptId: 'attempt-2', status: 'failed', duration: 90 }) .flaky() .build() @@ -253,8 +255,8 @@ import { } from 'ctrf' REPORT_FORMAT // 'CTRF' -CURRENT_SPEC_VERSION // '0.1.0' -SUPPORTED_SPEC_VERSIONS // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0'] +CURRENT_SPEC_VERSION // '0.2.0' +SUPPORTED_SPEC_VERSIONS // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0'] TEST_STATUSES // ['passed', 'failed', 'skipped', 'pending', 'other'] CTRF_NAMESPACE // UUID namespace for deterministic IDs ``` @@ -294,6 +296,6 @@ const v0_0_2Schema = getSchema('0.0.2') const latestSchema = getSchema('latest') // Get version info -const version = getCurrentSpecVersion() // '0.1.0' -const supported = getSupportedSpecVersions() // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0'] +const version = getCurrentSpecVersion() // '0.2.0' +const supported = getSupportedSpecVersions() // ['0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.1.0', '0.2.0'] ``` diff --git a/docs/classes/TestBuilder.md b/docs/classes/TestBuilder.md index fc85409..0b727aa 100644 --- a/docs/classes/TestBuilder.md +++ b/docs/classes/TestBuilder.md @@ -25,7 +25,7 @@ const test = new TestBuilder() > **new TestBuilder**(`options?`): `TestBuilder` -Defined in: [builder.ts:300](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L300) +Defined in: [builder.ts:301](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L301) #### Parameters @@ -43,7 +43,7 @@ Defined in: [builder.ts:300](https://github.com/ctrf-io/ctrf-js/blob/main/src/bu > **id**(`uuid?`): `this` -Defined in: [builder.ts:306](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L306) +Defined in: [builder.ts:307](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L307) Set or generate the test ID. @@ -65,7 +65,7 @@ UUID to use, or undefined to auto-generate based on properties > **testId**(`id`): `this` -Defined in: [builder.ts:314](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L314) +Defined in: [builder.ts:315](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L315) Set the stable logical test case ID. @@ -85,7 +85,7 @@ Set the stable logical test case ID. > **executionId**(`id`): `this` -Defined in: [builder.ts:322](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L322) +Defined in: [builder.ts:323](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L323) Set the identifier for this specific test execution. @@ -101,11 +101,31 @@ Set the identifier for this specific test execution. *** +### attemptId() + +> **attemptId**(`id`): `this` + +Defined in: [builder.ts:331](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L331) + +Set the attempt ID. + +#### Parameters + +##### id + +`string` + +#### Returns + +`this` + +*** + ### name() > **name**(`name`): `this` -Defined in: [builder.ts:330](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L330) +Defined in: [builder.ts:342](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L342) Set the test name. @@ -125,7 +145,7 @@ Set the test name. > **status**(`status`): `this` -Defined in: [builder.ts:338](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L338) +Defined in: [builder.ts:350](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L350) Set the test status. @@ -145,7 +165,7 @@ Set the test status. > **duration**(`ms`): `this` -Defined in: [builder.ts:346](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L346) +Defined in: [builder.ts:358](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L358) Set the duration in milliseconds. @@ -165,7 +185,7 @@ Set the duration in milliseconds. > **start**(`timestamp`): `this` -Defined in: [builder.ts:354](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L354) +Defined in: [builder.ts:366](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L366) Set the start timestamp. @@ -185,7 +205,7 @@ Set the start timestamp. > **stop**(`timestamp`): `this` -Defined in: [builder.ts:362](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L362) +Defined in: [builder.ts:374](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L374) Set the stop timestamp. @@ -205,7 +225,7 @@ Set the stop timestamp. > **suite**(`suites`): `this` -Defined in: [builder.ts:370](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L370) +Defined in: [builder.ts:382](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L382) Set the suite hierarchy. @@ -225,7 +245,7 @@ Set the suite hierarchy. > **message**(`msg`): `this` -Defined in: [builder.ts:378](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L378) +Defined in: [builder.ts:390](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L390) Set the error message. @@ -245,7 +265,7 @@ Set the error message. > **trace**(`trace`): `this` -Defined in: [builder.ts:386](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L386) +Defined in: [builder.ts:398](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L398) Set the stack trace. @@ -265,7 +285,7 @@ Set the stack trace. > **snippet**(`code`): `this` -Defined in: [builder.ts:394](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L394) +Defined in: [builder.ts:406](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L406) Set the code snippet. @@ -285,7 +305,7 @@ Set the code snippet. > **ai**(`analysis`): `this` -Defined in: [builder.ts:402](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L402) +Defined in: [builder.ts:414](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L414) Set AI-generated analysis. @@ -305,7 +325,7 @@ Set AI-generated analysis. > **line**(`num`): `this` -Defined in: [builder.ts:410](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L410) +Defined in: [builder.ts:422](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L422) Set the line number. @@ -325,7 +345,7 @@ Set the line number. > **rawStatus**(`status`): `this` -Defined in: [builder.ts:418](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L418) +Defined in: [builder.ts:430](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L430) Set the raw status from the test framework. @@ -345,7 +365,7 @@ Set the raw status from the test framework. > **tags**(`tags`): `this` -Defined in: [builder.ts:426](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L426) +Defined in: [builder.ts:438](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L438) Set tags. @@ -365,7 +385,7 @@ Set tags. > **labels**(`labels`): `this` -Defined in: [builder.ts:434](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L434) +Defined in: [builder.ts:446](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L446) Set structured labels. @@ -385,7 +405,7 @@ Set structured labels. > **type**(`type`): `this` -Defined in: [builder.ts:442](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L442) +Defined in: [builder.ts:454](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L454) Set test type. @@ -405,7 +425,7 @@ Set test type. > **filePath**(`path`): `this` -Defined in: [builder.ts:450](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L450) +Defined in: [builder.ts:462](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L462) Set file path. @@ -425,7 +445,7 @@ Set file path. > **retries**(`count`): `this` -Defined in: [builder.ts:458](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L458) +Defined in: [builder.ts:470](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L470) Set the number of times the test was re-executed after its initial attempt. @@ -445,7 +465,7 @@ Set the number of times the test was re-executed after its initial attempt. > **addAttemptHistoryEntry**(`attempt`): `this` -Defined in: [builder.ts:470](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L470) +Defined in: [builder.ts:482](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L482) Add an attempt completed before the final attempt. @@ -469,7 +489,7 @@ number of history entries. > **addRetryAttempt**(`attempt`): `this` -Defined in: [builder.ts:483](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L483) +Defined in: [builder.ts:495](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L495) Backward-compatible alias for [addAttemptHistoryEntry](#addattempthistoryentry). @@ -493,7 +513,7 @@ Use `addAttemptHistoryEntry()`. > **flaky**(`isFlaky?`): `this` -Defined in: [builder.ts:490](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L490) +Defined in: [builder.ts:502](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L502) Mark as flaky. @@ -513,7 +533,7 @@ Mark as flaky. > **stdout**(`lines`): `this` -Defined in: [builder.ts:498](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L498) +Defined in: [builder.ts:510](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L510) Set stdout. @@ -533,7 +553,7 @@ Set stdout. > **stderr**(`lines`): `this` -Defined in: [builder.ts:506](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L506) +Defined in: [builder.ts:518](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L518) Set stderr. @@ -553,7 +573,7 @@ Set stderr. > **threadId**(`id`): `this` -Defined in: [builder.ts:514](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L514) +Defined in: [builder.ts:526](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L526) Set thread ID. @@ -573,7 +593,7 @@ Set thread ID. > **browser**(`name`): `this` -Defined in: [builder.ts:522](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L522) +Defined in: [builder.ts:534](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L534) Set browser name. @@ -593,7 +613,7 @@ Set browser name. > **device**(`name`): `this` -Defined in: [builder.ts:530](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L530) +Defined in: [builder.ts:542](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L542) Set device name. @@ -613,7 +633,7 @@ Set device name. > **screenshot**(`base64`): `this` -Defined in: [builder.ts:538](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L538) +Defined in: [builder.ts:550](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L550) Set screenshot (base64). @@ -633,7 +653,7 @@ Set screenshot (base64). > **addAttachment**(`attachment`): `this` -Defined in: [builder.ts:546](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L546) +Defined in: [builder.ts:558](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L558) Add an attachment. @@ -653,7 +673,7 @@ Add an attachment. > **parameters**(`params`): `this` -Defined in: [builder.ts:557](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L557) +Defined in: [builder.ts:569](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L569) Set parameters. @@ -673,7 +693,7 @@ Set parameters. > **addStep**(`step`): `this` -Defined in: [builder.ts:565](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L565) +Defined in: [builder.ts:577](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L577) Add a step. @@ -693,7 +713,7 @@ Add a step. > **insights**(`insights`): `this` -Defined in: [builder.ts:576](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L576) +Defined in: [builder.ts:588](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L588) Set test-level insights. @@ -713,7 +733,7 @@ Set test-level insights. > **extra**(`data`): `this` -Defined in: [builder.ts:584](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L584) +Defined in: [builder.ts:596](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L596) Set extra metadata. @@ -733,7 +753,7 @@ Set extra metadata. > **build**(): [`Test`](../interfaces/Test.md) -Defined in: [builder.ts:593](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L593) +Defined in: [builder.ts:605](https://github.com/ctrf-io/ctrf-js/blob/main/src/builder.ts#L605) Build and return the Test object. diff --git a/docs/functions/hasInsights.md b/docs/functions/hasInsights.md index 98b3ee8..1c9bdc6 100644 --- a/docs/functions/hasInsights.md +++ b/docs/functions/hasInsights.md @@ -8,7 +8,7 @@ > **hasInsights**(`report`): `boolean` -Defined in: [validate.ts:315](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L315) +Defined in: [validate.ts:316](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L316) ## Parameters diff --git a/docs/functions/isAttemptHistoryEntry.md b/docs/functions/isAttemptHistoryEntry.md index 6382c3b..f2136bc 100644 --- a/docs/functions/isAttemptHistoryEntry.md +++ b/docs/functions/isAttemptHistoryEntry.md @@ -8,7 +8,7 @@ > **isAttemptHistoryEntry**(`obj`): `obj is AttemptHistoryEntry` -Defined in: [validate.ts:285](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L285) +Defined in: [validate.ts:286](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L286) ## Parameters diff --git a/docs/functions/isCTRFReport.md b/docs/functions/isCTRFReport.md index 995d950..c40eea8 100644 --- a/docs/functions/isCTRFReport.md +++ b/docs/functions/isCTRFReport.md @@ -8,7 +8,7 @@ > **isCTRFReport**(`report`): `report is { reportFormat: "CTRF" }` -Defined in: [validate.ts:226](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L226) +Defined in: [validate.ts:227](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L227) ## Parameters diff --git a/docs/functions/isRetryAttempt.md b/docs/functions/isRetryAttempt.md index 96b0dee..b6c9783 100644 --- a/docs/functions/isRetryAttempt.md +++ b/docs/functions/isRetryAttempt.md @@ -8,7 +8,7 @@ > **isRetryAttempt**(`obj`): `obj is AttemptHistoryEntry` -Defined in: [validate.ts:303](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L303) +Defined in: [validate.ts:304](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L304) Backward-compatible alias for [isAttemptHistoryEntry](isAttemptHistoryEntry.md). diff --git a/docs/functions/isTest.md b/docs/functions/isTest.md index 34785a3..ad28e79 100644 --- a/docs/functions/isTest.md +++ b/docs/functions/isTest.md @@ -8,7 +8,7 @@ > **isTest**(`obj`): `obj is { name: string; status: string; duration: number }` -Defined in: [validate.ts:245](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L245) +Defined in: [validate.ts:246](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L246) ## Parameters diff --git a/docs/functions/isTestStatus.md b/docs/functions/isTestStatus.md index 4af21ca..55a8ce6 100644 --- a/docs/functions/isTestStatus.md +++ b/docs/functions/isTestStatus.md @@ -8,7 +8,7 @@ > **isTestStatus**(`value`): value is "skipped" \| "failed" \| "other" \| "pending" \| "passed" -Defined in: [validate.ts:268](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L268) +Defined in: [validate.ts:269](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L269) ## Parameters diff --git a/docs/functions/isValid.md b/docs/functions/isValid.md index ed0b329..c36c247 100644 --- a/docs/functions/isValid.md +++ b/docs/functions/isValid.md @@ -8,7 +8,7 @@ > **isValid**(`report`, `options?`): `report is CTRFReport` -Defined in: [validate.ts:164](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L164) +Defined in: [validate.ts:165](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L165) ## Parameters diff --git a/docs/functions/validate.md b/docs/functions/validate.md index 505c54e..24411ac 100644 --- a/docs/functions/validate.md +++ b/docs/functions/validate.md @@ -8,7 +8,7 @@ > **validate**(`report`, `options?`): [`ValidationResult`](../interfaces/ValidationResult.md) -Defined in: [validate.ts:110](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L110) +Defined in: [validate.ts:111](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L111) Validate a CTRF report against the JSON schema and normative cross-field rules that JSON Schema cannot express. diff --git a/docs/functions/validateStrict.md b/docs/functions/validateStrict.md index f68d7c8..efbfa34 100644 --- a/docs/functions/validateStrict.md +++ b/docs/functions/validateStrict.md @@ -8,7 +8,7 @@ > **validateStrict**(`report`, `options?`): `asserts report is CTRFReport` -Defined in: [validate.ts:193](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L193) +Defined in: [validate.ts:194](https://github.com/ctrf-io/ctrf-js/blob/main/src/validate.ts#L194) ## Parameters diff --git a/docs/interfaces/Attachment.md b/docs/interfaces/Attachment.md index 6a056f9..89aca1a 100644 --- a/docs/interfaces/Attachment.md +++ b/docs/interfaces/Attachment.md @@ -6,7 +6,7 @@ # Interface: Attachment -Defined in: [types.ts:244](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L244) +Defined in: [types.ts:246](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L246) File attachment @@ -16,7 +16,7 @@ File attachment > `optional` **attachmentId?**: `string` -Defined in: [types.ts:246](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L246) +Defined in: [types.ts:248](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L248) Identifier for this attachment reference instance @@ -26,7 +26,7 @@ Identifier for this attachment reference instance > **name**: `string` -Defined in: [types.ts:248](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L248) +Defined in: [types.ts:250](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L250) Attachment name @@ -36,7 +36,7 @@ Attachment name > **contentType**: `string` -Defined in: [types.ts:250](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L250) +Defined in: [types.ts:252](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L252) MIME content type @@ -46,7 +46,7 @@ MIME content type > **path**: `string` -Defined in: [types.ts:252](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L252) +Defined in: [types.ts:254](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L254) Path to the attachment file @@ -56,6 +56,6 @@ Path to the attachment file > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:254](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L254) +Defined in: [types.ts:256](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L256) Custom metadata diff --git a/docs/interfaces/AttemptHistoryEntry.md b/docs/interfaces/AttemptHistoryEntry.md index 8aea5d2..1c59afb 100644 --- a/docs/interfaces/AttemptHistoryEntry.md +++ b/docs/interfaces/AttemptHistoryEntry.md @@ -6,7 +6,7 @@ # Interface: AttemptHistoryEntry -Defined in: [types.ts:198](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L198) +Defined in: [types.ts:200](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L200) An attempt completed before the final attempt represented by the test object. Despite the `retryAttempts` field name, the history includes the initial @@ -18,7 +18,7 @@ attempt when a retry occurred and excludes the final attempt. > **attempt**: `number` -Defined in: [types.ts:200](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L200) +Defined in: [types.ts:202](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L202) Original sequence number for this attempt (1 = initial execution) @@ -28,7 +28,7 @@ Original sequence number for this attempt (1 = initial execution) > `optional` **attemptId?**: `string` -Defined in: [types.ts:202](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L202) +Defined in: [types.ts:204](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L204) Identifier for this individual attempt @@ -38,7 +38,7 @@ Identifier for this individual attempt > **status**: [`TestStatus`](../type-aliases/TestStatus.md) -Defined in: [types.ts:204](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L204) +Defined in: [types.ts:206](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L206) Status of this attempt @@ -48,7 +48,7 @@ Status of this attempt > `optional` **duration?**: `number` -Defined in: [types.ts:206](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L206) +Defined in: [types.ts:208](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L208) Duration of this attempt in milliseconds @@ -58,7 +58,7 @@ Duration of this attempt in milliseconds > `optional` **message?**: `string` -Defined in: [types.ts:208](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L208) +Defined in: [types.ts:210](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L210) Error message @@ -68,7 +68,7 @@ Error message > `optional` **trace?**: `string` -Defined in: [types.ts:210](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L210) +Defined in: [types.ts:212](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L212) Stack trace @@ -78,7 +78,7 @@ Stack trace > `optional` **line?**: `number` -Defined in: [types.ts:212](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L212) +Defined in: [types.ts:214](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L214) Line number @@ -88,7 +88,7 @@ Line number > `optional` **snippet?**: `string` -Defined in: [types.ts:214](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L214) +Defined in: [types.ts:216](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L216) Code snippet @@ -98,7 +98,7 @@ Code snippet > `optional` **stdout?**: `string`[] -Defined in: [types.ts:216](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L216) +Defined in: [types.ts:218](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L218) Standard output @@ -108,7 +108,7 @@ Standard output > `optional` **stderr?**: `string`[] -Defined in: [types.ts:218](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L218) +Defined in: [types.ts:220](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L220) Standard error @@ -118,7 +118,7 @@ Standard error > `optional` **start?**: `number` -Defined in: [types.ts:220](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L220) +Defined in: [types.ts:222](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L222) Start timestamp @@ -128,7 +128,7 @@ Start timestamp > `optional` **stop?**: `number` -Defined in: [types.ts:222](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L222) +Defined in: [types.ts:224](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L224) Stop timestamp @@ -138,7 +138,7 @@ Stop timestamp > `optional` **attachments?**: [`Attachment`](Attachment.md)[] -Defined in: [types.ts:224](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L224) +Defined in: [types.ts:226](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L226) Attachments for this attempt @@ -148,6 +148,6 @@ Attachments for this attempt > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:226](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L226) +Defined in: [types.ts:228](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L228) Custom metadata diff --git a/docs/interfaces/Baseline.md b/docs/interfaces/Baseline.md index 8ff4081..0361514 100644 --- a/docs/interfaces/Baseline.md +++ b/docs/interfaces/Baseline.md @@ -6,7 +6,7 @@ # Interface: Baseline -Defined in: [types.ts:384](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L384) +Defined in: [types.ts:386](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L386) Reference to a baseline report @@ -16,7 +16,7 @@ Reference to a baseline report > **reportId**: `string` -Defined in: [types.ts:386](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L386) +Defined in: [types.ts:388](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L388) Report ID of the baseline report @@ -26,7 +26,7 @@ Report ID of the baseline report > `optional` **timestamp?**: `string` -Defined in: [types.ts:388](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L388) +Defined in: [types.ts:390](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L390) Timestamp of the baseline report @@ -36,7 +36,7 @@ Timestamp of the baseline report > `optional` **source?**: `string` -Defined in: [types.ts:390](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L390) +Defined in: [types.ts:392](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L392) Source description (e.g., 'main-branch', 'previous-run') @@ -46,7 +46,7 @@ Source description (e.g., 'main-branch', 'previous-run') > `optional` **buildNumber?**: `number` -Defined in: [types.ts:392](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L392) +Defined in: [types.ts:394](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L394) Build number of the baseline @@ -56,7 +56,7 @@ Build number of the baseline > `optional` **buildName?**: `string` -Defined in: [types.ts:394](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L394) +Defined in: [types.ts:396](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L396) Build name of the baseline @@ -66,7 +66,7 @@ Build name of the baseline > `optional` **buildUrl?**: `string` -Defined in: [types.ts:396](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L396) +Defined in: [types.ts:398](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L398) Build URL of the baseline @@ -76,7 +76,7 @@ Build URL of the baseline > `optional` **commit?**: `string` -Defined in: [types.ts:398](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L398) +Defined in: [types.ts:400](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L400) Git commit of the baseline @@ -86,6 +86,6 @@ Git commit of the baseline > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:400](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L400) +Defined in: [types.ts:402](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L402) Custom metadata diff --git a/docs/interfaces/Environment.md b/docs/interfaces/Environment.md index 3491374..3ad5338 100644 --- a/docs/interfaces/Environment.md +++ b/docs/interfaces/Environment.md @@ -6,7 +6,7 @@ # Interface: Environment -Defined in: [types.ts:276](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L276) +Defined in: [types.ts:278](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L278) Environment information @@ -16,7 +16,7 @@ Environment information > `optional` **reportName?**: `string` -Defined in: [types.ts:278](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L278) +Defined in: [types.ts:280](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L280) Custom report name @@ -26,7 +26,7 @@ Custom report name > `optional` **appName?**: `string` -Defined in: [types.ts:280](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L280) +Defined in: [types.ts:282](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L282) Application name @@ -36,7 +36,7 @@ Application name > `optional` **appVersion?**: `string` -Defined in: [types.ts:282](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L282) +Defined in: [types.ts:284](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L284) Application version @@ -46,7 +46,7 @@ Application version > `optional` **buildId?**: `string` -Defined in: [types.ts:284](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L284) +Defined in: [types.ts:286](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L286) Build identifier @@ -56,7 +56,7 @@ Build identifier > `optional` **buildName?**: `string` -Defined in: [types.ts:286](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L286) +Defined in: [types.ts:288](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L288) Build name @@ -66,7 +66,7 @@ Build name > `optional` **buildNumber?**: `number` -Defined in: [types.ts:288](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L288) +Defined in: [types.ts:290](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L290) Build number @@ -76,7 +76,7 @@ Build number > `optional` **buildUrl?**: `string` -Defined in: [types.ts:290](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L290) +Defined in: [types.ts:292](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L292) Build URL @@ -86,7 +86,7 @@ Build URL > `optional` **repositoryName?**: `string` -Defined in: [types.ts:292](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L292) +Defined in: [types.ts:294](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L294) Repository name @@ -96,7 +96,7 @@ Repository name > `optional` **repositoryUrl?**: `string` -Defined in: [types.ts:294](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L294) +Defined in: [types.ts:296](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L296) Repository URL @@ -106,7 +106,7 @@ Repository URL > `optional` **commit?**: `string` -Defined in: [types.ts:296](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L296) +Defined in: [types.ts:298](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L298) Git commit SHA @@ -116,7 +116,7 @@ Git commit SHA > `optional` **branchName?**: `string` -Defined in: [types.ts:298](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L298) +Defined in: [types.ts:300](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L300) Git branch name @@ -126,7 +126,7 @@ Git branch name > `optional` **osPlatform?**: `string` -Defined in: [types.ts:300](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L300) +Defined in: [types.ts:302](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L302) Operating system platform @@ -136,7 +136,7 @@ Operating system platform > `optional` **osRelease?**: `string` -Defined in: [types.ts:302](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L302) +Defined in: [types.ts:304](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L304) Operating system release @@ -146,7 +146,7 @@ Operating system release > `optional` **osVersion?**: `string` -Defined in: [types.ts:304](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L304) +Defined in: [types.ts:306](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L306) Operating system version @@ -156,7 +156,7 @@ Operating system version > `optional` **testEnvironment?**: `string` -Defined in: [types.ts:306](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L306) +Defined in: [types.ts:308](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L308) Test environment name @@ -166,7 +166,7 @@ Test environment name > `optional` **shardId?**: `string` -Defined in: [types.ts:308](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L308) +Defined in: [types.ts:310](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L310) Shard or partition that produced this document @@ -176,7 +176,7 @@ Shard or partition that produced this document > `optional` **healthy?**: `boolean` -Defined in: [types.ts:310](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L310) +Defined in: [types.ts:312](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L312) Whether the environment is healthy @@ -186,6 +186,6 @@ Whether the environment is healthy > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:312](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L312) +Defined in: [types.ts:314](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L314) Custom metadata diff --git a/docs/interfaces/FilterCriteria.md b/docs/interfaces/FilterCriteria.md index 75950dc..a874b72 100644 --- a/docs/interfaces/FilterCriteria.md +++ b/docs/interfaces/FilterCriteria.md @@ -6,7 +6,7 @@ # Interface: FilterCriteria -Defined in: [types.ts:452](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L452) +Defined in: [types.ts:454](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L454) Criteria for filtering and finding tests. @@ -16,7 +16,7 @@ Criteria for filtering and finding tests. > `optional` **id?**: `string` -Defined in: [types.ts:454](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L454) +Defined in: [types.ts:456](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L456) Filter by legacy test ID (UUID) @@ -26,7 +26,7 @@ Filter by legacy test ID (UUID) > `optional` **testId?**: `string` -Defined in: [types.ts:456](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L456) +Defined in: [types.ts:458](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L458) Filter by stable logical test case ID @@ -36,7 +36,7 @@ Filter by stable logical test case ID > `optional` **executionId?**: `string` -Defined in: [types.ts:458](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L458) +Defined in: [types.ts:460](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L460) Filter by a specific test execution ID @@ -46,7 +46,7 @@ Filter by a specific test execution ID > `optional` **name?**: `string` -Defined in: [types.ts:460](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L460) +Defined in: [types.ts:462](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L462) Filter by test name @@ -56,7 +56,7 @@ Filter by test name > `optional` **status?**: [`TestStatus`](../type-aliases/TestStatus.md) \| [`TestStatus`](../type-aliases/TestStatus.md)[] -Defined in: [types.ts:462](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L462) +Defined in: [types.ts:464](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L464) Filter by status @@ -66,7 +66,7 @@ Filter by status > `optional` **tags?**: `string` \| `string`[] -Defined in: [types.ts:464](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L464) +Defined in: [types.ts:466](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L466) Filter by tags @@ -76,7 +76,7 @@ Filter by tags > `optional` **suite?**: `string` \| `string`[] -Defined in: [types.ts:466](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L466) +Defined in: [types.ts:468](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L468) Filter by suite @@ -86,7 +86,7 @@ Filter by suite > `optional` **flaky?**: `boolean` -Defined in: [types.ts:468](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L468) +Defined in: [types.ts:470](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L470) Filter by flaky flag @@ -96,7 +96,7 @@ Filter by flaky flag > `optional` **browser?**: `string` -Defined in: [types.ts:470](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L470) +Defined in: [types.ts:472](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L472) Filter by browser @@ -106,6 +106,6 @@ Filter by browser > `optional` **device?**: `string` -Defined in: [types.ts:472](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L472) +Defined in: [types.ts:474](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L474) Filter by device diff --git a/docs/interfaces/Insights.md b/docs/interfaces/Insights.md index da6f07e..411b4f8 100644 --- a/docs/interfaces/Insights.md +++ b/docs/interfaces/Insights.md @@ -6,7 +6,7 @@ # Interface: Insights -Defined in: [types.ts:324](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L324) +Defined in: [types.ts:326](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L326) Run-level insights computed from historical data @@ -16,7 +16,7 @@ Run-level insights computed from historical data > `optional` **passRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:326](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L326) +Defined in: [types.ts:328](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L328) Pass rate metric @@ -26,7 +26,7 @@ Pass rate metric > `optional` **failRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:328](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L328) +Defined in: [types.ts:330](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L330) Fail rate metric @@ -36,7 +36,7 @@ Fail rate metric > `optional` **flakyRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:330](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L330) +Defined in: [types.ts:332](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L332) Flaky rate metric @@ -46,7 +46,7 @@ Flaky rate metric > `optional` **averageRunDuration?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:332](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L332) +Defined in: [types.ts:334](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L334) Average run duration metric @@ -56,7 +56,7 @@ Average run duration metric > `optional` **p95RunDuration?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:334](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L334) +Defined in: [types.ts:336](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L336) 95th percentile run duration metric @@ -66,7 +66,7 @@ Defined in: [types.ts:334](https://github.com/ctrf-io/ctrf-js/blob/main/src/type > `optional` **averageTestDuration?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:336](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L336) +Defined in: [types.ts:338](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L338) Average test duration metric @@ -76,7 +76,7 @@ Average test duration metric > `optional` **runsAnalyzed?**: `number` -Defined in: [types.ts:338](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L338) +Defined in: [types.ts:340](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L340) Number of historical runs analyzed @@ -86,6 +86,6 @@ Number of historical runs analyzed > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:340](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L340) +Defined in: [types.ts:342](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L342) Custom metadata diff --git a/docs/interfaces/InsightsOptions.md b/docs/interfaces/InsightsOptions.md index 7e44e13..0c395d4 100644 --- a/docs/interfaces/InsightsOptions.md +++ b/docs/interfaces/InsightsOptions.md @@ -6,7 +6,7 @@ # Interface: InsightsOptions -Defined in: [types.ts:480](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L480) +Defined in: [types.ts:482](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L482) Options for insights calculation @@ -16,7 +16,7 @@ Options for insights calculation > `optional` **baseline?**: [`CTRFReport`](CTRFReport.md) -Defined in: [types.ts:482](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L482) +Defined in: [types.ts:484](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L484) Baseline report for comparison @@ -26,6 +26,6 @@ Baseline report for comparison > `optional` **window?**: `number` -Defined in: [types.ts:484](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L484) +Defined in: [types.ts:486](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L486) Number of historical reports to analyze diff --git a/docs/interfaces/MergeOptions.md b/docs/interfaces/MergeOptions.md index 21ce275..be1ac40 100644 --- a/docs/interfaces/MergeOptions.md +++ b/docs/interfaces/MergeOptions.md @@ -6,7 +6,7 @@ # Interface: MergeOptions -Defined in: [types.ts:438](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L438) +Defined in: [types.ts:440](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L440) Options for merging reports @@ -16,7 +16,7 @@ Options for merging reports > `optional` **deduplicateTests?**: `boolean` -Defined in: [types.ts:440](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L440) +Defined in: [types.ts:442](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L442) Remove duplicate tests by executionId, testId, or legacy id @@ -26,7 +26,7 @@ Remove duplicate tests by executionId, testId, or legacy id > `optional` **mergeSummary?**: `boolean` -Defined in: [types.ts:442](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L442) +Defined in: [types.ts:444](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L444) Recalculate summary from merged tests @@ -36,6 +36,6 @@ Recalculate summary from merged tests > `optional` **preserveEnvironment?**: `"first"` \| `"last"` \| `"merge"` -Defined in: [types.ts:444](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L444) +Defined in: [types.ts:446](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L446) Strategy for handling environments diff --git a/docs/interfaces/MetricDelta.md b/docs/interfaces/MetricDelta.md index c21dc6f..cc7be07 100644 --- a/docs/interfaces/MetricDelta.md +++ b/docs/interfaces/MetricDelta.md @@ -6,7 +6,7 @@ # Interface: MetricDelta -Defined in: [types.ts:370](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L370) +Defined in: [types.ts:372](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L372) Metric with current value, baseline, and change @@ -16,7 +16,7 @@ Metric with current value, baseline, and change > `optional` **current?**: `number` -Defined in: [types.ts:372](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L372) +Defined in: [types.ts:374](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L374) Current value @@ -26,7 +26,7 @@ Current value > `optional` **baseline?**: `number` -Defined in: [types.ts:374](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L374) +Defined in: [types.ts:376](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L376) Baseline value for comparison @@ -36,6 +36,6 @@ Baseline value for comparison > `optional` **change?**: `number` -Defined in: [types.ts:376](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L376) +Defined in: [types.ts:378](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L378) Change from baseline (current - baseline) diff --git a/docs/interfaces/ParseOptions.md b/docs/interfaces/ParseOptions.md index 8cc803c..228f76b 100644 --- a/docs/interfaces/ParseOptions.md +++ b/docs/interfaces/ParseOptions.md @@ -6,7 +6,7 @@ # Interface: ParseOptions -Defined in: [types.ts:526](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L526) +Defined in: [types.ts:528](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L528) Options for parsing JSON @@ -16,6 +16,6 @@ Options for parsing JSON > `optional` **validate?**: `boolean` -Defined in: [types.ts:528](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L528) +Defined in: [types.ts:530](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L530) Validate after parsing diff --git a/docs/interfaces/ReportBuilderOptions.md b/docs/interfaces/ReportBuilderOptions.md index 18bbd9a..61e514d 100644 --- a/docs/interfaces/ReportBuilderOptions.md +++ b/docs/interfaces/ReportBuilderOptions.md @@ -6,7 +6,7 @@ # Interface: ReportBuilderOptions -Defined in: [types.ts:492](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L492) +Defined in: [types.ts:494](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L494) Options for ReportBuilder @@ -16,7 +16,7 @@ Options for ReportBuilder > `optional` **autoGenerateId?**: `boolean` -Defined in: [types.ts:494](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L494) +Defined in: [types.ts:496](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L496) Automatically generate report ID @@ -26,6 +26,6 @@ Automatically generate report ID > `optional` **autoTimestamp?**: `boolean` -Defined in: [types.ts:496](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L496) +Defined in: [types.ts:498](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L498) Automatically set timestamp diff --git a/docs/interfaces/Step.md b/docs/interfaces/Step.md index 229c62b..2b403d7 100644 --- a/docs/interfaces/Step.md +++ b/docs/interfaces/Step.md @@ -6,7 +6,7 @@ # Interface: Step -Defined in: [types.ts:262](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L262) +Defined in: [types.ts:264](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L264) Test step @@ -16,7 +16,7 @@ Test step > **name**: `string` -Defined in: [types.ts:264](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L264) +Defined in: [types.ts:266](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L266) Step name @@ -26,7 +26,7 @@ Step name > **status**: [`TestStatus`](../type-aliases/TestStatus.md) -Defined in: [types.ts:266](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L266) +Defined in: [types.ts:268](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L268) Step status @@ -36,6 +36,6 @@ Step status > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:268](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L268) +Defined in: [types.ts:270](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L270) Custom metadata diff --git a/docs/interfaces/StringifyOptions.md b/docs/interfaces/StringifyOptions.md index b81b650..3f47196 100644 --- a/docs/interfaces/StringifyOptions.md +++ b/docs/interfaces/StringifyOptions.md @@ -6,7 +6,7 @@ # Interface: StringifyOptions -Defined in: [types.ts:536](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L536) +Defined in: [types.ts:538](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L538) Options for stringifying to JSON @@ -16,7 +16,7 @@ Options for stringifying to JSON > `optional` **pretty?**: `boolean` -Defined in: [types.ts:538](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L538) +Defined in: [types.ts:540](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L540) Pretty print with indentation @@ -26,6 +26,6 @@ Pretty print with indentation > `optional` **indent?**: `number` -Defined in: [types.ts:540](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L540) +Defined in: [types.ts:542](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L542) Number of spaces for indentation (default: 2) diff --git a/docs/interfaces/SummaryOptions.md b/docs/interfaces/SummaryOptions.md index e96f158..7a0164f 100644 --- a/docs/interfaces/SummaryOptions.md +++ b/docs/interfaces/SummaryOptions.md @@ -6,7 +6,7 @@ # Interface: SummaryOptions -Defined in: [types.ts:514](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L514) +Defined in: [types.ts:516](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L516) Options for calculating summary @@ -16,7 +16,7 @@ Options for calculating summary > `optional` **start?**: `number` -Defined in: [types.ts:516](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L516) +Defined in: [types.ts:518](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L518) Start timestamp @@ -26,6 +26,6 @@ Start timestamp > `optional` **stop?**: `number` -Defined in: [types.ts:518](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L518) +Defined in: [types.ts:520](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L520) Stop timestamp diff --git a/docs/interfaces/Test.md b/docs/interfaces/Test.md index 93b9f46..6bfebeb 100644 --- a/docs/interfaces/Test.md +++ b/docs/interfaces/Test.md @@ -42,11 +42,21 @@ Identifier for this specific execution of the test case *** +### attemptId? + +> `optional` **attemptId?**: `string` + +Defined in: [types.ts:117](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L117) + +Identifier for this individual attempt + +*** + ### name > **name**: `string` -Defined in: [types.ts:117](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L117) +Defined in: [types.ts:119](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L119) Test name @@ -56,7 +66,7 @@ Test name > **status**: [`TestStatus`](../type-aliases/TestStatus.md) -Defined in: [types.ts:119](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L119) +Defined in: [types.ts:121](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L121) Test execution status @@ -66,7 +76,7 @@ Test execution status > **duration**: `number` -Defined in: [types.ts:121](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L121) +Defined in: [types.ts:123](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L123) Test duration in milliseconds @@ -76,7 +86,7 @@ Test duration in milliseconds > `optional` **start?**: `number` -Defined in: [types.ts:123](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L123) +Defined in: [types.ts:125](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L125) Start timestamp (Unix epoch milliseconds) @@ -86,7 +96,7 @@ Start timestamp (Unix epoch milliseconds) > `optional` **stop?**: `number` -Defined in: [types.ts:125](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L125) +Defined in: [types.ts:127](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L127) Stop timestamp (Unix epoch milliseconds) @@ -96,7 +106,7 @@ Stop timestamp (Unix epoch milliseconds) > `optional` **suite?**: `string`[] -Defined in: [types.ts:127](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L127) +Defined in: [types.ts:129](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L129) Test suite hierarchy @@ -106,7 +116,7 @@ Test suite hierarchy > `optional` **message?**: `string` -Defined in: [types.ts:129](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L129) +Defined in: [types.ts:131](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L131) Error message (for failed tests) @@ -116,7 +126,7 @@ Error message (for failed tests) > `optional` **trace?**: `string` -Defined in: [types.ts:131](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L131) +Defined in: [types.ts:133](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L133) Stack trace (for failed tests) @@ -126,7 +136,7 @@ Stack trace (for failed tests) > `optional` **snippet?**: `string` -Defined in: [types.ts:133](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L133) +Defined in: [types.ts:135](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L135) Code snippet where failure occurred @@ -136,7 +146,7 @@ Code snippet where failure occurred > `optional` **ai?**: `string` -Defined in: [types.ts:135](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L135) +Defined in: [types.ts:137](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L137) AI-generated analysis or suggestion @@ -146,7 +156,7 @@ AI-generated analysis or suggestion > `optional` **line?**: `number` -Defined in: [types.ts:137](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L137) +Defined in: [types.ts:139](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L139) Line number where test is defined or failed @@ -156,7 +166,7 @@ Line number where test is defined or failed > `optional` **rawStatus?**: `string` -Defined in: [types.ts:139](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L139) +Defined in: [types.ts:141](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L141) Original status from the test framework @@ -166,7 +176,7 @@ Original status from the test framework > `optional` **tags?**: `string`[] -Defined in: [types.ts:141](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L141) +Defined in: [types.ts:143](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L143) Tags for categorization @@ -176,7 +186,7 @@ Tags for categorization > `optional` **labels?**: `Record`\<`string`, [`LabelValue`](../type-aliases/LabelValue.md)\> -Defined in: [types.ts:143](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L143) +Defined in: [types.ts:145](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L145) Structured key-value metadata; values may be scalar or multi-valued @@ -186,7 +196,7 @@ Structured key-value metadata; values may be scalar or multi-valued > `optional` **type?**: `string` -Defined in: [types.ts:145](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L145) +Defined in: [types.ts:147](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L147) Test type (e.g., 'unit', 'integration', 'e2e') @@ -196,7 +206,7 @@ Test type (e.g., 'unit', 'integration', 'e2e') > `optional` **filePath?**: `string` -Defined in: [types.ts:147](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L147) +Defined in: [types.ts:149](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L149) Path to the test file @@ -206,7 +216,7 @@ Path to the test file > `optional` **retries?**: `number` -Defined in: [types.ts:149](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L149) +Defined in: [types.ts:151](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L151) Number of times the test was re-executed after its initial attempt @@ -216,7 +226,7 @@ Number of times the test was re-executed after its initial attempt > `optional` **retryAttempts?**: [`AttemptHistoryEntry`](AttemptHistoryEntry.md)[] -Defined in: [types.ts:151](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L151) +Defined in: [types.ts:153](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L153) Ordered history of attempts completed before the final attempt @@ -226,7 +236,7 @@ Ordered history of attempts completed before the final attempt > `optional` **flaky?**: `boolean` -Defined in: [types.ts:153](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L153) +Defined in: [types.ts:155](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L155) Whether the test is flaky @@ -236,7 +246,7 @@ Whether the test is flaky > `optional` **stdout?**: `string`[] -Defined in: [types.ts:155](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L155) +Defined in: [types.ts:157](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L157) Standard output captured during test @@ -246,7 +256,7 @@ Standard output captured during test > `optional` **stderr?**: `string`[] -Defined in: [types.ts:157](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L157) +Defined in: [types.ts:159](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L159) Standard error captured during test @@ -256,7 +266,7 @@ Standard error captured during test > `optional` **threadId?**: `string` -Defined in: [types.ts:159](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L159) +Defined in: [types.ts:161](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L161) Thread/worker ID that ran this test @@ -266,7 +276,7 @@ Thread/worker ID that ran this test > `optional` **browser?**: `string` -Defined in: [types.ts:161](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L161) +Defined in: [types.ts:163](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L163) Browser name (for browser tests) @@ -276,7 +286,7 @@ Browser name (for browser tests) > `optional` **device?**: `string` -Defined in: [types.ts:163](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L163) +Defined in: [types.ts:165](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L165) Device name (for device tests) @@ -286,7 +296,7 @@ Device name (for device tests) > `optional` **screenshot?**: `string` -Defined in: [types.ts:165](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L165) +Defined in: [types.ts:167](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L167) Base64 encoded screenshot @@ -296,7 +306,7 @@ Base64 encoded screenshot > `optional` **attachments?**: [`Attachment`](Attachment.md)[] -Defined in: [types.ts:167](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L167) +Defined in: [types.ts:169](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L169) File attachments @@ -306,7 +316,7 @@ File attachments > `optional` **parameters?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:169](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L169) +Defined in: [types.ts:171](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L171) Test parameters (for parameterized tests) @@ -316,7 +326,7 @@ Test parameters (for parameterized tests) > `optional` **steps?**: [`Step`](Step.md)[] -Defined in: [types.ts:171](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L171) +Defined in: [types.ts:173](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L173) Test steps @@ -326,7 +336,7 @@ Test steps > `optional` **insights?**: [`TestInsights`](TestInsights.md) -Defined in: [types.ts:173](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L173) +Defined in: [types.ts:175](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L175) Test-level insights @@ -336,6 +346,6 @@ Test-level insights > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:175](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L175) +Defined in: [types.ts:177](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L177) Custom metadata diff --git a/docs/interfaces/TestBuilderOptions.md b/docs/interfaces/TestBuilderOptions.md index 47949aa..ddb2883 100644 --- a/docs/interfaces/TestBuilderOptions.md +++ b/docs/interfaces/TestBuilderOptions.md @@ -6,7 +6,7 @@ # Interface: TestBuilderOptions -Defined in: [types.ts:504](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L504) +Defined in: [types.ts:506](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L506) Options for TestBuilder @@ -16,6 +16,6 @@ Options for TestBuilder > `optional` **autoGenerateId?**: `boolean` -Defined in: [types.ts:506](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L506) +Defined in: [types.ts:508](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L508) Automatically generate test ID diff --git a/docs/interfaces/TestInsights.md b/docs/interfaces/TestInsights.md index 7171af5..681ec1e 100644 --- a/docs/interfaces/TestInsights.md +++ b/docs/interfaces/TestInsights.md @@ -6,7 +6,7 @@ # Interface: TestInsights -Defined in: [types.ts:348](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L348) +Defined in: [types.ts:350](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L350) Test-level insights computed from historical data @@ -16,7 +16,7 @@ Test-level insights computed from historical data > `optional` **passRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:350](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L350) +Defined in: [types.ts:352](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L352) Pass rate metric @@ -26,7 +26,7 @@ Pass rate metric > `optional` **failRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:352](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L352) +Defined in: [types.ts:354](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L354) Fail rate metric @@ -36,7 +36,7 @@ Fail rate metric > `optional` **flakyRate?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:354](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L354) +Defined in: [types.ts:356](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L356) Flaky rate metric @@ -46,7 +46,7 @@ Flaky rate metric > `optional` **averageTestDuration?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:356](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L356) +Defined in: [types.ts:358](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L358) Average test duration metric @@ -56,7 +56,7 @@ Average test duration metric > `optional` **p95TestDuration?**: [`MetricDelta`](MetricDelta.md) -Defined in: [types.ts:358](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L358) +Defined in: [types.ts:360](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L360) 95th percentile test duration metric @@ -66,7 +66,7 @@ Defined in: [types.ts:358](https://github.com/ctrf-io/ctrf-js/blob/main/src/type > `optional` **executedInRuns?**: `number` -Defined in: [types.ts:360](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L360) +Defined in: [types.ts:362](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L362) Number of runs this test was executed in @@ -76,6 +76,6 @@ Number of runs this test was executed in > `optional` **extra?**: `Record`\<`string`, `unknown`\> -Defined in: [types.ts:362](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L362) +Defined in: [types.ts:364](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L364) Custom metadata diff --git a/docs/interfaces/ValidateOptions.md b/docs/interfaces/ValidateOptions.md index 3f86452..b05f018 100644 --- a/docs/interfaces/ValidateOptions.md +++ b/docs/interfaces/ValidateOptions.md @@ -6,7 +6,7 @@ # Interface: ValidateOptions -Defined in: [types.ts:548](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L548) +Defined in: [types.ts:550](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L550) Options for validation @@ -16,6 +16,6 @@ Options for validation > `optional` **specVersion?**: [`SchemaSelector`](../type-aliases/SchemaSelector.md) -Defined in: [types.ts:550](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L550) +Defined in: [types.ts:552](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L552) Specific spec version to validate against, or `latest` (default) diff --git a/docs/interfaces/ValidationErrorDetail.md b/docs/interfaces/ValidationErrorDetail.md index d7f4dd3..3b63ed7 100644 --- a/docs/interfaces/ValidationErrorDetail.md +++ b/docs/interfaces/ValidationErrorDetail.md @@ -6,7 +6,7 @@ # Interface: ValidationErrorDetail -Defined in: [types.ts:424](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L424) +Defined in: [types.ts:426](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L426) Details of a validation error @@ -16,7 +16,7 @@ Details of a validation error > **message**: `string` -Defined in: [types.ts:426](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L426) +Defined in: [types.ts:428](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L428) Human-readable error message @@ -26,7 +26,7 @@ Human-readable error message > **path**: `string` -Defined in: [types.ts:428](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L428) +Defined in: [types.ts:430](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L430) JSON path to the error location @@ -36,6 +36,6 @@ JSON path to the error location > **keyword**: `string` -Defined in: [types.ts:430](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L430) +Defined in: [types.ts:432](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L432) JSON Schema or semantic validation keyword that failed diff --git a/docs/interfaces/ValidationResult.md b/docs/interfaces/ValidationResult.md index adb957e..65d4e44 100644 --- a/docs/interfaces/ValidationResult.md +++ b/docs/interfaces/ValidationResult.md @@ -6,7 +6,7 @@ # Interface: ValidationResult -Defined in: [types.ts:412](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L412) +Defined in: [types.ts:414](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L414) Result of schema validation @@ -16,7 +16,7 @@ Result of schema validation > **valid**: `boolean` -Defined in: [types.ts:414](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L414) +Defined in: [types.ts:416](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L416) Whether the report is valid @@ -26,6 +26,6 @@ Whether the report is valid > **errors**: [`ValidationErrorDetail`](ValidationErrorDetail.md)[] -Defined in: [types.ts:416](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L416) +Defined in: [types.ts:418](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L418) Array of schema or semantic validation errors diff --git a/docs/type-aliases/LabelPrimitive.md b/docs/type-aliases/LabelPrimitive.md index 74d52c2..2107264 100644 --- a/docs/type-aliases/LabelPrimitive.md +++ b/docs/type-aliases/LabelPrimitive.md @@ -8,6 +8,6 @@ > **LabelPrimitive** = `string` \| `number` \| `boolean` -Defined in: [types.ts:186](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L186) +Defined in: [types.ts:188](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L188) Primitive value supported by a test label diff --git a/docs/type-aliases/LabelValue.md b/docs/type-aliases/LabelValue.md index d54d248..0b46228 100644 --- a/docs/type-aliases/LabelValue.md +++ b/docs/type-aliases/LabelValue.md @@ -8,6 +8,6 @@ > **LabelValue** = [`LabelPrimitive`](LabelPrimitive.md) \| \[[`LabelPrimitive`](LabelPrimitive.md), `...LabelPrimitive[]`\] -Defined in: [types.ts:189](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L189) +Defined in: [types.ts:191](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L191) Scalar or non-empty multi-valued test label value diff --git a/docs/type-aliases/RetryAttempt.md b/docs/type-aliases/RetryAttempt.md index a80f2c1..79e9893 100644 --- a/docs/type-aliases/RetryAttempt.md +++ b/docs/type-aliases/RetryAttempt.md @@ -8,7 +8,7 @@ > **RetryAttempt** = [`AttemptHistoryEntry`](../interfaces/AttemptHistoryEntry.md) -Defined in: [types.ts:237](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L237) +Defined in: [types.ts:239](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L239) Backward-compatible name for an attempt history entry. diff --git a/docs/type-aliases/SchemaSelector.md b/docs/type-aliases/SchemaSelector.md index 3dee149..820ba4f 100644 --- a/docs/type-aliases/SchemaSelector.md +++ b/docs/type-aliases/SchemaSelector.md @@ -8,6 +8,6 @@ > **SchemaSelector** = [`SupportedSpecVersion`](SupportedSpecVersion.md) \| `"latest"` -Defined in: [constants.ts:33](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L33) +Defined in: [constants.ts:34](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L34) A published CTRF specification version or the current-version alias diff --git a/docs/type-aliases/SupportedSpecVersion.md b/docs/type-aliases/SupportedSpecVersion.md index 72495ac..f17533a 100644 --- a/docs/type-aliases/SupportedSpecVersion.md +++ b/docs/type-aliases/SupportedSpecVersion.md @@ -8,6 +8,6 @@ > **SupportedSpecVersion** = *typeof* [`SUPPORTED_SPEC_VERSIONS`](../variables/SUPPORTED_SPEC_VERSIONS.md)\[`number`\] -Defined in: [constants.ts:30](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L30) +Defined in: [constants.ts:31](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L31) A published CTRF specification version supported by this package diff --git a/docs/type-aliases/TestStatus.md b/docs/type-aliases/TestStatus.md index db68a4e..777a742 100644 --- a/docs/type-aliases/TestStatus.md +++ b/docs/type-aliases/TestStatus.md @@ -8,6 +8,6 @@ > **TestStatus** = `"passed"` \| `"failed"` \| `"skipped"` \| `"pending"` \| `"other"` -Defined in: [types.ts:183](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L183) +Defined in: [types.ts:185](https://github.com/ctrf-io/ctrf-js/blob/main/src/types.ts#L185) Test status enum diff --git a/docs/variables/CTRF_NAMESPACE.md b/docs/variables/CTRF_NAMESPACE.md index 6186cf1..b1625bc 100644 --- a/docs/variables/CTRF_NAMESPACE.md +++ b/docs/variables/CTRF_NAMESPACE.md @@ -8,6 +8,6 @@ > `const` **CTRF\_NAMESPACE**: `"6ba7b810-9dad-11d1-80b4-00c04fd430c8"` = `"6ba7b810-9dad-11d1-80b4-00c04fd430c8"` -Defined in: [constants.ts:36](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L36) +Defined in: [constants.ts:37](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L37) CTRF namespace UUID for deterministic ID generation diff --git a/docs/variables/CURRENT_SPEC_VERSION.md b/docs/variables/CURRENT_SPEC_VERSION.md index d81c778..6fdbd3d 100644 --- a/docs/variables/CURRENT_SPEC_VERSION.md +++ b/docs/variables/CURRENT_SPEC_VERSION.md @@ -6,7 +6,7 @@ # Variable: CURRENT\_SPEC\_VERSION -> `const` **CURRENT\_SPEC\_VERSION**: `"0.1.0"` = `"0.1.0"` +> `const` **CURRENT\_SPEC\_VERSION**: `"0.2.0"` = `"0.2.0"` Defined in: [constants.ts:9](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L9) diff --git a/docs/variables/SUPPORTED_SPEC_VERSIONS.md b/docs/variables/SUPPORTED_SPEC_VERSIONS.md index 817ce47..5283b26 100644 --- a/docs/variables/SUPPORTED_SPEC_VERSIONS.md +++ b/docs/variables/SUPPORTED_SPEC_VERSIONS.md @@ -6,7 +6,7 @@ # Variable: SUPPORTED\_SPEC\_VERSIONS -> `const` **SUPPORTED\_SPEC\_VERSIONS**: readonly \[`"0.0.1"`, `"0.0.2"`, `"0.0.3"`, `"0.0.4"`, `"0.1.0"`\] +> `const` **SUPPORTED\_SPEC\_VERSIONS**: readonly \[`"0.0.1"`, `"0.0.2"`, `"0.0.3"`, `"0.0.4"`, `"0.1.0"`, `"0.2.0"`\] Defined in: [constants.ts:21](https://github.com/ctrf-io/ctrf-js/blob/main/src/constants.ts#L21) diff --git a/package-lock.json b/package-lock.json index c2108ff..8d845e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ctrf", - "version": "0.4.0", + "version": "0.5.0-next-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ctrf", - "version": "0.4.0", + "version": "0.5.0-next-0", "license": "MIT", "dependencies": { "ajv": "8.20.0", @@ -3760,9 +3760,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", "dev": true, "license": "BSD-3-Clause", "engines": { diff --git a/package.json b/package.json index 293427e..c88fc04 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ctrf", - "version": "0.4.0", + "version": "0.5.0-next-0", "description": "CTRF reference implementation in TypeScript for creating and validating CTRF documents.", "type": "module", "main": "dist/index.cjs", diff --git a/src/builder.test.ts b/src/builder.test.ts index 4ddb5f8..9c6cd10 100644 --- a/src/builder.test.ts +++ b/src/builder.test.ts @@ -236,6 +236,7 @@ describe("builder", () => { expect(test.name).toBe("should work"); expect(test.status).toBe("passed"); expect(test.duration).toBe(100); + expect(test).not.toHaveProperty("attemptId"); }); it("should throw if name is missing", () => { @@ -256,11 +257,21 @@ describe("builder", () => { ).toThrow(BuilderError); }); + it.each(["", null, 1, true, [], {}])( + "should reject invalid attemptId %j", + (id) => { + expect(() => new TestBuilder().attemptId(id as string)).toThrow( + BuilderError, + ); + }, + ); + it("should set all optional fields", () => { const test = new TestBuilder() .id("test-id") .testId("auth/login") .executionId("execution-123") + .attemptId("attempt-3") .name("test") .status("failed") .duration(100) @@ -299,6 +310,7 @@ describe("builder", () => { expect(test.id).toBe("test-id"); expect(test.testId).toBe("auth/login"); expect(test.executionId).toBe("execution-123"); + expect(test.attemptId).toBe("attempt-3"); expect(test.start).toBe(1000); expect(test.stop).toBe(1100); expect(test.suite).toEqual(["unit", "auth"]); diff --git a/src/builder.ts b/src/builder.ts index cf3e979..ae8df06 100644 --- a/src/builder.ts +++ b/src/builder.ts @@ -266,6 +266,7 @@ export class TestBuilder { private _id?: string; private _testId?: string; private _executionId?: string; + private _attemptId?: string; private _name?: string; private _status?: TestStatus; private _duration?: number; @@ -324,6 +325,17 @@ export class TestBuilder { return this; } + /** + * Set the attempt ID. + */ + attemptId(id: string): this { + if (typeof id !== "string" || id.length === 0) { + throw new BuilderError("Attempt ID must be a non-empty string"); + } + this._attemptId = id; + return this; + } + /** * Set the test name. */ @@ -671,6 +683,8 @@ export class TestBuilder { test.executionId = this._executionId; } + if (this._attemptId !== undefined) test.attemptId = this._attemptId; + // Add optional fields only if set if (this._start !== undefined) test.start = this._start; if (this._stop !== undefined) test.stop = this._stop; diff --git a/src/cli/types.ts b/src/cli/types.ts index aa8d069..970bdfa 100644 --- a/src/cli/types.ts +++ b/src/cli/types.ts @@ -38,6 +38,8 @@ export interface Test { id?: string; testId?: string; executionId?: string; + /** Identifier for this individual attempt */ + attemptId?: string; name: string; status: TestStatus; duration: number; diff --git a/src/constants.test.ts b/src/constants.test.ts index 9ad5c8b..1edeeab 100644 --- a/src/constants.test.ts +++ b/src/constants.test.ts @@ -20,7 +20,7 @@ describe("constants", () => { }); it("should identify the latest published specification", () => { - expect(CURRENT_SPEC_VERSION).toBe("0.1.0"); + expect(CURRENT_SPEC_VERSION).toBe("0.2.0"); }); }); @@ -50,6 +50,7 @@ describe("constants", () => { "0.0.3", "0.0.4", "0.1.0", + "0.2.0", ]); }); }); diff --git a/src/constants.ts b/src/constants.ts index c474295..3a3e1e3 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,7 +6,7 @@ export const REPORT_FORMAT = "CTRF" as const; /** Current spec version */ -export const CURRENT_SPEC_VERSION = "0.1.0"; +export const CURRENT_SPEC_VERSION = "0.2.0"; /** All valid test statuses */ export const TEST_STATUSES = [ @@ -24,6 +24,7 @@ export const SUPPORTED_SPEC_VERSIONS = [ "0.0.3", "0.0.4", "0.1.0", + "0.2.0", ] as const; /** A published CTRF specification version supported by this package */ diff --git a/src/ctrf-schema-0.2.0.json b/src/ctrf-schema-0.2.0.json new file mode 100644 index 0000000..0135d5e --- /dev/null +++ b/src/ctrf-schema-0.2.0.json @@ -0,0 +1,718 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "CTRF JSON Schema", + "description": "Common Test Report Format - an open standard JSON format for test results reports", + "type": "object", + "required": [ "results", "reportFormat", "specVersion" ], + "properties": { + "reportFormat": { + "description": "Document format identifier. Must be 'CTRF'", + "const": "CTRF" + }, + "specVersion": { + "description": "CTRF specification version in SemVer format (MAJOR.MINOR.PATCH)", + "type": "string", + "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" + }, + "reportId": { + "description": "Unique identifier for this CTRF document instance (UUID). Identifies the serialized artifact", + "type": "string", + "format": "uuid", + "minLength": 1 + }, + "runId": { + "description": "Identifier for the logical test run. Shared across shards/documents belonging to the same run", + "type": "string", + "minLength": 1 + }, + "timestamp": { + "description": "Report generation time (RFC 3339 / ISO 8601)", + "type": "string", + "format": "date-time" + }, + "generatedBy": { + "description": "Tool or system that produced this CTRF document", + "type": "string" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + }, + "results": { + "description": "Results of a single test execution run", + "type": "object", + "required": [ "tool", "summary", "tests" ], + "properties": { + "tool": { + "description": "Tool or framework that produced the test results", + "type": "object", + "required": [ "name" ], + "properties": { + "name": { + "description": "Name of the testing tool or framework", + "type": "string", + "minLength": 1 + }, + "version": { + "description": "Version of the testing tool", + "type": "string" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "summary": { + "description": "Aggregated statistics and timing for the test run", + "type": "object", + "required": [ + "tests", + "passed", + "failed", + "skipped", + "pending", + "other", + "start", + "stop" + ], + "properties": { + "tests": { + "description": "Total number of tests executed", + "type": "integer" + }, + "passed": { + "description": "Count of tests with status 'passed'", + "type": "integer" + }, + "failed": { + "description": "Count of tests with status 'failed'", + "type": "integer" + }, + "skipped": { + "description": "Count of tests with status 'skipped'", + "type": "integer" + }, + "pending": { + "description": "Count of tests with status 'pending'", + "type": "integer" + }, + "other": { + "description": "Count of tests with status 'other'", + "type": "integer" + }, + "flaky": { + "description": "Count of flaky tests (passed after failed attempts)", + "type": "integer" + }, + "suites": { + "description": "Number of test suites in the run", + "type": "integer" + }, + "start": { + "description": "Run start time (milliseconds since Unix epoch)", + "type": "integer" + }, + "stop": { + "description": "Run end time (milliseconds since Unix epoch)", + "type": "integer" + }, + "duration": { + "description": "Total run duration (milliseconds)", + "type": "integer" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "tests": { + "description": "List of test cases executed during the run", + "type": "array", + "items": { + "description": "Individual test case result", + "type": "object", + "required": [ "name", "status", "duration" ], + "properties": { + "id": { + "description": "Legacy identifier for the test case (UUID). New producers should prefer testId", + "type": "string", + "format": "uuid", + "minLength": 1 + }, + "testId": { + "description": "Stable identifier for the logical test case. Should be derived from stable test attributes when generated by a producer", + "type": "string", + "minLength": 1 + }, + "executionId": { + "description": "Unique identifier for this specific execution of the test case within a run. UUID recommended", + "type": "string", + "minLength": 1 + }, + "attemptId": { + "description": "Unique identifier for this individual attempt. UUID recommended", + "type": "string", + "minLength": 1 + }, + "name": { + "description": "Name or title of the test case", + "type": "string", + "minLength": 1 + }, + "status": { + "description": "Final outcome of the test case", + "enum": [ "passed", "failed", "skipped", "pending", "other" ] + }, + "duration": { + "description": "Test execution time (milliseconds)", + "type": "integer" + }, + "start": { + "description": "Test start time (milliseconds since Unix epoch)", + "type": "integer" + }, + "stop": { + "description": "Test end time (milliseconds since Unix epoch)", + "type": "integer" + }, + "suite": { + "description": "Suite hierarchy from top-level to immediate parent", + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, + "message": { + "description": "Error or failure message", + "type": "string" + }, + "trace": { + "description": "Stack trace or failure trace information", + "type": "string" + }, + "snippet": { + "description": "Code snippet associated with the failure", + "type": "string" + }, + "ai": { + "description": "AI-generated diagnostic data or suggestions", + "type": "string" + }, + "line": { + "description": "Line number of the test definition", + "type": "integer" + }, + "rawStatus": { + "description": "Original status from source tool before normalization", + "type": "string" + }, + "tags": { + "description": "Simple, keyless classifications used to categorize the test case", + "type": "array", + "items": { + "type": "string" + } + }, + "labels": { + "description": "Structured key-value metadata describing the test case. Values may be scalar primitives or non-empty arrays of primitive values", + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "minItems": 1, + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + } + } + ] + } + }, + "type": { + "description": "Test classification (e.g., 'unit', 'integration', 'e2e')", + "type": "string" + }, + "filePath": { + "description": "Path to the file defining this test", + "type": "string" + }, + "retries": { + "description": "Number of times the test was re-executed after its initial attempt", + "type": "integer", + "minimum": 0 + }, + "retryAttempts": { + "description": "Ordered history of attempts completed before the final attempt represented by the test object", + "type": "array", + "minItems": 1, + "items": { + "description": "Attempt completed before the final attempt", + "type": "object", + "required": [ "attempt", "status" ], + "properties": { + "attempt": { + "description": "Original sequence number for this attempt (1 = initial execution)", + "type": "integer", + "minimum": 1 + }, + "attemptId": { + "description": "Unique identifier for this individual attempt. UUID recommended", + "type": "string", + "minLength": 1 + }, + "status": { + "description": "Outcome of this attempt", + "enum": [ + "passed", + "failed", + "skipped", + "pending", + "other" + ] + }, + "duration": { + "description": "Attempt execution time (milliseconds)", + "type": "integer", + "minimum": 0 + }, + "message": { + "description": "Error or failure message for this attempt", + "type": "string" + }, + "trace": { + "description": "Stack trace for this attempt", + "type": "string" + }, + "line": { + "description": "Line number associated with failure", + "type": "integer" + }, + "snippet": { + "description": "Code snippet for this attempt", + "type": "string" + }, + "stdout": { + "description": "Standard output lines from this attempt", + "type": "array", + "items": { + "type": "string" + } + }, + "stderr": { + "description": "Standard error lines from this attempt", + "type": "array", + "items": { + "type": "string" + } + }, + "start": { + "description": "Attempt start time (milliseconds since Unix epoch)", + "type": "integer" + }, + "stop": { + "description": "Attempt end time (milliseconds since Unix epoch)", + "type": "integer" + }, + "attachments": { + "description": "Artifacts from this attempt", + "type": "array", + "items": { + "description": "External file or resource reference", + "type": "object", + "required": [ "name", "contentType", "path" ], + "properties": { + "attachmentId": { + "description": "Unique identifier for this attachment reference instance. UUID recommended", + "type": "string", + "minLength": 1 + }, + "name": { + "description": "Display name of the attachment", + "type": "string" + }, + "contentType": { + "description": "MIME type of the attachment", + "type": "string" + }, + "path": { + "description": "Path or URI to the attachment", + "type": "string" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "flaky": { + "description": "True if test passed after one or more failed attempts", + "type": "boolean" + }, + "stdout": { + "description": "Standard output lines from test execution", + "type": "array", + "items": { + "type": "string" + } + }, + "stderr": { + "description": "Standard error lines from test execution", + "type": "array", + "items": { + "type": "string" + } + }, + "threadId": { + "description": "Thread or worker identifier", + "type": "string" + }, + "browser": { + "description": "Browser used for browser-based tests", + "type": "string" + }, + "device": { + "description": "Device or device profile used", + "type": "string" + }, + "screenshot": { + "description": "Single base64-encoded screenshot image", + "type": "string" + }, + "attachments": { + "description": "Additional artifacts (screenshots, logs, videos, etc.)", + "type": "array", + "items": { + "description": "External file or resource reference", + "type": "object", + "required": [ "name", "contentType", "path" ], + "properties": { + "attachmentId": { + "description": "Unique identifier for this attachment reference instance. UUID recommended", + "type": "string", + "minLength": 1 + }, + "name": { + "description": "Display name of the attachment", + "type": "string" + }, + "contentType": { + "description": "MIME type of the attachment", + "type": "string" + }, + "path": { + "description": "Path or URI to the attachment", + "type": "string" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "parameters": { + "description": "Test parameters or input values", + "type": "object" + }, + "steps": { + "description": "Test steps or sub-operations", + "type": "array", + "items": { + "description": "Individual test step", + "type": "object", + "required": [ "name", "status" ], + "properties": { + "name": { + "description": "Name of the step", + "type": "string" + }, + "status": { + "description": "Outcome of the step", + "enum": [ + "passed", + "failed", + "skipped", + "pending", + "other" + ] + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "insights": { + "description": "Derived metrics for this test across runs", + "type": "object", + "properties": { + "passRate": { + "description": "Pass rate metric with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "failRate": { + "description": "Fail rate metric with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "flakyRate": { + "description": "Flaky rate metric with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "averageTestDuration": { + "description": "Average duration metric with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "p95TestDuration": { + "description": "95th percentile duration with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "executedInRuns": { + "description": "Number of runs this test was executed in", + "type": "integer" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "environment": { + "description": "Execution environment, system configuration, and build context", + "type": "object", + "properties": { + "reportName": { + "description": "Human-readable name for this report", + "type": "string" + }, + "appName": { + "description": "Name of the application under test", + "type": "string" + }, + "appVersion": { + "description": "Version of the application under test", + "type": "string" + }, + "buildId": { + "description": "Unique identifier for the CI/CD build", + "type": "string" + }, + "buildName": { + "description": "Name of the CI/CD build or pipeline", + "type": "string" + }, + "buildNumber": { + "description": "Sequential build number", + "type": "integer" + }, + "buildUrl": { + "description": "URL to the CI/CD build", + "type": "string" + }, + "repositoryName": { + "description": "Name of the source code repository", + "type": "string" + }, + "repositoryUrl": { + "description": "URL of the source code repository", + "type": "string" + }, + "commit": { + "description": "Git commit SHA or VCS revision identifier", + "type": "string" + }, + "branchName": { + "description": "Git branch or VCS branch name", + "type": "string" + }, + "osPlatform": { + "description": "Operating system platform (e.g., 'linux', 'darwin', 'win32')", + "type": "string" + }, + "osRelease": { + "description": "Operating system release version", + "type": "string" + }, + "osVersion": { + "description": "Operating system version string", + "type": "string" + }, + "testEnvironment": { + "description": "Logical test environment (e.g., 'staging', 'production')", + "type": "string" + }, + "shardId": { + "description": "Shard or partition label identifying which part of a distributed run produced this document", + "type": "string", + "minLength": 1 + }, + "healthy": { + "description": "Indicates if the run is considered healthy", + "type": "boolean" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "insights": { + "description": "Aggregated metrics computed across multiple test runs", + "type": "object", + "properties": { + "passRate": { + "description": "Overall pass rate with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "failRate": { + "description": "Overall fail rate with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "flakyRate": { + "description": "Overall flaky rate with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "averageRunDuration": { + "description": "Average run duration with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "p95RunDuration": { + "description": "95th percentile run duration with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "averageTestDuration": { + "description": "Average test duration with baseline comparison", + "$ref": "#/definitions/metricDelta" + }, + "runsAnalyzed": { + "description": "Number of historical runs analyzed for insights", + "type": "integer" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + }, + "baseline": { + "description": "Reference to a previous report used for comparison", + "type": "object", + "required": [ "reportId" ], + "properties": { + "reportId": { + "description": "UUID of the baseline report", + "type": "string", + "format": "uuid", + "minLength": 1 + }, + "timestamp": { + "description": "Generation time of the baseline report", + "type": "string", + "format": "date-time" + }, + "source": { + "description": "Origin or location of the baseline report", + "type": "string" + }, + "buildNumber": { + "description": "Build number of the baseline run", + "type": "integer" + }, + "buildName": { + "description": "Build name of the baseline run", + "type": "string" + }, + "buildUrl": { + "description": "URL to the baseline build", + "type": "string", + "format": "uri" + }, + "commit": { + "description": "Git commit SHA of the baseline run", + "type": "string" + }, + "extra": { + "description": "Extension point for arbitrary metadata", + "type": "object" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false, + "definitions": { + "metricDelta": { + "description": "Metric value with baseline comparison", + "type": "object", + "properties": { + "current": { + "description": "Current metric value", + "type": "number" + }, + "baseline": { + "description": "Baseline metric value for comparison", + "type": "number" + }, + "change": { + "description": "Computed difference between current and baseline", + "type": "number" + } + }, + "additionalProperties": false + } + } +} diff --git a/src/types.ts b/src/types.ts index 9c7ff9f..8a2b1c3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -113,6 +113,8 @@ export interface Test { testId?: string; /** Identifier for this specific execution of the test case */ executionId?: string; + /** Identifier for this individual attempt */ + attemptId?: string; /** Test name */ name: string; /** Test execution status */ diff --git a/src/validate.test.ts b/src/validate.test.ts index cbdd76c..0000b95 100644 --- a/src/validate.test.ts +++ b/src/validate.test.ts @@ -179,9 +179,10 @@ describe("validate", () => { expect(validate(report, { specVersion: "0.0.3" }).valid).toBe(true); expect(validate(report, { specVersion: "0.0.4" }).valid).toBe(false); expect(validate(report, { specVersion: "0.1.0" }).valid).toBe(false); + expect(validate(report, { specVersion: "0.2.0" }).valid).toBe(false); }); - it("should treat latest as 0.1.0", () => { + it("should treat latest as 0.2.0", () => { const invalidLatestReport = { ...validReport, results: { @@ -198,7 +199,7 @@ describe("validate", () => { }; expect(validate(invalidLatestReport, { specVersion: "latest" })).toEqual( - validate(invalidLatestReport, { specVersion: "0.1.0" }), + validate(invalidLatestReport, { specVersion: "0.2.0" }), ); }); @@ -331,6 +332,20 @@ describe("validate", () => { expect(validate(report).valid).toBe(true); }); + it.each(["", null, 1, true, [], {}])( + "should reject invalid Test attemptId %j", + (attemptId) => { + const report = { + ...validReport, + results: { + ...validReport.results, + tests: [{ ...validReport.results.tests[0], attemptId }], + }, + }; + expect(validate(report).valid).toBe(false); + }, + ); + it("should accept identity fields", () => { const report: CTRFReport = { ...validReport, @@ -346,6 +361,7 @@ describe("validate", () => { duration: 100, testId: "auth/login", executionId: "execution-123", + attemptId: "attempt-2", retries: 1, retryAttempts: [ { @@ -368,6 +384,7 @@ describe("validate", () => { }; expect(validate(report).valid).toBe(true); + expect(validate(report, { specVersion: "0.1.0" }).valid).toBe(false); }); it.each([ diff --git a/src/validate.ts b/src/validate.ts index 9a7cb19..8c2f167 100644 --- a/src/validate.ts +++ b/src/validate.ts @@ -29,7 +29,8 @@ function validateRetryHistories( // Versions before 0.0.4 used the earlier retry model. In those versions, // matching history length was recommended rather than required, and the // presence and ordering constraints below were not normative requirements. - if (version !== "0.0.4" && version !== "0.1.0") return errors; + if (version !== "0.0.4" && version !== "0.1.0" && version !== "0.2.0") + return errors; for (const [testIndex, test] of report.results.tests.entries()) { const path = `/results/tests/${testIndex}`; From e06d9a433fc084fe57bbf468f9d1c729ae66762a Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sat, 10 Oct 2026 08:50:09 +0100 Subject: [PATCH 2/4] Prepare stable 0.5.0 release --- .github/workflows/release.yaml | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e466adc..96b12e8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -53,5 +53,5 @@ jobs: uses: softprops/action-gh-release@v3 with: generate_release_notes: true - prerelease: true - make_latest: false + prerelease: ${{ steps.release-info.outputs.is_prerelease }} + make_latest: ${{ steps.release-info.outputs.is_prerelease == 'false' }} diff --git a/package-lock.json b/package-lock.json index 8d845e5..914ae28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ctrf", - "version": "0.5.0-next-0", + "version": "0.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ctrf", - "version": "0.5.0-next-0", + "version": "0.5.0", "license": "MIT", "dependencies": { "ajv": "8.20.0", diff --git a/package.json b/package.json index c88fc04..c4b90a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ctrf", - "version": "0.5.0-next-0", + "version": "0.5.0", "description": "CTRF reference implementation in TypeScript for creating and validating CTRF documents.", "type": "module", "main": "dist/index.cjs", From 001919a622b5da7c18f7b5e3d0c31920b6617502 Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sat, 10 Oct 2026 09:16:10 +0100 Subject: [PATCH 3/4] Leave deprecated CLI types unchanged --- src/cli/types.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cli/types.ts b/src/cli/types.ts index 970bdfa..aa8d069 100644 --- a/src/cli/types.ts +++ b/src/cli/types.ts @@ -38,8 +38,6 @@ export interface Test { id?: string; testId?: string; executionId?: string; - /** Identifier for this individual attempt */ - attemptId?: string; name: string; status: TestStatus; duration: number; From d296dd5cbdbd54ed027d1693558ddba891a43696 Mon Sep 17 00:00:00 2001 From: Matthew Thomas <25988124+Ma11hewThomas@users.noreply.github.com> Date: Sat, 10 Oct 2026 09:23:24 +0100 Subject: [PATCH 4/4] Preserve separate release publication steps --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 96b12e8..e466adc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -53,5 +53,5 @@ jobs: uses: softprops/action-gh-release@v3 with: generate_release_notes: true - prerelease: ${{ steps.release-info.outputs.is_prerelease }} - make_latest: ${{ steps.release-info.outputs.is_prerelease == 'false' }} + prerelease: true + make_latest: false