0

I code in cypress. Exists something like opposite of cy.contains()? Something like cy.notContains().

I tried:

cy.get('table').should(($table) =>{
            expect($table).to.not.contain("Hello world")
        })

But it does not work. Event if the text wasn't in the table, cypress didn't show any error.

Thank you for your help.

Filipm64
  • 47
  • 7
  • Does this answer your question? [How to do \`cy.notContains(text)\` in cypress?](https://stackoverflow.com/questions/70841070/how-to-do-cy-notcontainstext-in-cypress) – Matt Morgan Jul 19 '22 at 11:22

1 Answers1

-2

just like this -

cy.get('table').not('Hello World')

Reference