Last active
August 29, 2015 14:18
-
-
Save nzjames/a48f6674199962210158 to your computer and use it in GitHub Desktop.
preceptor webdriver config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} | |
} | |
} | |
] | |
} | |
] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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