Recs.
Updated
Specs
Pros
Pro Works with any testing framework or assertion library
WebdriverIO lets you use your favorite testing framework (Jasmine, Mocha, Cucumber) and assertion library (Chai for Mocha). Other projects implement their own testing and assertion APIs, for example Nightwatch, Intern.
It should be mentioned though that v4.2.16 has an incompatibility with at least tap v7.1.2: stdout/stderr written during a run gets lost.
Pro Used by Chimp.js
Chimp.js, is an emerging web application test framework that implements easy sync tests using WebdriverIO, CucumberJS and Chai. Features include:
- synchronous style
- built-in "widget framework" (an implementation of the PageObject pattern)
- automatically downloads dependencies (ChromeDriver, PhantomJS etc.)
- works with SauceLabs and BrowserStack (CrossBrowserTesting TBD)
- automatically takes screenshots on failures
- works on Windows in addition to Linux and OS X
- automatically produces boilerplate code for step definitions, which you can copy, paste and edit
- file watcher reuses the browser sessions and can run only the tests you tag, to maximize development speed
Pro Simpler syntax than selenium-webdriverjs and WD.js
selenium-webdriverjs:
driver.get('http://www.google.com');
driver.findElement(webdriver.By.id('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.id('btnG')).click();
WD.js:
browser
.get("http://www.google.com")
.elementById('q')
.sendKeys('webdriver')
.elementById('btnG')
.click()
WebdriverIO:
client
.url('http://google.com')
.setValue('#q','webdriver')
.click('#btnG')
Pro Used by Meteor's Velocity test runner
If you develop web applications with Meteor.js, you might want to use the xlovio:webdriver wrapper, because it's the Selenium binding behind the preferred testing framework (Chimp) promoted by the Velocity (Meteor's official testing framework) team for using BDD via Cucumber.
Pro Selenium Server need not be started independently
Service is provided by WebdriverIO which over comes the con of starting selenium server independently.
Reference: http://webdriver.io/guide/services/selenium-standalone.html
Cons
Con Selenium server must be started independently
selenium-webdriverjs starts the Selenium server automatically, and actually manages to achieve a faster startup time (4 seconds vs. 5.5) than WebdriverIO.
Recommendations
Comments
Out of Date Pros + Cons
Con Unclear PageObject documentation
PageObject is a very useful pattern for making tests more robust when the UI changes. WebdriverIO doesn't yet have clear documentation on PageObjects but keep an eye on this issue.
Con No sync interface yet
There's a workaround using yield
, which kinda amounts to sync usage.
However, check out Chimp.js, a web app test framework that implements sync tests using WebdriverIO and CucumberJS.