Released 12/25/2015
Notes:
- Merry Christmas everyone ;-)
Features:
- Overhauled the entire subsystem dealing with an element's visibility state.
Previously we were using jQuery's
.is(":visible")
selector which was ineffective at truly determining when an element is "visible". Our changes now differ significantly from jQuery, but they match what a real user would consider visible, and the rules are fairly easy to explain. In other words these rules should just "make sense". - An element is considered visible if it can be "interactive" with a user. In other words, if the user is able to click, type, drag, or otherwise physically interact with the element it is considered visible.
- Because of the additional complexities of how Cypress considers an element
visible
, we now have added the exact reason why an element is not visible when throwing an error. This means you'll see errors detailing whether an element or its parents havedisplay: none
,visibility: hidden
, or whether an element is considered hidden because its effectivewidth
orheight
is zero. Whatever the reason, Cypress will indicate why your element is considered hidden. - Exposed
Cypress.Dom.isHidden
which holds the logic for determining an element's visibility. Modify this to change the rules. - Upgraded
.select()
to automatically retry when the<select>
is disabled, its matching<option>
is disabled, or when Cypress cannot find a matching<option>
. This more correctly aligns with the behavior of other actions like.click()
, which automatically retry until the element is ready to receive the action.
Bugfixes:
- Throw on
.select()
when it cannot find a matching<option>
. Also throw when<select>
or a matching<option>
is disabled. Fixes #91. - "Hidden" elements which actually displace height or width are now highlighted when restoring the DOM when a command is hovered.
- Margin on zero client width / client height is now displayed correctly on command hover and more accurately mimics the way Chrome Dev Tools highlights elements.
- Using
history.back
,history.forward
, orhistory.go
in CI or in headless mode now works again.
Misc:
- The updated hidden rules apply to all assertions like
should("be.hidden")
, and how Cypress indicates an element is hidden displays in the Command Log. - Updated many error messages to be more explanatory and precise.
- Elements which are stringified during errors now indicate their text content
(truncated to 10 characters)
<button>Save</button>
or whether they contain children elements by indicating an ellipsis<div>...</div>
. - The Routes instrument panel now displays the column:
Stubbed
instead ofStatus
, which indicates whether a route is stubbing matching XHR's.