/
Jakefile
54 lines (48 loc) · 1.49 KB
/
Jakefile
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
var path = require("path"),
fs = require("fs"),
http = require("http"),
childProcess = require("child_process"),
express = require("express"),
im = require("istanbul-middleware");
desc("Start Istanbul coverage server")
task("start-istanbul-server", function() {
var app = express();
app.use('/coverage', im.createHandler());
app.listen(4488);
process.on('SIGINT', function() {
var options = {
host: "localhost",
port: 4488,
path: "/coverage/download",
method: "GET"
};
console.log("Download coverage.zip");
var file = fs.createWriteStream("lcov.zip");
var req = http.request(options, function (res) {
res.pipe(file);
file.on("finish", function() {
console.log("Zip downloaded");
process.exit();
});
});
req.end();
});
}, {
async: true
});
desc("Start Selendroid server")
task("start-selendroid-server", function() {
var selendroid = "selendroid-standalone-0.11.0-with-dependencies.jar";
var apk = "platforms/android/ant-build/HybridSeleniumTest-debug.apk";
if (!fs.existsSync(apk)) {
fail("APK doesn't exist, did you run `cordova build android`?");
}
if (!process.env.ANDROID_HOME) {
fail("ANDROID_HOME environment not set");
}
var p = childProcess.spawn("java", ["-jar", selendroid, "-app", apk], {
stdio: "inherit"
});
}, {
async: true
});