Closed JonahKK closed 3 years ago
Cypress uses a modified jQuery selector, so you'd have to do what you would do in jQuery to find backslashes in selectors, which apparently means that you need to write four backslashes for every backslash you want to find in the app.
So:
testValue\
testValue\\
'testValue\\\\'
index.html
<html>
<body>
<button>testValue\</button>
</body>
</html>
spec.js
it('fails', () => {
cy.visit('index.html')
cy.contains('testValue\\\\')
})
Current behavior
If searched text has backslash (
\
) at the end, thecy.contains
command ends withDesired behavior
cy.contains
should search for a text with the backslash at the end.Test code to reproduce
Versions
Tested on newest 6.3.0.