Other
You can use your own selenium webdriver server. You will need to know the url of your webdriver server before you can get started. If your webdriver server takes basic authentication, you can pass that in the url (e.g. https://username:[email protected]
).
import assert from 'assert';
import cabbie from 'cabbie-sync';
// connect to your selenium server, adding {debug: true} makes cabbie log each method call.
const driver = cabbie('https://username:[email protected]', {debug: true});
try {
// navigate to a url in the currently active window
driver.activeWindow.navigateTo('http://example.com');
// get an element, and check that its text equals some expected value
assert.equal(
driver.activeWindow.getElement('h1').getText(),
'Example Domain',
);
} finally {
// whether tests pass or fail, dispose of the driver
driver.dispose();
}