You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when the plugin cannot read a response body, the reason
is now written to
response.content._error instead of response.content.error, since HAR 1.2
allows only fields that
start with an underscore beyond the spec.
cy.saveHar() and the HAR recorded for each spec now
wait for the network to be
idle before saving, up to maxWaitDuration (5 seconds by default). Pass waitForIdle: false to save
right away as before.
the HAR recorded for each spec keeps the spec's folder
below the fixed start of specPattern inside hars_folder, e.g. cypress/e2e/admin/login.cy.ts
is saved as {hars_folder}/admin/login.cy.har instead of {hars_folder}/login.cy.har.
ensureBrowserFlags is removed. install already adds
the browser flags; to keep
your own before:browser:launch listener next to the plugin's, wrap on
with cypress-on-fix as the
README shows.
Cypress internal requests under /__/, /__cypress/, /__cypress-studio/ and /__cypress-cy-prompt/ are excluded by
default; pass excludePaths: [] to record them.
install requires the Cypress config: call install(on, config). It records a HAR
for each spec by default; pass { lifecycle: false } to record only
with the commands. enableExperimentalLifecycle is removed; use install(on, config)
instead.
The plugin requires Cypress 15.10.0 or later. The hars_folder variable is read
only from the expose object or the --expose option; it is no longer
read from the env object,
the --env option or the CYPRESS_hars_folder environment variable,
and the upper-case HARS_FOLDER name is no longer read. Set expose: { hars_folder: '...' } in the Cypress config or
pass --expose hars_folder=... instead.
minStatusCodeToInclude is removed; use excludeStatusCodes instead. The hars_folders variable and CYPRESS_HARS_FOLDERS are no longer read;
use hars_folder and CYPRESS_hars_folder. Blob requests are no longer recorded by default;
pass includeBlobs: true
to record them.
Node.js older than 20.19.0, or 22.x older than 22.12.0,
is no longer supported.
TypeScript projects need TypeScript 5.0 or later. On
earlier versions, stay on version 5
of the plugin.
Only @neuralegion/cypress-har-generator, @neuralegion/cypress-har-generator/commands and @neuralegion/cypress-har-generator/package.json
can be imported. Deep imports of any other file, such as @neuralegion/cypress-har-generator/dist/index.js or @neuralegion/cypress-har-generator/commands.js, fail with ERR_PACKAGE_PATH_NOT_EXPORTED; import
the package root or @neuralegion/cypress-har-generator/commands
instead.
Cypress 14.0.0 or later is required; on older Cypress,
stay on version 5.
Features
exclude the Cypress internal requests by default (#624) (c198283)
expose only the public entry points in exports (#622) (34bf899)
plugin: fail the run when a HAR cannot be written (#689) (38546c9)
group the entries by the pages of the app, as DevTools does (#661) (d17f9e8)
keep one entry for each repeated request with dedupe (#659) (454ada3)
keep only the entries of the failed tests with failedTestsOnly (#668) (a53569e)
keep the spec folder in the name of the HAR recorded for each spec (#645) (0054550)
leave the per-run values out of the HAR with stable (#660) (79be463)
list how each test try ended in _tests (#669) (a090258)
list the tests in log._tests and refer to them by _testref (#662) (63cd259)
read hars_folder only from expose and require Cypress 15.10 (#633) (31791bc)
record a HAR for each spec by default (#623) (52c01ee), closes #306