Cypress pipe console.log and command log to output

As of Cypress 3.0.0, you can use cy.task() to access node directly and output to the node console. From the docs:

// in test
cy.task('log', 'This will be output to the terminal')
// in plugins file
on('task', {
  log (message) {
    console.log(message)
    return null
  }
})

See here for more info.

I don’t know of a way to mirror the Cypress logs to the console directly, but this is at least a workable alternative.

Leave a Comment