Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51311

Teach behat to wait for JQuery ajax request to finish

    XMLWordPrintable

Details

    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • MDL-51311-master
    • Hide

      Apply this patch:

      diff --git a/tag/classes/external.php b/tag/classes/external.php
      index ee8f1a0..c514df0 100644
      --- a/tag/classes/external.php
      +++ b/tag/classes/external.php
      @@ -98,6 +98,7 @@ class core_tag_external extends external_api {
                           unset($tag['rawname']);
                       } else {
                           $tag['name'] = core_text::strtolower($tag['rawname']);
      +                    sleep(5);
                       }
                   }
                   if (!$canmanage) {
      

      Make sure the behat test "Renaming the tag using quick edit field on tag manage page" from tag/tests/behat/edit_tag.feature passes

      Show
      Apply this patch: diff --git a/tag/classes/external.php b/tag/classes/external.php index ee8f1a0..c514df0 100644 --- a/tag/classes/external.php +++ b/tag/classes/external.php @@ -98,6 +98,7 @@ class core_tag_external extends external_api { unset($tag['rawname']); } else { $tag['name'] = core_text::strtolower($tag['rawname']); + sleep(5); } } if (!$canmanage) { Make sure the behat test "Renaming the tag using quick edit field on tag manage page" from tag/tests/behat/edit_tag.feature passes

    Description

      As we start adding behat tests for the pages that use JQuery AJAX requests we start hitting behat failures when it asserts something before the ajax request finishes.

      Example:
      https://tracker.moodle.org/browse/MDL-50919?focusedCommentId=369270&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-369270

      I will add "wait 2 seconds" in that test but it has to be resolved in behat similar to current spinning and waiting for YUI

      Search the code for MDL-51311 and address all TODOs

      Attachments

        Issue Links

          Activity

            People

              damyon Damyon Wiese
              marina Marina Glancy
              Adrian Greeve Adrian Greeve
              Andrew Lyons Andrew Lyons
              Andrew Lyons Andrew Lyons
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                16/Nov/15