How to create a funciton in cypress that looks for "not contains" words?

Viewed 4070

I want to test the search filter in screen. When I enter the word in the search bar, I want to see that it words that only contains entered. I can not find a function that provide in Cypress

2 Answers

You could easily use the not.contain option. Syntax would be like this:

cy.get('element').should('not.contain', 'value_it_should_not_contain')
cy.get('[class^=Input_error]').should('not.have.text', 'Insufficient');
Related