## 2.9.12

### Security

- Requires `qase-api-client` 1.1.17 and `qase-api-v2-client` 1.0.13, which depend on `axios` `^1.20.0`. The previous clients allowed `axios` from 1.18.1, and axios up to 1.19.0 is affected by several high-severity advisories (prototype-pollution gadgets, ReDoS, header injection, proxy and redirect bypasses, e.g. GHSA-vh66-26gq-q6x8, GHSA-mghh-pgcx-3jjj, GHSA-r4gj-5m52-g5wh). A project whose lockfile still holds an older axios gets the fixed version with `npm update qase-javascript-commons` (or by updating the reporter).

## 2.9.11

### Fixed

- Gherkin steps are sent with their keyword and text (`Given a user`); TestOps got only the `keyword` field, and the local report joined keyword and text even when a reporter had put the text in both, which printed it twice. Pairs with `cucumberjs-qase-reporter` 2.6.1, which fills in the real keyword.

### Documentation

- The README now lists the `profilers`, `networkProfiler.skip_domains` and `networkProfiler.track_on_fail` options, and the Mocha, Vitest and WebdriverIO reporters.
- The `testops_multi` rows now describe how a project's `run` inherits the global run settings: `run.complete` and `run.tags` default to the global values, and the global `run.id` is used only by projects without their own `run`. The table said a project's `run.complete` defaulted to `true`.

## 2.9.10

### Fixed

- `report` mode kept only the last process's results when tests ran in several processes, as WebdriverIO does with one worker per spec file: every worker cleared the report folder before writing its own results, and `run.json`, written by the launcher, had no results at all. The report folder is now cleared once, when the run starts. Processes started by that one add their results, and `run.json` counts every result in the folder.
- When a worker process failed to send its results to Qase TestOps, the launcher still completed the run as if nothing were missing. The run is now left open, as it is when a single-process reporter fails to send its results, and the launcher logs that some results were not sent. With `fallback: report` the launcher writes the fallback report's `run.json`.

## 2.9.9

### Fixed

- A test with a single group parameter no longer makes Qase TestOps reject every result in its batch. `qase.groupParameters({ env: 'staging' })` (or one `@QaseGroupParameters` key) was sent as a group of one, the v2 API answers `param_groups.0 must have at least 2 items` with `400`, and a `400` fails the whole request, so the neighbouring tests' results were lost too and the run was left open. A single group parameter is now sent as an ordinary parameter, and only parameters with a value are put into a group.

## 2.9.8

### Changed

- `testops.run.complete` now defaults to `true`, as the documentation always said. A run was completed only when the option was set explicitly, so a config without it left every run open. Set `run.complete: false` (or `QASE_TESTOPS_RUN_COMPLETE=false`) to keep runs open. When completion is turned off the reporter now says the run is left open instead of logging `Run N completed`. If several jobs report into one run through `QASE_TESTOPS_RUN_ID`, set `QASE_TESTOPS_RUN_COMPLETE=false` in each job and complete the run once after all of them, otherwise the first job to finish completes it. This matches the Python and Java reporters.

### Fixed

- `report.connection`, the key every README documents, is now read. The code only read `report.connections`, and the config schema accepted the documented key without using it, so a custom report path or format was silently ignored. Both keys are accepted; `connections` wins field by field when both are set. The README table now names the full `report.connection.local.path` and `report.connection.local.format` keys.
- `QASE_FALLBACK` is now read from the environment. It was validated but never mapped into the config.
- Arrays from a later config source now replace the earlier array instead of being merged by index. `QASE_TESTOPS_RUN_TAGS=a` over `run.tags: ["b", "c"]` gave `["a", "c"]`; it now gives `["a"]`. The same applied to `statusFilter`, `configurations.values` and `testops_multi.projects`. An unset `QASE_TESTOPS_RUN_TAGS` no longer produces an empty list, so it leaves tags from the config file in place.
- `QASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTS` works without `QASE_TESTOPS_CONFIGURATIONS_VALUES` and applies to values from the config file.
- In `testops_multi` mode a project with its own `run` settings now inherits the global run settings it does not override, such as `tags` and `complete`. Previously the project's `run` replaced the global one entirely. The global run `id` is still used only by projects without their own `run`.
- `testops.batch.size` is clamped to `1`–`200`. A larger value was rejected by the API, and `0` sent an empty batch for every result. The final flush at the end of a run now also uses the configured batch size instead of always sending 200 results per request.
- A config validation error names the full path of the invalid field, e.g. `testops.api.token` instead of `testops.api/token`.
- The README no longer lists `testops.api.enterprise` / `QASE_TESTOPS_API_ENTERPRISE` or `QASE_REPORT_DRIVER`, which do not exist, and the `captureLogs` row names the `captureLogs` key instead of `testops.defect`.

## 2.9.7

### Fixed

- A result marked as muted (`TestResult.muted`) is now sent to Qase TestOps as muted. The flag was only written to the local report, so `qase.mute()` support in the reporters had nothing to send. The v2 result now carries `fields.muted: 'true'` when the result is muted; results that are not muted are sent as before, and a `muted` field set through `qase.fields()` is kept.

## 2.9.6

### Fixed

- The network profiler now matches `qase.io` and `networkProfiler.skip_domains` against the request host instead of searching the whole URL. Previously any request whose URL merely contained a skipped domain, e.g. `https://example.com/?u=qase.io` or `https://qase.io.example.com`, was dropped from the profile. A domain also matches its subdomains, and an entry with a port such as `localhost:3000` matches that host and port.
- Trailing slashes are stripped from `testops.api.host` without a regular expression that backtracks polynomially on inputs with many slashes.

## 2.9.5

### Fixed

- Run links now open on the EU cluster's web app. With `testops.api.host` set to `eu.qase.io` (or `https://api-eu.qase.io`), API calls went to `api-eu.qase.io` but the logged run and failed-test links pointed at `https://eu.qase.io`, which is not where the EU app lives. Known clusters are now resolved from the API host, so these links point at `https://app-eu.qase.io`. Enterprise hosts keep their behaviour: `example.qase.io` still links to `https://example.qase.io`.

## 2.9.4

### Fixed

- Type declarations no longer fail in TypeScript projects with `skipLibCheck: false`. `composeOptions.ts` augmented `lodash`'s `LoDashStatic` to type `mergeWith`, and the augmentation was emitted into the published `dist/options/composeOptions.d.ts`. Its `MergeWithCustomizer` only resolves when `@types/lodash` is part of the consumer's program, which the declaration never ensures — the `lodash.mergewith` import is dropped from the `.d.ts` and a module augmentation does not load its target — so every reporter failed with `TS2304: Cannot find name 'MergeWithCustomizer'`. When lodash typings were loaded, the augmentation instead silently added an overload to the consumer's own `_.mergeWith`. The augmentation is removed; `composeOptions` keeps its explicit `MergedType` return type, so the public typing is unchanged.

## 2.9.3

### Fixed

- A failed result batch no longer destroys the upload error that caused it. `reportUnrecoverableBatch` built its message as `` chalk`{red ...` + `...}` ``, but a tagged template binds tighter than `+`, so chalk received only the first half with `{red` opened and never closed and threw `Chalk template literal is missing 1 closing bracket`. That throw ran before `throw error`, replacing the real cause: the reporter's own fallback then caught the chalk error, activated the permanent fallback, and nothing else reached Qase for the rest of the run. It was worst for exactly the failures that most needed reporting — `400`, `401`, `403`, `404`, `413`, `422` and `507` are rethrown without reaching `onRetry`, the only place the readable cause is logged, so the destroyed error was the sole record. Both the single- and multi-project reporters now keep the message in one template, and the underlying error is passed to `logError` alongside it, so a future formatting mistake cannot swallow the cause again. Reported in #1014.

## 2.9.2

### Fixed

- Result batches now carry an idempotency key. The v2 API documents `ResultCreate.id` as one and substitutes a random hash when it is absent, so any repeated request created duplicate results. `result.id` is now sent as that key, and `AbstractReporter` guarantees it is present and unique: Mocha left it empty and Newman replays the same Postman item id on every iteration, either of which would have let two distinct results collapse into one.
- Result uploads are retried again. `ClientV2.uploadResults` sent `createResultsV2` exactly once, so a transient failure lost the whole batch silently. Transport failures, `408`, `429` and `5xx` are now retried with exponential backoff; `400`, `401`, `403`, `404`, `413`, `422` and `507` are not, since they fail identically on a second attempt. A `Retry-After` header wins over the computed backoff (capped at 120s) — Qase asks for roughly 60 seconds and a short ladder does not survive it. Attachments keep their own retry and are not re-uploaded when the results call is repeated.
- A batch is no longer marked as sent before the API confirms it. `TestOpsReporter` advanced its index before awaiting the upload, so a failed batch fell outside the remaining range and the next `sendResults()` skipped it. The range is now claimed before the request and marked sent only after the response, so a failed batch is retried while a concurrent sender still cannot ship it twice.
- An unrecoverable batch is now reported and the run is left open. Previously the multi-project path logged the error, dropped the queue and completed the run anyway — a completed run over partial data looks trustworthy and is not. Both the single- and multi-project reporters now log how many results are missing and skip completing the run.

### Added

- New `testops.api.timeout` option (`QASE_TESTOPS_API_TIMEOUT`, default `30` seconds) sets a per-request timeout for the v2 API. Without one, a connection that stalls rather than fails hung the process at teardown.
- New `testops.api.retries` (`QASE_TESTOPS_API_RETRIES`, default `3`) and `testops.api.retryBackoff` (`QASE_TESTOPS_API_RETRY_BACKOFF`, default `1` second) options tune the result upload retry.

## 2.9.1

### Fixed

- `qase.step()` now supports multiline expected results and data. `extractAndCleanStep` matched the marker values with `.` and no `s` (dotAll) flag, so a newline anywhere inside the `QaseExpRes:` or `QaseData:` value made the whole match fail: the expected result and data were silently dropped, and the raw `QaseExpRes:`/`QaseData:` markers leaked into the step title shown in Qase. Multiline expected results are common for API and schema validation tests with a bulleted list of expected fields. The markers are now located by index and their values taken as slices, so newlines are preserved verbatim. As part of the same fix, a step carrying only one of the two markers has it stripped from the title as well, instead of leaking it.

## 2.9.0

### Added

- Attachment uploads are now uploaded with bounded parallelism instead of strictly one batch at a time. The new `testops.attachments.concurrency` option (`QASE_TESTOPS_ATTACHMENTS_CONCURRENCY`, default `4`, clamped to `1`..`16`) controls how many batches are in flight. Runs with thousands of attachments — Playwright suites with traces, for example — spent minutes in the upload phase after 2.8.1 made uploads sequential; the default of 4 restores most of that throughput while keeping concurrency bounded.
- New `testops.attachments.timeout` option (`QASE_TESTOPS_ATTACHMENTS_TIMEOUT`, default `120` seconds) sets a per-request timeout for attachment uploads, so a stalled request can no longer hang the upload phase indefinitely.

### Changed

- The fixed ~1s pause between attachment batches is now applied only while the API is actually rate limiting. As long as no `429` is returned, batches follow each other immediately; after a `429` the reporter waits out the `Retry-After` window and paces batches until five consecutive batches succeed. Runs that never hit a rate limit no longer pay the pacing cost.
- Attachment uploads now go through a dedicated keep-alive HTTP agent whose socket pool is bounded by the configured concurrency, with idle sockets dropped after 30s.

### Fixed

- Retries of file-backed attachments (`file_path`, e.g. Playwright's `trace.zip`) re-sent the same already-consumed read stream on every attempt, so all retries after a failed upload were doomed regardless of the cause. Each attempt now opens fresh streams.
- A retry after a connection-level failure (`ECONNRESET` and friends) is now sent over a brand new connection instead of reusing the pooled socket that had just been reset.

## 2.8.1

### Fixed

- Attachment uploads no longer run with unbounded concurrency. Previously `ClientV2.uploadResults` transformed a whole batch of results with `Promise.all` and uploaded each attachment as its own single-file request, so the number of simultaneous upload requests scaled with `QASE_TESTOPS_BATCH_SIZE`. Large runs (hundreds of results with several attachments each) triggered `429 Too Many Requests` and `ECONNRESET` errors and silently lost attachments. Attachments for a whole batch are now collected and uploaded once, in real batches (up to 20 files / 128 MB per request) sent sequentially, which bounds concurrency independently of the batch size.
- Transient network errors during attachment upload (`ECONNRESET`, `ETIMEDOUT`, `ECONNREFUSED`, `ECONNABORTED`, `EPIPE`) are now retried with the same exponential backoff already used for `429` responses, instead of being thrown away and dropping the attachment.

## 2.8.0

### Added

- `TestExecution` gained an optional `error_context` field, mapped through `ResultTransformer` to `execution.error_context` on the v2 API payload. It carries free-form failure context captured by a framework — for Playwright, the contents of `error-context.md` — which Qase stores as text so it can be copied as a raw string. The field is optional, so reporters that do not produce one are unaffected and keep sending `null`. Bumped `qase-api-v2-client` pin to `~1.0.10`.
- `testops.api.host` / `QASE_TESTOPS_API_HOST` now accepts a full base URL as well as a bare host name. A value carrying an `http://` or `https://` scheme is used verbatim, so self-hosted deployments and local development can specify a scheme, a port, or a path prefix (`https://qase.internal/tms`, `http://localhost:8080`, `http://api.qase.lo`). Bare host names keep their existing meaning and are still resolved as `https://api-<host>` — no previously working configuration changes behaviour.

### Fixed

- The API-to-app host rewrite used an unanchored substring replace, so any host merely containing the letters `api` was corrupted when building the test run link: `capital.qase.io` became `capptal.qase.io` and `rapid.qase.io` became `rappd.qase.io`. The rewrite is now anchored to the leading `api.` label.

## 2.7.5

### Fixed

- `ResultTransformer.transform()` now maps an empty-array `testops_id` to `null` in the outgoing payload (was leaking `testops_ids: []`, which the API rejects with HTTP 400 — `"Each testops_ids item must be a positive integer."`). This is a defensive guard: in 2.7.4 a `[]` could still slip out from reporter result-builders that fed the registry-lookup branch after all IDs got filtered.

## 2.7.4

### Fixed

- Qase test case IDs that are `<= 0` (e.g. an accidental `(Qase ID: 0)` in a test title or `@qaseid(0)` tag) no longer cause the API to reject the whole result batch with HTTP 400. The invalid ID is dropped with a warning and the result is sent without an ID, exactly as if no ID had been specified. Filtering happens in a new internal `filterPositiveIds()` helper applied by `parseQaseIdsFromString`, `parseProjectMappingFromTitle`, and `parseProjectMappingFromTags`. The warning routes through the provided `LoggerInterface` (logged at INFO level with a `Warning:` prefix in the message) or falls back to `console.warn` when no logger is available.

## 2.7.3

### Fixed

- Added `repository.directory: "qase-javascript-commons"` so npmjs.com correctly resolves relative links in this package's README (previously rendered as broken `github.com/.../blob/<path>` URLs without a branch).

## 2.7.2

### Security

- Bumped `uuid` from `^9.0.1` to `^11.1.1` to close the GHSA-9p95-fxx9-6q3q advisory (Missing buffer bounds check in v3/v5/v6 when `buf` is provided). `v4` is the only uuid function used here, but downstream `cypress-qase-reporter`, `playwright-qase-reporter` and friends transitively exposed the alert through this package's lockfile. v14 was considered but dropped — it publishes an ESM-only `dist-node/index.js` that breaks `require('uuid')` in CJS consumers and in jest.
- Dropped `@types/uuid` devDependency; uuid 11+ ships its own types.

### Changed

- `engines.node` raised from `>=14` to `>=18`. Node 14/16 are EOL and uuid 11+ requires Node ≥18.
- Bumped pinned ranges of internal API clients: `qase-api-client` `~1.1.1` → `~1.1.8`, `qase-api-v2-client` `~1.0.4` → `~1.0.8`.

## 2.7.1

### Fixed
- HTTP/fetch profiler steps now emit `execution.start_time` and `execution.end_time` as Unix epoch seconds (with fractional ms), matching the Qase API contract. Previously the interceptor wrote `Date.now()` milliseconds directly into both fields, placing every captured request step ~55 years in the future on the timeline. `execution.duration` remains in milliseconds.
- `ReportReporter` test-run summary (`report.execution.start_time` / `end_time` in the generated JSON report) is now emitted in Unix seconds instead of milliseconds; this aligns the report-mode file with the v2 API spec consumed by `reporters-validator`.
- `QaseStep.run` (the shared user-facing `qase.step()` API used by Jest, Vitest, WebdriverIO and TestCafe) now emits `execution.start_time` / `end_time` in Unix seconds instead of raw `Date.now()` milliseconds, and populates `execution.duration` (ms). Previously every `qase.step()` call landed ~55 years in the future on the timeline and reported `null` duration.

## 2.7.0

### Added
- New internal subpath `qase-javascript-commons/internal` exposing helpers for use by Qase reporters in this monorepo: `removeQaseIdsFromTitle`, `extractAndCleanStep`, `getFile`, `parseQaseIdsFromString`, `normalizeSuitePart`. The `/internal` subpath is intended for Qase-owned reporter packages and may change without a major version bump.

### Changed
- `removeQaseIdsFromTitle` regex unified across reporters to `/\(Qase ID:? ([\d,]+)\)$/i`. This is more permissive than the previous mocha/wdio variants (case-insensitive; also accepts `(Qase ID 1)` without colon) and adds a trailing-position anchor (`$`).

# qase-javascript-commons@2.6.6

## Bug fixes

- Fixed Playwright timeout tests being reported as `invalid` instead of `failed`. When Playwright reports a test with `timedOut` or `interrupted` status, the `determineTestStatus` function now returns `failed` directly, bypassing the error-message heuristic that previously misclassified timeout errors as non-assertion (infrastructure) failures. Other reporters (Cypress, Jest, Mocha, TestCafe) are unaffected because they do not use these runner-specific status values.

# qase-javascript-commons@2.6.5

## Bug fixes

- Fixed `TypeError: Cannot read properties of undefined (reading 'length')` when publishing test results. The `ResultTransformer` now safely handles missing `tags` property on test results created as plain object literals by framework reporters (jest, cypress, playwright, cucumberjs, newman, testcafe, wdio).

# qase-javascript-commons@2.6.3

## Internal refactoring

The `QaseReporter` God class (~680 lines) has been split into focused components,
and spec-compliant report serialization has been extracted into its own module.
**The public API is unchanged** — all exports, method signatures, option shapes,
environment variables, and the JSON report format are preserved verbatim. The
report format is additionally verified in CI against the official Qase report
schemas via `reporters-validator`.

New internal components:

- `src/qase/options-resolver.ts` — env + config composition, state restore,
  `withState` detection.
- `src/qase/reporter-factory.ts` — mode-based reporter instantiation with
  option validation (replaces the inline `switch` that previously lived inside
  `QaseReporter.createReporter`).
- `src/qase/status-processor.ts` — status mapping + filtering.
- `src/reporters/shared/fallback-coordinator.ts` — encapsulates the
  upstream → fallback → disabled cascade that was previously repeated in five
  lifecycle methods of `QaseReporter`.
- `src/utils/token-masker.ts` — reusable `maskToken` / `sanitizeOptionsForLog`.
- `src/formatter/report-serializer.ts` — pure spec-compliant serializer
  (RSLT-01/02, STEP-01/02/03 rules), lifted out of `ReportReporter`.

Shared utilities:

- `DEFAULT_BATCH_SIZE` constant and `resolveTestOpsBaseUrl` helper now live
  in `src/reporters/shared/` (previously duplicated between `TestOpsReporter`
  and `TestOpsMultiReporter`).

## Bug fixes

- **Fallback activation on upstream creation failure.** Previously, if the
  upstream reporter failed to construct (for example, misconfigured TestOps
  client) and a `fallback` mode was configured, the reporter would disable
  itself instead of switching to the fallback. Now the fallback is correctly
  activated. **Note for users:** pipelines with a broken upstream
  configuration and a `report` fallback will now start producing local report
  artifacts where previously nothing was produced.
- `publish()` no longer double-calls both reporters when already in fallback
  mode — it now runs exactly one reporter.
- `StateManager.setMode(off)` on fallback failure now respects the
  `withState` flag, so frameworks that don't use persistent state no longer
  write state during shutdown.

# qase-javascript-commons@2.6.2

## Bug fixes

- Fixed Cypress failure classification in real browser environments. Cypress errors false-positive on the `"http"` non-assertion pattern because (a) browser stack traces contain URLs like `https://localhost/__cypress/runner/...` and (b) all error messages include docs links like `https://on.cypress.io/...`. The classifier now unconditionally trusts Cypress' retry-ability prefix (`Timed out retrying after Nms:`) as a genuine test failure signal, since this prefix is exclusive to DOM-interacting commands and never appears in infrastructure failures (`cy.request()`, `cy.task()`).

# qase-javascript-commons@2.6.1

## Bug fixes

- Fixed Cypress test failures being classified as `invalid` instead of `failed`. Cypress uses retry-ability (`Timed out retrying after Nms: ...`) and command syntax (`cy.click() failed`, `cy.wait() timed out`) that don't contain the word `expect`, so genuine UI/command failures previously fell through to the timeout catch-all and were mislabeled as environment errors. `cy.request()` with infrastructure-level errors (e.g. `ECONNREFUSED`) continues to be classified as `invalid`.

# qase-javascript-commons@2.6.0

## What's new

- Added `tags: string[]` field to `TestResultType` domain model for tag support.
- Tags are mapped to `fields.tags` as a comma-separated string when sending results to API v2.
- Tags are included in report serialization output.

# qase-javascript-commons@2.5.10

## What's new

Unified HostData model to align field names across all Qase reporter languages:

- Renamed `node` → `language` and `npm` → `packageManager` in the `HostData` interface.
- Normalized `system` field: `win32` is now reported as `windows`.
- X-Platform and X-Client headers continue to use language-specific keys (`node=`, `npm=`).

# qase-javascript-commons@2.5.9

## Bug fixes

- Fixed shallow copy bug in `addTestResult` when splitting multi-ID test results. The `execution` object is now deep-copied, preventing shared reference mutation that zeroed out `duration` for all copies.

# qase-javascript-commons@2.5.8

## Bug fixes

- Fixed stale reporter state in long-lived Node.js processes (VS Code Playwright extension, Jest watch mode). The singleton `QaseReporter` now resets per-run state (`runId`, `firstIndex`, `results`, `disabled`, `useFallback`) in `startTestRun()`, so subsequent test runs within the same process work correctly.

# qase-javascript-commons@2.5.7

## Bug fixes

- Moved profiler modules to a separate sub-path export (`qase-javascript-commons/profilers`) to fix Webpack `UnhandledSchemeError` when using Cypress. The main entry point no longer pulls in `node:` URI imports (`async_hooks`, `http`, `https`, `diagnostics_channel`).

# qase-javascript-commons@2.5.6

## What's new

- Added Network Profiler framework for automatic HTTP/HTTPS request interception during test execution.
- Added `StepType.REQUEST` step type for network request data in test results.
- Added configurable profiler options in `qase.config.json` (`profilers` and `networkProfiler` fields).

# qase-javascript-commons@2.5.5

## What's new

Significantly improved startup performance by optimizing host data collection:

- Replaced slow `npm list --depth=10 --json` fallback with fast `require.resolve()`-based package version lookup.
- Replaced `execSync('node --version')` with `process.version`.
- Replaced `execSync('npm --version')` with `process.env.npm_config_user_agent` parsing (with execSync fallback).
- Eliminated duplicate `getHostInfo()` call in `ReportReporter.complete()` by passing pre-collected host data from `QaseReporter`.
- Included `report` mode in the `needsHostData` guard so host data is collected once during init.

Worst-case startup time reduced from ~10-25 seconds to ~55 ms.

# qase-javascript-commons@2.5.4

## What's new

- Fixed an issue where non-string parameter values (e.g. numbers) were sent to the Qase API as-is, causing validation errors. The `transformParams` method now converts all parameter values to strings.

# qase-javascript-commons@2.5.3

## What's new

- Fixed path separator normalization in `generateSignature()` to ensure consistent signatures across Windows and Unix platforms.

# qase-javascript-commons@2.5.2

## What's new

Aligned report output with the cross-language Qase Report specification:

- Report file renamed from `report.json` to `run.json`, title changed to `"Test run"`.
- Stats model: replaced `broken` field with `blocked` and `invalid`, fixed status enum mapping.
- Result serialization: `testops_id` serializes as `testops_ids` (array), `group_params` as `param_groups` (array of arrays).
- Step serialization: `data` field serializes as `input_data`, attachments moved to `execution.attachments`.
- Gherkin-type steps automatically convert to TEXT format during serialization (`keyword + name` → `action`).
- Attachment `size` and `content` fields excluded from serialized output.

All changes are serialization-only — internal model interfaces are unchanged, no breaking changes for framework reporters.

# qase-javascript-commons@2.5.1

## What's new

Fixed issue with incorrect test status determination.

# qase-javascript-commons@2.5.0

## What's new

Added **multi-project support** (`testops_multi` mode):

- New mode `testops_multi` sends results to multiple Qase projects in one run; each project gets its own run.
- New field `testops_project_mapping` on `TestResultType`: project code → list of test case IDs. Helpers: `setTestopsProjectMapping()`, `getTestopsProjectMapping()`, `getTestopsIdsForProject()`, `getProjects()`.
- New config: `testops_multi.default_project` and `testops_multi.projects[]` with `code`, `run`, `plan`, `environment` per project.
- New reporter `TestOpsMultiReporter`; selected when `mode` is `testops_multi`. Single-project behavior is unchanged.

# qase-javascript-commons@2.4.18

## What's new

Fixed issue with incorrect link to failed test in the console output.

# qase-javascript-commons@2.4.17

## What's new

Eliminated startup delay when reporter mode is `off`.

# qase-javascript-commons@2.4.16

## What's new

Fixed issue with incorrect 'disabled' status.

# qase-javascript-commons@2.4.13

## What's new

Improved the upload mechanism for attachments.
Now the reporter will upload attachments in batches of 20 files.

# qase-javascript-commons@2.4.12

## What's new

Improved the retry mechanism for uploading attachments.

# qase-javascript-commons@2.4.11

## What's new

Added retry mechanism for uploading attachments.

# qase-javascript-commons@2.4.10

## What's new

Fixed an issue with report link for enterprise customers.

# qase-javascript-commons@2.4.9

## What's new

Added support for public report link in the test run.
You can now generate a public report link for the test run.

# qase-javascript-commons@2.4.8

## What's new

Improved error handling for timeout errors.

# qase-javascript-commons@2.4.7

## Bug fixes

Fixed issue where test results with unknown statuses were incorrectly marked as `skipped` instead of `passed` by default. Now status matching is case-insensitive for better compatibility with different test frameworks.

# qase-javascript-commons@2.4.6

## What's new

Added ability to control logging to console and file using the `logging` configuration option.

# qase-javascript-commons@2.4.5

## What's new

Added support for status mapping in the test run.
You can now map test result statuses to different values.

# qase-javascript-commons@2.4.4

## What's new

Updated the `qase-api-client` dependency to version `1.0.6`.

# qase-javascript-commons@2.4.3

## What's new

Fixed an issue with the `report` mode not sending results.

# qase-javascript-commons@2.4.2

## What's new

Added support for status filter in the test run.

You can now filter out test results by status.
The status filter is specified in the `testops.statusFilter` configuration option.
The status filter is a comma-separated list of statuses to exclude from reporting.
The statuses are: `passed`, `failed`, `skipped`, `invalid`.
The status filter is applied to the test results before they are sent to Qase.

# qase-javascript-commons@2.4.1

## What's new

Added support for external links in the test run.

# qase-javascript-commons@2.3.6

## What's new

Added support for configurations in the test run.

# qase-javascript-commons@2.3.5

## What's new

Fixed a link to failed test in the console output.

# qase-javascript-commons@2.3.4

## What's new

Fixed an issue with parsing tags from the `QASE_TESTOPS_RUN_TAGS` environment variable. Now tags can be passed as a comma-separated string.

# qase-javascript-commons@2.3.3

## What's new

Added support for tags in the test run.

# qase-javascript-commons@2.3.2

## What's new

Fixed an issue with attachments content type.

# qase-javascript-commons@2.3.0

## What's new

Migrated to the new API clients for v1 (`qase-api-client`) and v2 (`qase-api-v2-client`) from the `qaseio`.

# qase-javascript-commons@2.2.18

## What's new

Resolved an issue where retrieving installed package versions failed if some dependencies were missing.

# qase-javascript-commons@2.2.17

## What's new

- Logging of host system details to improve debugging and traceability.
- Output of installed packages in logs for better environment visibility.

# qase-javascript-commons@2.2.16

## What's new

Improved logging and exception management to provide clearer diagnostics

# qase-javascript-commons@2.2.15

## What's new

Updated axios dependency to address identified security vulnerabilities.

# qase-javascript-commons@2.2.13

## What's new

Enhanced error messages for 403 status code responses to provide clearer and more informative feedback.

# qase-javascript-commons@2.2.12

## What's new

Added a mutex to ensure correct result submission when running tests in multiple threads, preventing potential
duplication.

# qase-javascript-commons@2.2.11

## What's new

- Improved state manager behavior to ensure correct handling.
- Masked token in logs to enhance security.

# qase-javascript-commons@2.2.10

## What's new

Resolved an issue with parallel execution of multiple reporters using a shared sync file. Each reporter now uses its own
dedicated file for state synchronization.

# qase-javascript-commons@2.2.7

## What's new

Fixed an issue then the reporter didn't create defects for failed tests.

# qase-javascript-commons@2.2.6

## What's new

Added error handling for HTTP status 422 in API responses, returning a descriptive QaseError with relevant details.

# qase-javascript-commons@2.2.5

## What's new

Use the API v2 client by default. If you want to use the API v1 client, specify the `useV2` option in the config file or
the environment variable `QASE_TESTOPS_USEV2` as `False`.

# qase-javascript-commons@2.2.3

## What's new

Fixed an issue when the reporter saves the state file in the wrong directory.

# qase-javascript-commons@2.2.1

## What's new

Support `author` field in the test result data.
You can specify author name or email in fields.

# qase-javascript-commons@2.1.3

## What's new

Reporters will send all data on the results of the autotests. Including the data of the title, the description, etc.

# qase-javascript-commons@2.1.1

## What's new

Fixed an issue where the state file was not deleted. This resulted in results being uploaded into the same test run.

# qase-javascript-commons@2.1.0

## What's new

Minor release of the commons package

# qase-javascript-commons@2.1.0-beta.1

## What's new

- update a `InternalReporterInterface`. Added a new methods `sendResults` and `complete` to send the results and
  complete the test run.
- add `StateManager` class to manage and share the state of the reporter between the different instances of the
  reporter.

# qase-javascript-commons@2.0.13

## What's new

- If a plan ID is specified then when creating a test run it also specifies the plan ID.
- If a test run ID is specified then the reporter won't check for the existence of a test run.

# qase-javascript-commons@2.0.12

## What's new

Support qaseio package version 2.2.0

# qase-javascript-commons@2.0.11

## What's new

- Improved logging for better debugging and error reporting.

- Show the link to the test run in the console output when the test is failed.

```text
[INFO] qase: See why this test failed: https://app.qase.io/run/DEMO/dashboard/123?status=%5B2%5D&search=5%20-%206%20=%20-2
```

# qase-javascript-commons@2.0.10

## What's new

Fixed an issue with sending test results duplicates when we use the `qase-cypress` reporter.
Now the reporter will send the test results only once.

The Cypress calls the `publish` method multiple times for the same test results because of the Cypress architecture.
It calls the `publish` method for each test file.

# qase-javascript-commons@2.0.9

## What's new

Added new configuration option `rootSuite` to specify a root suite.
This option is available in the config file and the `QASE_ROOT_SUITE` env variable

```diff
{
  "mode": "testops",
  "fallback": "report",
  "environment": "local",
+ "rootSuite": "Root Suite",
  ...
}
```

# qase-javascript-commons@2.0.8

## What's new

Fixed an issue with creating a test run with environment when the reporter ignored the `environment` parameter in the
configuration.

# qase-javascript-commons@2.0.7

## What's new

Fixed an issue with creating a defect for failed tests when the reporter ignored the `defect` parameter in the
configuration.

# qase-javascript-commons@2.0.6

## What's new

Fixed an issue with a race condition when the reporter added test results to the test run.

# qase-javascript-commons@2.0.5

## What's new

Improved logging for better debugging and error reporting.

# qase-javascript-commons@2.0.4

## What's new

Fixed an issue when the reporter created a test run:
`The start time does not match the format Y-m-d H:i:s.`

# qase-javascript-commons@2.0.3

## What's new

Fixed an issue when the reporter would run tests before creating a test run.
Now the reporter will create a test run before running tests.

# qase-javascript-commons@2.0.2

## What's new

Add new step status `skipped` to the test result data.
Before this fix, the reporter didn't support the `skipped` status for test steps.

For ApiV1 the `skipped` status will be converted to `blocked` status.
For ApiV2 the `skipped` status will be converted to `skipped` status.

# qase-javascript-commons@2.0.1

## What's new

Remove ANSI escape codes from the message and stack trace.
Before this fix, the reporter added ANSI escape codes to the message and stack trace.

```diff
- Error: [2mexpect([22m[31mreceived[39m[2m).[22mtoBe[2m([22m[32mexpected[39m[2m) // Object.is equality[22m
+ Error: expect(received).toBe(expected) // Object.is equality
```

# qase-javascript-commons@2.0.0

## What's new

This is the first release version of the Qase JavaScript SDK.
It is numbered `2.0.0` (and not `1.0.0`) to match the release series of
test reporters for Playwright, Cypress, Jest, and other frameworks.

### Annotating test with field data

Tests can now be annotated with data for the system and custom fields in Qase.
This feature is already implemented in the Playwright reporter:

```js
test('Test with annotated fields', () => {
  qase.id(1);
  qase.fields({ 'severity': 'high', 'priority': 'medium' })
  // ...
});
```

### Parametrized tests

Qase JavaScript SDK enables annotating tests with parameters, and passing parameter values to Qase.
Parameterized tests can report to a single test case, but each parameter variation is registered as
a standalone result, with its own run history.

### Attachments from files and variables

Reporters can now upload attachments of various data types to Qase,
both from files and variables.
It enables flexible and meticulous logging, such as collecting full HTTP request data,
including URL, headers, and payload.

### Uploading results in flexible batches, asynchronously

Test reporters can now upload results in batches, while tests are still running.
It helps bring test results faster and enables acting on them long before the test run is complete.

### Uniform configuration

Qase JavaScript SDK brings configuration with config files and environment variables
to a common standard, used with Qase reporters in all languages and frameworks.

For details, see
the [Configuration](https://github.com/qase-tms/qase-javascript/tree/main/qase-javascript-commons#configuration)
section in the README.

### Latest API

Qase JavaScript SDK is using the latest Qase API client,
employing the full power of the stable v1 API version,
and enabling the use of experimental v2 API, tailored for uploading
huge amounts of test results.

# qase-javascript-commons@2.0.0-beta.12

## What's new

Fixed an issue when the result has empty step action. Now the reporter will mark such steps as "Unnamed step" and will
log a warning message.

# qase-javascript-commons@2.0.0-beta.11

## What's new

- The `useV2` option in the reporter's configuration will now enable using the experimental v2 API.
  Before this fix, v1 API was used despite the configuration.

- Attachments from test steps will now be uploaded to Qase.
  Before this fix, the reporter uploaded only the attachments made outside of any step scope.

# qase-javascript-commons@2.0.0-beta.10

## What's new

Fixed an issue when the results published before the test run creation.

# qase-javascript-commons@2.0.0-beta.9

## What's new

Improved debug logging for better testing and reporting errors.

- Separate `logger` class for use in reporters, supporting logging to console and files.
- Extra debug logs in both reporter modes: TestOps and Local.

Fixed an issue with duplicate test runs created when the testing framework
(such as Cypress) uses more than one instance of the Qase reporter.
Now reporter handles Qase test runs in the following way:

1. The first instance of the reporter creates a Qase test run and stores the run ID
   in the ENV variable `QASE_TESTOPS_RUN_ID`.
2. Other instances of the reporter read this variable and report test results
   to the existing test run.

Nothing has changed in cases when there is a single instance of a reporter or
when it is using a test run, created with other tools, such as with an API request
or manually in the Qase app.

# qase-javascript-commons@2.0.0-beta.8

## What's new

Renamed the `QASE_TESTOPS_CHUNK` environment variable to `QASE_TESTOPS_BATCH_SIZE`.
Renamed the `chunk` field in the reporter's configuration to `batch.size`.

```diff
{
  ...
  "testops": {
-   "chunk": 10
+   "batch": {
+      "size": 10
+    }
    ...
  },
  ...
}
```

# qase-javascript-commons@2.0.0-beta.7

## What's new

TestOps reporter supports uploading test result in real-time.
It can be useful for long-running tests, where you want to see the results as soon as they are available.
You can use chunk size to control the size of the data sent to the Qase.

To enable real-time reporting, set an environment variable before running the tests or use the reporter's configuration:

```bash
QASE_TESTOPS_CHUNK=10
```

```diff
{
  ...
  "testops": {
+   "chunk": 10
    ...
  },
  ...
}
```

where `10` is the size of the chunk in test result's count.

# qase-javascript-commons@2.0.0-beta.6

## What's new

### Select the API version to use for reporting

Qase TestOps API has two endpoints for reporting test results:

- Version 1, stable and used my most test reporters.
  <https://developers.qase.io/reference/create-result-bulk>
- Version 2, currently in beta access, and currently supported only
  in the `playwright-qase-reporter`.
  <https://developers.qase.io/v2.0/reference/create-results-v2>

This commit introduces a way to select the API version to use.
It enables using all new features of v2 JS reporters with the stable v1 API,
and elso experimenting with the new v2 API.

**Warning**: v2 API is still in beta.
If you want to try the v2 JS reporters, you don't have to enable the new API.

To enable using API v2, set an environment variable before running the tests:

```bash
QASE_TESTOPS_API_V2=true
```

### Support adding test suite description to a test report

Test reporters can now test suite description to test results.
Such description can be collected from test's location and attributes
or explicitly declared in the test.

Add new data models:

- Relation
- Suite
- SuiteData

# qase-javascript-commons@2.0.0-beta.5

## What's new

- Update the config of reporters. Added `captureLogs` field. If it is set to `true`, the reporter will capture logs from
  the test framework.
- Added `getMimeType` function to the commons package. It returns the MIME type of the file by its extension.

# qase-javascript-commons@2.0.0-beta.4

## What's new

- Added support for uploading attachments from strings and buffers in the testops reporter.
- Changed data type of `content` in the attachment data from `any` to `string | Buffer`.

# qase-javascript-commons@2.0.0-beta.3

## What's new

- Changed data type of `fields` and `parameters` in the test result data
  from `Map<string, string>` to `Record<string, string>`.

# qase-javascript-commons@2.0.0-beta.2

## Overview

Package `qase-javascript-commons` contains common functions, used by all Qase JavaScript reporters.

This is a beta channel release.
Don't install this package explicitly.
Instead, install the test reporter for your framework, for example:

```bash
npm install playwright-qase-reporter@beta
```

## What's new

- Set a fallback reporter when the primary reporter can't be used,
  such as when the `testops` reporter can't authenticate with the Qase API.
- Rename some environment variables to keep naming consistent between reporters in all languages.
- Add several environment variables for new config options.
- Write outputs in JSONP format, which can be used with
  [Qase Report](https://github.com/qase-tms/qase-report).
- Logic for handling test with multiple case IDs moved to the commons package.
