Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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!')
Source by docs.cypress.io #
 
PREVIOUS NEXT
Tagged: #console #text #cypress
ADD COMMENT
Topic
Name
5+8 =