Skip to content

Instantly share code, notes, and snippets.

@nzjames
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzjames/a48f6674199962210158 to your computer and use it in GitHub Desktop.
Save nzjames/a48f6674199962210158 to your computer and use it in GitHub Desktop.
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