I'm using Cypress to test a form which has an input of type="submit". When I select the element with
cy.contains('Submit new data')
it works, but when I use a regex
cy.contains(/Submit new data/)
I get error expected to find content: '/Save Changes/'.
Can anyone help me, what is the problem with using regex in .contains().