Test Overview
This test uses Cypress with a code coverage plugin to check if the homepage loads and the main heading is visible. It verifies that the heading text matches the expected value and that code coverage data is collected during the test.
This test uses Cypress with a code coverage plugin to check if the homepage loads and the main heading is visible. It verifies that the heading text matches the expected value and that code coverage data is collected during the test.
/// <reference types="cypress" /> describe('Homepage Code Coverage Test', () => { beforeEach(() => { cy.visit('https://example.cypress.io') }) it('checks main heading and collects coverage', () => { cy.get('h1').should('be.visible').and('contain', 'Kitchen Sink') }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Cypress test runner initialized with code coverage plugin enabled | - | PASS |
| 2 | Browser opens | Browser window opens controlled by Cypress | - | PASS |
| 3 | Navigates to 'https://example.cypress.io' | Page loads with homepage content | Page URL is correct | PASS |
| 4 | Finds element 'h1' | Main heading element is present and visible | Element 'h1' is visible | PASS |
| 5 | Checks that 'h1' contains text 'Kitchen Sink' | Heading text matches expected | Text content contains 'Kitchen Sink' | PASS |
| 6 | Code coverage plugin collects coverage data during test | Coverage data recorded for visited code | Coverage data exists and is valid | PASS |