selenium-webdriver plugin for the unexpected assertion libary
npm install unexpected-webdriver
A plugin for unexpected that adds assertions for the
official WebDriver bindings
from the Selenium project.
*
*
*
*
*
*
screenshots: Directory path, used to take a screenshot whenever a assertion fails.``js
const webdriver = require('selenium-webdriver');
const expect = require('unexpected');
expect.use(require('unexpected-webdriver')({
screenshots: __dirname
}));
const driver = new webdriver.Builder().forBrowser('firefox').build();
const el = driver.findElement({ id: 'hello' });
expect(el, 'to contain text', 'Hello World');
``
Thanks to Bowery Boogie for their permission to use the photo of Rickshaw Spidey performing his unexpected moves.