forked from bitbar/test-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
64 lines (52 loc) · 1.63 KB
/
Copy pathgulpfile.js
File metadata and controls
64 lines (52 loc) · 1.63 KB
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
var gulp = require('gulp'),
nightwatch = require('gulp-nightwatch'),
inject = require('gulp-inject-string'),
zip = require('gulp-zip');
// Client Side Execution
function build_client_side(){
var credentials = require('./.credentials.json');
var apiKey = credentials["apiKey"];
var build_client_side = gulp.src('./nightwatch.json')
.pipe(inject.replace('<insert_your_apiKey_to_credentials_file>', apiKey))
.pipe(gulp.dest('./build/'));
return build_client_side;
}
gulp.task('ios', function() {
return build_client_side()
.pipe(nightwatch({
configFile: 'build/nightwatch.json',
cliArgs: [ '--env testdroid_ios']
}));
});
gulp.task('android', function() {
return build_client_side()
.pipe(nightwatch({
configFile: 'build/nightwatch.json',
cliArgs: [ '--env testdroid_android']
}));
});
// Server Side Execution
function build_server_side(){
var build_server_side = gulp.src('./nightwatch.json')
.pipe(gulp.dest('./build'));
return build_server_side;
}
gulp.task('androidServerSide', function() {
return build_server_side()
.pipe(nightwatch({
configFile: 'build/nightwatch.json',
cliArgs: [ '--env testdroid_android_server_side','--verbose']
}));
});
gulp.task('iosServerSide', function() {
return build_server_side()
.pipe(nightwatch({
configFile: 'build/nightwatch.json',
cliArgs: [ '--env testdroid_ios_server_side','--verbose']
}));
});
gulp.task('zip', function() {
return gulp.src(['**','!.credentials.json','!tests/reports/*','!build/*','!dist/*'])
.pipe(zip('server_side_package.zip'))
.pipe(gulp.dest('dist'));
});