Choose the best description of what Mochawesome reporter does when used with Cypress tests.
Think about what a reporter typically does in testing frameworks.
Mochawesome is a reporter that creates detailed, easy-to-read HTML and JSON reports from Cypress test results. It does not affect test execution speed or retry logic.
Given the following cypress.config.js snippet, what files will Mochawesome generate after tests complete?
const { defineConfig } = require('cypress'); module.exports = defineConfig({ reporter: 'mochawesome', reporterOptions: { reportDir: 'cypress/reports', overwrite: false, html: true, json: true } });
Check the reporterOptions for file types enabled.
The configuration enables both html and json reports, so both file types will be generated in the specified folder. The overwrite option controls if reports overwrite existing files, but does not prevent generation.
You want to check if the Mochawesome HTML report file cypress/reports/mochawesome.html exists after tests run. Which assertion is correct?
const fs = require('fs'); const assert = require('assert'); // Assertion to check file existence:
Check Node.js fs method names and assertion syntax.
fs.existsSync is the correct synchronous method to check file existence. assert.strictEqual compares the boolean result to true. Other options use invalid methods or incorrect assertion syntax.
Given this cypress.config.js snippet, tests run successfully but no Mochawesome report is created. What is the likely cause?
const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { setupNodeEvents(on, config) { // no reporter setup here } }, reporter: 'mochawesome', reporterOptions: { reportDir: 'cypress/reports', overwrite: true, html: true, json: true } });
Check how Cypress expects reporters to be configured in version 10+.
In Cypress 10 and later, reporters must be configured inside the setupNodeEvents function for them to work. Setting reporter and reporterOptions outside does not activate the reporter.
You run Cypress tests in parallel and get multiple Mochawesome JSON reports. Which approach correctly merges these reports into a single HTML report?
Think about how to handle multiple JSON files from parallel runs.
When running tests in parallel, multiple JSON reports are created. The mochawesome-merge tool merges these JSON files into one. Then mochawesome-report-generator creates a combined HTML report. Other options either do not merge or are incorrect.