I am having trouble matching an exact string using the code snippet below. Instead of returning only elements that match the exact string, it is returning all elements with the same substring.
cy.contains('span', 'Apple');
I also attempted to use regex without success:
cy.contains('span', new Regex("^" + "Apple" + "$"))
If anyone can provide assistance with this issue, I would greatly appreciate it. Thank you!