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

Detect when Javascript loading and ajax requests finishes

XMLWordPrintable

      Behat tests requires specific elements to be available in the DOM to interact with them, some of them are added to the DOM through JS (for example the activity chooser links) Right now we wait for the element to be available and after that we interact with it, but having a M.util.pagejsloaded (or whatever globally accessible) would:

      • Avoid problems when creating new features, as the availability of the elements would be already managed in a before-step hook
      • Allow us to remove some hardcoded "wait x seconds" steps added when there was no other way to ensure an element is available
      • Speed up tests executions, as there are less xpath queries to run

      The same happens with AJAX requests, right now we just wait hardcoding how much we wait according to the request process time, a M.util.ajaxrequestfinished (if it is only used by behat, with a single var that we can reset it would be enough) Talking with Sam it can be archived with a Y.on('io:end', function_that_sets_the_global_js_var, this, true)

            damyon Damyon Wiese
            dmonllao David Monllaó
            Dan Poltawski Dan Poltawski
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.