Test Overview
This test checks a custom Cypress plugin that logs a message before the test run. It verifies the plugin runs and the log appears in the console.
This test checks a custom Cypress plugin that logs a message before the test run. It verifies the plugin runs and the log appears in the console.
/// <reference types="cypress" /> // cypress/plugins/index.js module.exports = (on, config) => { on('before:run', () => { console.log('Custom plugin: Test run is starting'); }); }; // cypress/e2e/sample_spec.cy.js describe('Custom Plugin Test', () => { it('should run a simple test and trigger plugin log', () => { cy.visit('https://example.cypress.io'); cy.contains('type').click(); cy.url().should('include', '/commands/actions'); }); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Cypress test runner starts and loads plugins | Cypress initializes and loads cypress/plugins/index.js | - | PASS |
| 2 | Custom plugin logs message before test run | Console shows 'Custom plugin: Test run is starting' | Verify console log message appears | PASS |
| 3 | Test visits https://example.cypress.io | Browser opens example Cypress page | - | PASS |
| 4 | Test clicks on link containing text 'type' | Page navigates to /commands/actions | URL includes '/commands/actions' | PASS |
| 5 | Assertion checks URL contains '/commands/actions' | URL is https://example.cypress.io/commands/actions | cy.url().should('include', '/commands/actions') | PASS |