-
Notifications
You must be signed in to change notification settings - Fork 10
/
android-chrome.js
45 lines (38 loc) · 1.11 KB
/
android-chrome.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
var wd = require('wd')
, assert = require('assert')
, colors = require('colors');
module.exports = function(port, cb) {
var browser = wd.remote('localhost', port);
browser.on('status', function(info) {
console.log(info.cyan);
});
browser.on('command', function(meth, path, data) {
console.log(' > ' + meth.yellow, path.grey, data || '');
});
/*
* This test loads up Fil's homepage, checks that the title matches
* some standard expectation, clicks on a link labeled "CV" and
* expects that the address bar contains "cv.html".
*/
var error = function(msg, err) {
console.error(msg, err);
browser.quit();
}
browser.init({
deviceName:'Nexus 5',
platformName:'Android',
browserName:'Chrome',
}, function(err) {
if (err) error('error initing', err);
else browser.get("http://filmaj.ca", function(err) {
if (err) error('error getting url', err);
else browser.title(function(err, title) {
if (err) error('error getting title', err);
else browser.quit();
});
});
});
}
if (require.main === module) {
module.exports(4723);
}