开发者

Automated web UI testing in Node.js

Are开发者_如何转开发 there any automated web testing libraries for Node.js, preferably headless?


Zombie is a headless full-stack testing framework for Node.js.

There's a full list of testing modules on the Node.js GitHub wiki.


You should also check out PhantomJS and CasperJS. Together, it's a testing framework in pure JavaScript with a headless WebKit browser. It works in Linux, OS X and Windows.


Selenium now has JavaScript bindings for Node.js. You can use a headless driver along with the Selenium bindings. (Check out ghostdriver.)

Basically all you have to do is install Node.js, set up your driver and then get your Selenium module with npm selenium-webdriver.

I have some more detailed instructions and screenshots in my tutorial, here.


Selenium WebDriver can use headless mode with a configuration for Chrome:

let { Builder} = require('selenium-webdriver')
let {Options} =require('selenium-webdriver/chrome')

let options = new Options()
let driver = new Builder().forBrowser('chrome').setChromeOptions(options.headless()).build()

By the way, you can also use CukeTest for writing your UI automation script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜