当前位置:  开发笔记 > 编程语言 > 正文

CucumberJS - 错误:在Timer.listOnTimeout(timers.js:92:15)5000毫秒后步进超时

如何解决《CucumberJS-错误:在Timer.listOnTimeout(timers.js:92:15)5000毫秒后步进超时》经验,为你挑选了1个好方法。



1> Jérémie Chaz..:

添加此项以删除5000毫秒:

protractor.conf.js

cucumberOpts: {
    require: [
        'tests/e2e/support/env.js',
        'main.step.js',
        ...
    ],
    format: 'pretty', // or summary
    keepAlive: false
},

env.js

var configure = function () {
    this.setDefaultTimeout(60 * 1000);
};

module.exports = configure;

例如:

test.feature

Feature: test
    I want test wait

    Scenario: Test call wait
        Given I wait "6" seconds

main.step.js

module.exports = function () {
    this.World = require(__base +'tests/e2e/support/world.js').World;

    // I wait "{time}" seconds
    this.Given(/^I wait "?([^"]*)"? seconds$/, function (time) {
        return browser.sleep(time * 1000);
    });

};

world.js

var World, chai, chaiAsPromised;

chai             = require('chai');
chai_as_promised = require('chai-as-promised');

World = function World (callback) {
    chai.use(chai_as_promised);

    this.expect = chai.expect;

    callback();
};

module.exports.World = World;

推荐阅读
可爱的天使keven_464
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有