Skip to content

1.6.0

Compare
Choose a tag to compare
@stof stof released this 26 Sep 11:00
· 229 commits to master since this release

The main focus of this release is ensuring consistency between all driver implementations.

BC breaks

  • The named selector now prefers exact matches over partial matches. Use the named_partial selector if you want to force doing a partial match.
  • NodeElement::getValue for checkboxes now returns the value of the field when checked and null otherwise rather than the checked state (use NodeElement::isChecked for that)
  • Removed the wrapping of any driver-level exception in a MinkException on invalid usage as it was making the code too complex

Deprecations

  • Element::getSession has been deprecated and will be removed in 2.0. Code needing the session should get it from outside rather than from the element.

New features

  • Changed NodeElement::setValue to support any fields rather than only input elements
  • Added Element::getOuterHtml to get the HTML code of the element including itself
  • Added Element::waitFor to allow retrying some code until it succeeds or the timeout is reached
  • Added Element::isValid to check whether an element still exists in the page
  • Added Session::getWindowName and Session::getWindowNames to get the name of the current and of all windows
  • Added Session::maximizeWindow to maximize the window
  • Added NodeElement::isSelected to check whether an <option> is selected
  • Added NodeElement::submitForm to allow submitting a form without using a button
  • Added assertions about the value of an attribute
  • Changed Session::wait to return the condition value rather than nothing
  • Added the anchor in the assertion on the URL in WebAssert
  • Introduced Behat\Mink\Selector\Xpath\Escaper to allow reusing the XPath escaping. When building your own XPath, using it is prefered over accessing the SelectorsHandler for forward-compatibility with 2.0 (using the SelectorsHandler to escape the locator passed to the named selector is fine as this escaping will need to be removed in 2.0)

Removal

  • Removed hasClass from DocumentElement (instead of triggering a fatal error when it is used)

Bug fixes

  • Fixed the XPath prefixing when searching inside an existing element
  • Fixed the matching of the input type in the named selector to be case insensitive according to the HTML spec
  • Fixed the name selectors to match on the placeholder only for textual inputs
  • Fixed NodeElement::getTagName to ensure that the tag name is lowercase for all drivers
  • Fixed Element::hasAttribute to ensure it supports attributes with an empty value
  • Fixed the field selector to avoid matching inputs with the type submit or reset
  • Changed the button XPath selection to accept reset buttons as well
  • Enforced consistent behavior for drivers on 4xx and 5xx response to return the response rather than throwing an exception
  • Made Session::executeScript compatible across drivers by ensuring they all support the same syntaxes for the JS expression
  • Made Session::evaluateScript compatible across drivers by ensuring they all support the same syntaxes for the JS expression
  • Changed ElementNotFoundException to extend from ExpectationException

Testsuite

  • Refactored the driver testsuite entirely and expand it to cover drivers entirely (covering many more cases to ensure consistency)
  • Added testing on HHVM