I am using Cypress with Cucumber-preprocessor ,I need to store the result of Cypress Run that get printed in the console after execution I need to pass this data to api call
Below is the example of Cypress Run Result - test case pass, fail, time taken etc (i need to capture this data into variable to pass to api
2 passing (34s)
(Results)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Tests: 2 │
│ Passing: 2 │
│ Failing: 0 │
│ Pending: 0 │
│ Skipped: 0 │
│ Screenshots: 0 │
│ Video: true │
│ Duration: 33 seconds │
│ Spec Ran: Test.feature │
any way to achieve this ??
You might consider using the Module API.
This is essentially an expanded version of
npx cypress run...
that gives you easy access to the results (and errors) of the run for further processing.Note that
results
are not formatted for the console, but that may suit your requirement better.Node script called e2e-run-tests.js