簡體   English   中英

如何在 Intern 2 功能測試中加載 pollUntil 助手

[英]How to load the pollUntil helper in Intern 2 functional tests

實習生 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) {

實習生 4 用途

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;

});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM