UPDATES

Generate Attract studies in Cypress Framework


To generate an HTML Attract report within the Cypress framework, you possibly can comply with these steps:

Set up the Attract Command Line software:

The Attract Command Line software is required to generate the HTML report. Set up it globally utilizing the next command:

npm set up -g allure-commandline
Enter fullscreen mode

Exit fullscreen mode

Add the Cypress Attract Plugin:

Set up the Cypress Attract Plugin by operating the next command:

npm set up --save-dev @shelex/cypress-allure-plugin
Enter fullscreen mode

Exit fullscreen mode

Configure the Cypress plugin:

Open the cypress/plugins/index.js file and add the next code:

const allureWriter = require('@shelex/cypress-allure-plugin/author');

module.exports = (on, config) => {
  allureWriter(on, config);
  return config;
};

Enter fullscreen mode

Exit fullscreen mode

Run your Cypress assessments:

Run your Cypress assessments utilizing the Cypress command:

npx cypress run
Enter fullscreen mode

Exit fullscreen mode

Generate the Attract report:

After operating the assessments, the Attract report information will probably be saved within the allure-results listing.

To generate the HTML report, use the next command:

attract generate allure-results --clean && attract open
Enter fullscreen mode

Exit fullscreen mode

This command will generate the HTML report based mostly on the info within the allure-results listing and open it in your default browser.

That is it! You could have generated an HTML Attract report on your Cypress assessments. The report will present detailed details about the check execution, together with check instances, steps, attachments, and extra.

Leave a Reply

Your email address will not be published. Required fields are marked *