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

Teach behat to wait for JQuery ajax request to finish

    XMLWordPrintable

    Details

    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51311-master

      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

              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  16/Nov/15