-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.js
81 lines (69 loc) · 1.77 KB
/
example.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// USAGE
var Wrapper = require('./index.js')
function listBrowsers() {
var model = new Wrapper();
model.addParams({ all: false, flat: true })
model.checkStatus(function(err, res) {
console.log("[Err ]in here!! ", err)
console.log("[Res ]in here!! ", res)
});
}
function listWorkers() {
var model = new Wrapper();
model.setContentType("text/json")
// model.setContentType("harsh")
model.listWorkers(function(err, res) {
console.log("[Err ]in here!! ", err)
console.log("[Res ]in here!! ", res)
});
}
function head() {
var model = new Wrapper();
model.head(function(err, res) {
console.log("[Err ]in here!! ", err)
console.log("[Res ]in here!! ", res)
});
}
function create() {
var model = new Wrapper();
model.addParams({
"os": "Windows",
"os_version": "XP",
"browser": "opera",
"url": "www.google.com",
"browser_version": "10.6"
});
model.createWorker(function(err, res) {
console.log("[Err ]in here!! ", err)
console.log("[Res ]in here!! ", res)
});
}
function getWorkerById() {
var model = new Wrapper(79734563);
model.getWorkerById(function(err, res) {
console.log("[Err ]in here!! ", JSON.stringify(err))
console.log("[Res ]in here!! ", res)
});
}
function remove() {
var model = new Wrapper(79735108);
model.removeWorker(function(err, res) {
console.log("[Err ]in here!! ", JSON.stringify(err))
console.log("[Res ]in here!! ", res)
});
}
function click() {
var model = new Wrapper(79734829);
model.setFileType('png');
model.takeScreenshot(function(err, res) {
console.log("[Err ]in here!! ", JSON.stringify(err))
console.log("[Res ]in here!! ", res)
});
}
// head()
// listBrowsers();
// listWorkers();
// getWorkerById();
// create();
// remove();
// click();