Registry / testing / allure-fetch

allure-fetch

JSON →
library3.9.0jsnpmunverified

Allure Fetch is an integration library for Allure reporting framework that instruments the Fetch API to capture HTTP request/response data and attach it to Allure test reports. Current stable version is 3.9.0, with monthly releases. It is part of the Allure JS ecosystem and provides seamless integration for test frameworks using Fetch (e.g., Playwright, Cypress). Key differentiator: automatic recording of network interactions without manual interception, supporting both Node.js and browser environments.

npm install allure-fetch
INSTALL
IMPORT
SIG · ALLURE-FETCH
A
allure-fetch
testingjavascriptv3.9.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AllureFetch
import { AllureFetch } from 'allure-fetch'
import AllureFetch from 'allure-fetch'
AllureFetch is a named export, not a default export.
AllureNetworkRecorder
import { AllureNetworkRecorder } from 'allure-fetch'
Alternative name for AllureFetch, same named export.
FetchRecorder
import { FetchRecorder } from 'allure-fetch'
Alias for the main recorder class.

Shows how to instantiate AllureFetch with an AllureRuntime, record HTTP requests via Fetch, and attach them to Allure reports.

import { AllureFetch } from 'allure-fetch'; import { AllureRuntime } from 'allure-js-commons'; const runtime = new AllureRuntime({ resultsDir: './allure-results' }); const fetchRecorder = new AllureFetch(runtime, { request: true, response: true }); // Record a fetch call fetchRecorder.runWithRecording(async () => { const response = await fetch('https://api.example.com/data'); const data = await response.json(); console.log(data); }); fetchRecorder.stop();
Debug
Known issues
gotchaAllureFetch must be stopped before test completion; otherwise, requests may not be flushed to the report.
fix
Call .stop() or use runWithRecording callback to ensure flush.
affects: >=1.0.0
breakingIn v3.0.0, the AllureFetch constructor changed from (runtime, options) to (runtime, options?) with altered default options.
fix
Update instantiation: `new AllureFetch(runtime, { request: true, response: true })`.
affects: >=3.0.0
gotchaDuplicate recordings occur if fetch is called multiple times without clearing previous state.
fix
Call .clear() before each test to reset the recorder.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'append')
AllureFetch is not stopped before a new recording starts, leaving internal state inconsistent.
fix
Ensure you call .stop() before initializing a new recording.
AllureFetch is not a constructor
Using a default import instead of a named import.
fix
Use `import { AllureFetch } from 'allure-fetch'` (curly braces).
Upgrade
Version history
3.9.0latest on npm
Audit
Dependencies
allure-js-commonsrequiredCore Allure runtime dependency for report generation
Agent activity
46 hits · last 30 days
node
38
OpenAI (training)
1
Resources
allure-fetch — npm install allure-fetch · libregistry