-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Current behavior
It seems that both Cypress 7 & 8 changed the return value for Element.getAttribute from null to empty string when the attribute doesn't exist in Chrome. This occurred when executing on a returned element from a document body event listener.
This is different from the return value chrome gives when running without cypress
Desired behavior
Expected cypress to continue to follow the respective browser's implementation. In the case of chrome, currently they return null when the attribute doesn't exist. This is observed in Cypress 6 (tested on both 6.4.0 & 6.9.1)
This is only a problem when Cypress is controlling chrome. Haven't tested other browsers / electron.
Test code to reproduce
https://github.com/endercrest/cypress-getattribute
Steps:
- Install dependencies (
yarn) - Start the server (
yarn start) - Start cypress
Defaults to Cypress 8.0.0, which is broken. If ran on cypress 6.9.1 it works as expected.
react-router.js.-.8.0.0.mp4
react-router.js.mp4
Cypress Version
8.0.0
Other
Chrome: Version 92.0.4515.107 (Official Build) (x86_64)