jeudi 18 juin 2020

What's the right way to check if an input has a value less than x in Cypress?

I'm trying to check if an has a value of less than x. What's the best way to test that in Cypress?

Example code (that doesn't work):

cy.get('.number-input').type('200').should('have.value.lt', '201')

I know I could do this with a callback, but that seems a bit messy, especially given how neat it is to test if the input is -exactly- something:

cy.get('.number-input').type('200').should('have.value', '200')

Aucun commentaire:

Enregistrer un commentaire