Error message in cypress shows the whole DOM when an element is not found
dom-testing-libraryversion: 3.12.3cypress-testing-libraryversion: 2.3.3cypressversion: 3.1.2
What you did:
Made a test fail to find an element with cy.getByText
What happened:
Error message is showing the whole DOM which clutters the log
Problem description:
It seems like there is a boolean check for cypress environment in the source code here but it's not working.
Suggested solution:
Changing this line to
const inCypress = global.Cypress works on my local.
I'm not sure if this line worked before but window is undefined in cypress 3.1.2. Maybe cypress doesn't expose the window variable anymore.
I could change it to const inCypress = (typeof window !== 'undefined' && window.Cypress) || global.Cypress to keep it backward compatible.
I'll have a new PR addressing this issue with the above code changes if it was intended to hide the DOM for cypress environment.
:tada: This issue has been resolved in version 3.12.4 :tada:
The release is available on:
npm package (@latest dist-tag)- GitHub release
Your semantic-release bot :package::rocket: