mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
gulp4 ftw
This commit is contained in:
@ -14,16 +14,24 @@ module.exports = function(gulp, argv, buildConfig) {
|
||||
var protractorHttpServer;
|
||||
var snapshotValues = _.merge(snapshotConfig.platformDefauls, argv);
|
||||
|
||||
gulp.task('protractor-server', function() {
|
||||
gulp.task('protractor-server', protractorServerTask);
|
||||
gulp.task('snapshot-task', snapshotTask);
|
||||
gulp.task('snapshot', gulp.series(
|
||||
gulp.parallel('build', 'e2e', 'protractor-server'),
|
||||
'snapshot-task'
|
||||
));
|
||||
|
||||
function protractorServerTask(done) {
|
||||
var app = connect().use(serveStatic(projectRoot)); // serve everything that is static
|
||||
protractorHttpServer = http.createServer(app).listen(buildConfig.protractorPort);
|
||||
console.log('Serving `dist` on http://localhost:' + buildConfig.protractorPort);
|
||||
});
|
||||
done();
|
||||
}
|
||||
|
||||
gulp.task('snapshot', ['e2e', 'protractor-server'], function(done) {
|
||||
function snapshotTask(done) {
|
||||
var protractorConfigFile = path.resolve(projectRoot, 'scripts/snapshot/protractor.config.js');
|
||||
snapshot(done, protractorConfigFile);
|
||||
});
|
||||
}
|
||||
|
||||
function snapshot(done, protractorConfigFile) {
|
||||
snapshotValues.params.test_id = uuid.v4().split('-')[0];
|
||||
@ -41,12 +49,13 @@ module.exports = function(gulp, argv, buildConfig) {
|
||||
return _.template(argument, snapshotValues);
|
||||
});
|
||||
|
||||
e2ePublish(snapshotValues.params.test_id);
|
||||
// e2ePublish(snapshotValues.params.test_id);
|
||||
|
||||
return protractor(done, [protractorConfigFile].concat(protractorArgs));
|
||||
}
|
||||
|
||||
function protractor(done, args) {
|
||||
debugger;
|
||||
var child = cp.spawn('protractor', args, {
|
||||
stdio: [process.stdin, process.stdout, 'pipe']
|
||||
});
|
||||
|
Reference in New Issue
Block a user