重复测试用Dalek.js编写

时间:2014-09-30 06:53:26

标签: javascript node.js ui-testing

我开发了一些UI测试(使用Phantom.js配置运行)

测试本身非常简单,例如(参见下面的示例代码):

  • 浏览页面 - 确认预期的标题是否正确
  • 单击按钮/项目以从列表中选择项目 - 确认已选择准确项目。

    module.exports = {
       'NodeCeller home page': function (test) {
         test
           .open('http://localhost:3000')
           .assert.title().is('Node Cellar', 'Node Cellar is now open')
           .done();
     },
    
     'NodeCeller Start Browsing Click': function (test) {
         test
        .click('a[href="#wines"]')
        .assert.url('http://localhost:3000/#wines', 'Showing wines selection')
        .done();
      },
    
      'NodeCellar Browse First Wine': function (test) {
         test
            .click('#content > div > ul > li > a')
            .assert.text('legend','Wine Details', 'Showing Wines Details')
            .done();
      },
    };
    

我的问题是,我想在循环中运行相同的测试集多次。 我搜索了Dalek.JS帮助和样本,但我找不到任何样本或文章如何做到这一点。

任何帮助都将受到高度赞赏

0 个答案:

没有答案