How to load the pollUntil helper in Intern 2 functional tests
Asked Answered
B

2

6

The intern 2 documentation gives the following example of waiting for a condition to be true on a test page after loading it:

this.remote
    .get(require.toUrl('./SomeTest.html'))
    .then(pollUntil('return window.ready;', 5000));

Unfortunately, it doesn't explain how to load the pollUntil helper in order to use it in the previous example... Does anybody have a complete working example that uses pollUntil ?

Thanks for your help.

Broach answered 5/7, 2014 at 10:20 Comment(0)
B
6

I think I found the answers: it works by loading module intern/dojo/node!leadfoot/helpers/pollUntil, as in:

define([
    'intern!object',
    'intern/chai!assert',
    'intern/dojo/node!leadfoot/helpers/pollUntil',
    '../Request',
    'require'
 ], function (registerSuite, assert, pollUntil, Request, require) {
Broach answered 5/7, 2014 at 10:49 Comment(0)
G
1

intern 4 uses

define([
  'dojo/request',
  'dojo/node!@theintern/leadfoot/helpers/pollUntil'
], 
function(request, _pollUntil) { 

   var pollUntil = _pollUntil.default;
   var registerSuite = intern.getInterface('object').registerSuite;
   var assert = intern.getPlugin('chai').assert;

});
Groomsman answered 8/2, 2020 at 2:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.