I want to compare two different variables in Cypress, and expect them to be equal using:
expect(var1).equal(var2), however I'm not able to properly gather span value from it, as in example of HTML below.
HTML
<div >
<a title>
<span>Title I want to compare</span>
</a>
</div>
I want to get only "Title I want to compare" value, but when I define it in Cypress I get following error:
<failure message="expected { Object (userInvocationStack, specWindow, ...) } to equal { Object (userInvocationStack, specWindow, ...) }" type="AssertionError"><