通过REPL驾驶Nightwatch测试

Aus*_*tio 8 selenium nightwatch.js

我目前使用vue自动设置进行nightwatch.js设置.该模板位于此处.

https://github.com/vuejs-templates/webpack/tree/master/template/test/e2e

是否可以通过命令行以类似于webdriver.io中提供的REPL方式运行nightwatch声明?以下是对webdriver功能的参考https://twitter.com/webdriverio/status/806911722682544128


更新,我们已经开始使用Cypress.io它让我们非常高兴

Yoh*_*ann 0

您可以使用nightwatch-replNPM 上提供的包。

https://www.npmjs.com/package/nightwatch-repl

// nightwatch.conf.js

var repl = require('nightwatch-repl');

module.exports = (function (settings) {
    repl.init(settings);
    ...
    ...
    return settings;
})(require('./nightwatch.json'));
Run Code Online (Sandbox Code Playgroud)

运行测试并调用 browser.repl() 后

您应该在控制台中看到以下内容

Running:  Login to dashboard

Type in a command (eg: browser.function()) or type "quit" to exit
repl>
Run Code Online (Sandbox Code Playgroud)