Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
preceptor webdriver config
module.exports = {
"configuration": {
verbose: true,
"reportManager": {
"reporter": [
{ "type": "Spec" },
{ "type": "List", "progress": false }
]
},
plugins: ['preceptor-webdriver'],
},
"tasks": [
{ // Task
"type": "mocha",
"title": "Everything", // Just giving the task a title
"configuration": {
"paths": [__dirname + "/mocha/test1.bundle.js"]
}
},
{ // Preceptor task configuration
"type": "mocha",
"title": "Something Something Visual",
"configuration": {
"paths": [__dirname + "/ui/test1.js"]
},
"decorator": [
{
"type": "webDriver", // Id of this module when registered in Preceptor
"configuration": {
"isolation": true, // Runs in isolation mode
"client": { // Client configuration
"type": "cabbie",
"configuration": {
"mode": "sync"
},
"capabilities": {
"browserName": "firefox"
},
"url": "http://127.0.0.1:4444/wd/hub"
},
"server": { // Server configuration
"type": "selenium"
}
}
}
]
}
]
};
var assert = require('assert');
var cabbie = require('cabbie');
var driver = cabbie('http://127.0.0.1:4444/wd/hub', { }, { mode: "sync", debug: true});
/*
var browser = driver.browser();
var activeWindow = browser.activeWindow();
// Set url and assert a header-text
activeWindow.navigator().setUrl('http://www.example.com');
assert.equal(activeWindow.getElement('h1').getText(), 'Example Domain');
// Click on element
activeWindow.getElement('h1').mouse().click();
// Click on a specific coordinate
activeWindow.mouse().clickAt(500, 200);
// Close active window
activeWindow.close();
driver.dispose();
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment