Cy events

Cypress test runner fires events you can subscribe to. For example, we can listen to the command start and finish events. See the full Cypress Catalog of Eventsopen in new window for more.

cy.on('command:start', (cmd) => {
  console.log('started command', cmd)
})
cy.wrap('hello').should('equal', 'hello')

Cypress command start event

Tip: I used these events to log all commands and their arguments in my cypress-failed-logopen in new window plugin.