2017-04-24 28 views
9

駕駛Nightwatch測試中,我當前使用VUE自動設置nightwatch.js設置。該模板位於此處。通過REPL

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

是否有可能通過類似方式一個REPL中可用webdriver.io命令行運行nightwatch斷言?下面是對webdriver的功能https://twitter.com/webdriverio/status/806911722682544128

+0

我實際上testcafe.js如去nightwatch.js可惜不來接近我從端到端測試工具期待... – phoet

+0

@phoet我們感動的JS WORL到webdriver.io仍然沒有發現任何東西d達到與導軌相同的水平。 – Austio

+0

也試過webdriver,發現testcafe特別好集成。開箱即用或多或少地工作。 – phoet

回答

0

參考您可以使用nightwatch-repl封裝上NPM。

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')); 

一旦你運行測試並調用browser.repl()

你應該看到在控制檯下面

Running: Login to dashboard 

Type in a command (eg: browser.function()) or type "quit" to exit 
repl>