【问题标题】:How to load the pollUntil helper in Intern 2 functional tests如何在 Intern 2 功能测试中加载 pollUntil 助手
【发布时间】:2014-08-26 10:43:51
【问题描述】:

intern 2 文档给出了以下示例,在加载后等待测试页面上的条件为真:

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

不幸的是,它没有解释如何加载 pollUntil 帮助程序以便在前面的示例中使用它...有人有使用 pollUntil 的完整工作示例吗?

感谢您的帮助。

【问题讨论】:

    标签: javascript testing functional-testing intern


    【解决方案1】:

    我想我找到了答案:它通过加载模块 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) {
    

    【讨论】:

      【解决方案2】:

      实习生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;
      
      });
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-05-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多