1 | ![Cabbie](logo.png)
|
2 |
|
3 | # Cabbie
|
4 |
|
5 | A node web-driver client
|
6 |
|
7 | [![Build Status](https://img.shields.io/travis/ForbesLindesay/cabbie/master.svg)](https://travis-ci.org/ForbesLindesay/cabbie)
|
8 | [![Selenium Test Status](https://saucelabs.com/buildstatus/cabbie)](https://saucelabs.com/u/cabbie)
|
9 | [![Dependency Status](https://img.shields.io/david/ForbesLindesay/cabbie.svg)](https://david-dm.org/ForbesLindesay/cabbie)
|
10 | [![NPM version](https://img.shields.io/npm/v/cabbie.svg)](https://www.npmjs.com/package/cabbie)
|
11 |
|
12 | ## Installation
|
13 |
|
14 | npm install cabbie
|
15 |
|
16 | ## Usage
|
17 |
|
18 | See "docs/api" for full API reference.
|
19 |
|
20 | ```js
|
21 | var assert = require('assert');
|
22 | var cabbie = require('cabbie');
|
23 |
|
24 | var driver = cabbie('http://localhost:4444/wd/hub', { browserName:'firefox' }, { mode: cabbie.Browser.MODE_SYNC });
|
25 | var browser = driver.browser();
|
26 | var activeWindow = browser.activeWindow();
|
27 |
|
28 | // Set url and assert a header-text
|
29 | activeWindow.navigator().setUrl('http://www.example.com');
|
30 | assert.equal(activeWindow.getElement('h1').getText(), 'Example Domain');
|
31 |
|
32 | // Click on element
|
33 | activeWindow.getElement('h1').mouse().click();
|
34 |
|
35 | // Click on a specific coordinate
|
36 | activeWindow.mouse().clickAt(500, 200);
|
37 |
|
38 | // Close active window
|
39 | activeWindow.close();
|
40 |
|
41 | driver.dispose();
|
42 | ```
|
43 |
|
44 | ## Object Reference
|
45 |
|
46 | ![Object Reference](objectReference.png)
|
47 |
|
48 |
|
49 | ## License
|
50 |
|
51 | MIT
|
52 |
|
53 |
|
54 | ## Attribution
|
55 | <div>Icon made by <a href="http://www.icons8.com" title="Icons8">Icons8</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed under <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0">CC BY 3.0</a></div>
|