Test Overview
This test opens a webpage, clicks a button, and captures a screenshot to verify the page state visually.
This test opens a webpage, clicks a button, and captures a screenshot to verify the page state visually.
describe('Screenshot capture test', () => { it('should capture screenshot after button click', () => { cy.visit('https://example.cypress.io') cy.get('a[href="/commands/actions"]').click() cy.screenshot('after-click') cy.get('.action-email').should('be.visible') }) })
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Test runner initialized, no browser opened yet | - | PASS |
| 2 | Browser opens and navigates to 'https://example.cypress.io' | Example Cypress homepage loaded | Page loaded successfully | PASS |
| 3 | Finds link with href '/commands/actions' and clicks it | Navigated to Actions commands page | Link found and clicked | PASS |
| 4 | Captures screenshot named 'after-click' | Screenshot saved in Cypress screenshots folder | Screenshot file created | PASS |
| 5 | Finds input with class '.action-email' and checks visibility | Input field visible on page | Input field is visible | PASS |