Skip to content
  1. Oct 24, 2013
  2. Oct 17, 2013
  3. Oct 16, 2013
    • Jonathan Hedstrom's avatar
      Merge pull request #17 from bevanr/autocomplete-support · 4ce2d603
      Jonathan Hedstrom authored
      Add support for Drupal autocomplete form elements.
      4ce2d603
    • Bevan Rudge's avatar
      Fix typo in "closint" · ba3f67ac
      Bevan Rudge authored
      ba3f67ac
    • Bevan Rudge's avatar
    • Bevan Rudge's avatar
    • Bevan Rudge's avatar
      Add support for Drupal autocomplete form elements. · 8a98a094
      Bevan Rudge authored
      Drupal's autocomplete is awfully incompatible with Mink.  While it is easy to open an autocomplete suggestion box with `setValue()` or '_I fill in "LABEL" with "VALUE"_', it is impossible to close the resulting autocomplete suggestion box without writing tricky custom code or something really ugly like '_Press "save", Wait for one second, Press "save"_'.
      
      And if the autocomplete suggestion boxes are not closed, then form-submission fails, because they are blocked by Drupal's `autocomplete.js`.
      
      This patch introduces two methods to improve the situation:
      
      1.  `pressButton($button)` overrides `MinkExtension->pressButton()` to call `wait()` before passing execution back to `MinkExtension->pressButton()`.  `wait()` uses a javascript condition parameter that waits for any `#autocomplete` suggestion boxes to close.  If there are none open, Mink will not wait, so there is no performance impact for pages that don't ever open an autocomplete suggestion list.
      
          This new method duplicates the features of the existing method `assertPressButton()`, so I have deleted that one, and included the corresponding `@When` step definition in the new method.
      
      2.  `pressKey($char, $field)` allows a key to be "pressed" on a field.  Special keys like escape, enter and tab are supported.  Support for other special keys would be useful.  This is necessary to allow autocomplete suggestion boxes to be closed.  If they are not closed, then the `wait()` in `pressButton()` will time out and corresponding form-submit will get blocked by Drupal's `autocomplete.js`.
      
          > NOTE once https://github.com/Behat/Mink/pull/345 is merged we can detect whether there are still any autocomplete boxes open by evaluating `wait()`'s return value.  We should do that and possibly even throw an exception or warning if there are boxes that are still open.
      
          The step definition for the new method is `/^(?:|I )press the "([^"]*)" key in the "([^"]*)" field$/`.  E.g.
          > And I press the "Esc" key in the "LABEL" field
      8a98a094
  4. Oct 05, 2013
  5. Sep 27, 2013
  6. Sep 26, 2013
  7. Sep 20, 2013
  8. Sep 19, 2013
  9. Sep 18, 2013
  10. Sep 11, 2013
  11. Sep 03, 2013
  12. Aug 31, 2013
  13. Aug 30, 2013
  14. Aug 29, 2013
  15. Aug 15, 2013
  16. Aug 13, 2013
  17. Aug 12, 2013
  18. Aug 07, 2013
  19. Aug 06, 2013
  20. Aug 03, 2013
  21. Aug 02, 2013