Answers for "how to get console text in cypress"

0

how to get console text in cypress

cy.visit('/', {
  onBeforeLoad(win) {
    cy.stub(win.console, 'log').as('consoleLog')
  },
})

//...
cy.get('@consoleLog').should('be.calledWith', 'Hello World!')
Posted by: Guest on July-06-2021

Browse Popular Code Answers by Language