【问题标题】:Chimp.js configurationChimp.js 配置
【发布时间】:2016-01-14 13:02:38
【问题描述】:

我正在使用 Chimp.js(带有 Cucumber.js),所有测试都需要通过登录页面。

我知道 webdriverIO 将 testrunner 配置文件用于 .before().after() 之类的东西。

使用 Chimp 实现这一目标的最佳方式是什么?

谢谢!

【问题讨论】:

    标签: javascript testing end-to-end cucumberjs chimp.js


    【解决方案1】:

    您可以将 Cucumber.js before and after hooks 与 Chimp 一起使用:

    // tests/features/clearDatabase.js
    var clearDatabase = function() {
    
      this.Before(function() {
        server.call('/fixtures/clearDatabase');
      });
    
    };
    
    module.exports = clearDatabase;
    

    【讨论】:

    • 最好将此代码放入“tests/features/_support/hooks/before_hooks.js”之类的子文件夹中,因为它不是功能。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-01
    • 1970-01-01
    相关资源
    最近更新 更多