Test Overview
This test verifies that the Mochawesome reporter is correctly set up in Cypress and generates a test report after running a simple test case.
This test verifies that the Mochawesome reporter is correctly set up in Cypress and generates a test report after running a simple test case.
/// <reference types="cypress" /> // cypress.config.js const { defineConfig } = require('cypress') module.exports = defineConfig({ reporter: 'mochawesome', reporterOptions: { reportDir: 'cypress/reports', overwrite: false, html: true, json: true }, e2e: { setupNodeEvents(on, config) { // implement node event listeners here }, baseUrl: 'https://example.cypress.io' } }) // cypress/e2e/sample_spec.cy.js describe('Mochawesome Reporter Setup Test', () => { it('Visits the Kitchen Sink and checks title', () => { cy.visit('/') cy.title().should('include', 'Kitchen Sink') }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Cypress test runner initializes with Mochawesome reporter configured | - | PASS |
| 2 | Browser opens and navigates to baseUrl 'https://example.cypress.io' | Browser displays the Kitchen Sink page | - | PASS |
| 3 | Finds the page title element | Page title is visible and contains text | cy.title().should('include', 'Kitchen Sink') verifies page title includes 'Kitchen Sink' | PASS |
| 4 | Test completes and Mochawesome reporter generates HTML and JSON reports in 'cypress/reports' | Report files are created and saved | Report files exist and contain test results | PASS |