1. 27 Feb, 2014 3 commits
    • David Monllaó's avatar
    • David Monllaó's avatar
      MDL-43738 behat: Normalization and major refactoring of getters and setters · c3f1e953
      David Monllaó authored
      Every single step that sets or gets a value from a field
      has been updated to follow the same behaviour both when
      using it through a single step or through generic steps
      like "I fill the moodle form with:", to resume all the
      - Created a behat_form_group to re-guess the field type
        and act appropriately setting and getting it's value
      - Normalize all getters and setters to use behat_form_field
      - Complete behat_form_checkbox to trigger the appropiate JS
        event needed to perform some JS scripts that are listening
      - Refactor MDL-43713 multi-select changes and remove
        the two new steps introduced there as that behaviour can
        be managed from the generic getter
      - Added a new step definition to check a capability permission
        as we changed the way radio buttons gets it's value
    • Eloy Lafuente's avatar
      MDL-43713 behat: improve multi-select support · 5f66d46e
      Eloy Lafuente authored and David Monllaó's avatar David Monllaó committed
      This patch implements:
      1) Normalization of options. Before the patch options
      in a select were being returned as "op1 op2 op3" by selenium
      and "op1 op2 op3" by goutte. With the patch, those lists
      are always returned like "op1, op2, op3". If real commas are
      needed when handling multiple selects they should
      be escaped with backslash in feature files.
      2) Support for selecting multiple options. Before the patch
      only one option was selected and a new selection was cleaning the
      previous one. With the patch it's possible to pass "op1, op2" in
      these steps:
        - I fill the moodle form with (table)
        - I select "OPTION_STRING" from "SELECT_STRING"
      3) Ability to match multiple options in this steps. Before the
      patch matching of multiple was really random, now every every
      passed option ("opt1, opt2") is individually verified. It applies
      to these 2 steps:
        - the "ELEMENT" select box should contain "OPTIONS"
        - the "ELEMENT" select box should not contain "OPTIONS"
      4) Two new steps able to verify if a form have some options selected or no:
        - the "ELEMENT" select box should contain "OPTIONS" selected
        - the "ELEMENT" select box should contain "OPTIONS" not selected
      5) Change get_value from xpath search to Mink's getValue() that is immediate
      (does not need form submission) and works for all browsers but Safari, that
      fails because of the extra ->click() issued.
      Note all the changes 1-4 only affect to multi-select fields. Single
      selects should continue working 100% the same.
      The change 5) causes Safari to fail. The problem has been traced down to
      the extra ->click() present there. Anyway there are not test cases
      requiring that "immediate" evaluation right now. Only the special feature
      file attached verifies it.
  2. 03 Feb, 2014 1 commit
    • David Monllaó's avatar
      MDL-43951 behat: Fixing random failure · 405cdd04
      David Monllaó authored
      NodeElement->hasAttribute() (JS enabled) queries selenium
      about whether it has any attribute or not, if due to an
      AJAX request the field node changed selenium can not access
      that node and throws an exception.
  3. 03 Jan, 2014 1 commit
  4. 12 Dec, 2013 1 commit
  5. 06 Dec, 2013 1 commit
    • David Monllaó's avatar
      MDL-42625 behat: Step definitions + related changes in features · d1e55a47
      David Monllaó authored
      In general aiming for compatibility with multiple browsers,
      firefox, chrome and phantomjs to be more specific.
      * Removing hardcoded waits
      * Adding @_alert, @_switch_window and @_switch_frame tags,
        to label actions that different drivers have problems with.
      * Adding missing @_files_upload and @_only_local tags to features that
        uploads files.
      * Fixing a few wait for page ready what specified miliseconds.
      * New methods to ensure elements (usual selectors), sections and editors
        are ready to interact with
      * Changing the select an option implementation to deal with the different
        drivers implementations when listening to JS events.
  6. 19 Jul, 2013 1 commit
    • David Monllaó's avatar
      MDL-39635 behat: XPath cleanups · 38976081
      David Monllaó authored
      - Escaping steps arguments redirected to other steps
      - Adding normalized-space() in all contains() assertions
      - General xpaths review
      - Convering provided xpath text strings to xpath literals
        to avoid problems with arguments containing both single
        quotes and double quotes
  7. 09 May, 2013 1 commit
  8. 03 May, 2013 1 commit
  9. 29 Jan, 2013 5 commits