我开发了一些 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 帮助和示例,但我找不到任何关于如何做到这一点的示例或文章。
任何帮助将不胜感激