Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some refactor around test launchs
- Loading branch information
Showing
4 changed files
with
100 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
var wd = require('wd'); | |||
var async = require('async'); | |||
|
|||
module.exports = browse; | |||
function browse(url, desired, remoteCfg, cb) { | |||
if (typeof remoteCfg === 'function') { | |||
cb = remoteCfg; | |||
remoteCfg = undefined; | |||
} | |||
|
|||
var browser = wd.remote(remoteCfg); | |||
|
|||
// browser.on('status', logStatus); | |||
// browser.on('command', logCommand); | |||
|
|||
async.series([ | |||
browser.init.bind(browser, desired), | |||
wait4(100), | |||
browser.get.bind(browser, url), | |||
wait4(1000) | |||
], function(err) { | |||
cb(err, browser); | |||
}); | |||
} | |||
|
|||
function logStatus(info) { | |||
console.log('\x1b[36m%s\x1b[0m', info); | |||
} | |||
|
|||
function logCommand(meth, path) { | |||
console.log(' > \x1b[33m%s\x1b[0m: %s', meth, path); | |||
} | |||
|
|||
function wait4(ms) { | |||
return wait.bind(null, ms); | |||
} | |||
|
|||
function wait(ms, cb) { | |||
setTimeout(cb, ms); | |||
} |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
[{ | |||
"browserName": "internet explorer", | |||
"version": "9" | |||
}, { | |||
"browserName": "internet explorer", | |||
"version": "8" | |||
}, { | |||
"browserName": "firefox" | |||
}, { | |||
"browserName": "chrome" | |||
}] |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
[{ | |||
"browserName": "internet explorer", | |||
"version": "9" | |||
}, { | |||
"browserName": "internet explorer", | |||
"version": "8" | |||
}, { | |||
"browserName": "internet explorer", | |||
"version": "7", | |||
"platform": "Windows 2003" | |||
}] |
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