Home > Mobile >  Get smaller log messages on cypress
Get smaller log messages on cypress

Time:01-14

I want to convert the cypress messages to a smaller string, for example:

Cypress log

Cypress log

Be converted to:

-assert expected #buy-price-field to have value 17,169.00.

How can I do it?

I read the document but I can't find somethings that can solve my problem.

CodePudding user response:

Instead of short form cy.get('input').should('have.value', '17,169.00') use callback form.

Something like

cy.get('input')
  .should($el => {
    const message = 'expected #buy-price-field to have value 17,169.00`
    expect($el.val(), message).to.eq('17,169.00')
  })
  • Related