Search code examples
htmlcypresstest-reportingmochawesome

How to create basic plain test report in Cypress


I need help with connecting an additional reporter to Cypress tests. I am looking for a basic, really plain (HTML) report with only names of tests and statuses (Fail/Pass). Later I will send it via email.

I found Mochawesome, but this is too complicated for a one-page email. Do you have any ideas what I can use?

It would be ideal to have the results in a table like below. However, the most important thing is that this view should be simple and can be sent by e-mail

enter image description here


Solution

  • You can define your own script inside package.json

    "scripts": {
        "e2e": "cypress run --headless --browser chrome > Newt-e2e-test-results.txt",
        "cypress": "cypress open",
    },
    

    You can call e2e script with npm run e2e. That script will simply run in the headless mode and then output the results.

    Text output will be something like the below image.

    enter image description here