实习生 2 文档给出了以下示例,在加载后等待测试页面上的条件为真:
this.remote
.get(require.toUrl('./SomeTest.html'))
.then(pollUntil('return window.ready;', 5000));
不幸的是,它没有解释如何加载 pollUntil 帮助程序以便在前面的示例中使用它......有人有一个使用 pollUntil 的完整工作示例吗?
谢谢你的帮助。
最佳答案
我想我找到了答案:它通过加载模块 intern/dojo/node!leadfoot/helpers/pollUntil
来工作,如:
define([
'intern!object',
'intern/chai!assert',
'intern/dojo/node!leadfoot/helpers/pollUntil',
'../Request',
'require'
], function (registerSuite, assert, pollUntil, Request, require) {
关于javascript - 如何在 Intern 2 功能测试中加载 pollUntil 助手,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24585377/