2.0.1 • Published 5 years ago

unexpected-webdriver v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Build Status

unexpected-webdriver

A plugin for unexpected that adds assertions for the official WebDriver bindings from the Selenium project.

Unexpected Webdriver

Assertions

  • <WebElement> to exist
  • <WebElement> to be visible
  • <WebElement> to contain text <string+|regexp>
  • <WebElement> to contain html <string+|regexp>
  • <WebElement> [not] to have attribute <string>
  • <WebElement> to have attribute <string> <string>

Options

  • screenshots: Directory path, used to take a screenshot whenever a assertion fails.

Example

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

Credits

Thanks to Bowery Boogie for their permission to use the photo of Rickshaw Spidey performing his unexpected moves.

2.0.1

5 years ago

2.0.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago