[英]gulp-protractor e2e task fails to run
在解决错误之前,您只能采取的解决方法是将项目目录更改为不包含空格的目录。
[10:45:44]使用gulpfile〜\\ Documents \\ Visual Studio 2013 \\ Projects \\ ProjectX \\ ProjectX \\ gulpfile.js
[10:45:44]开始“ build-e2e” ...
[10:45:44] 207毫秒后完成了“ build-e2e”
[10:45:44]开始“ e2e” ...
无法将“ C:\\ Users \\ jorisd \\ Documents \\ Visual”识别为内部或外部命令,可操作程序或批处理文件。
C:\\ Users \\ jorisd \\ Documents \\ Visual Studio 2013 \\ Projects \\ ProjectX \\ ProjectX \\ build \\ tasks \\ e2e.js:34
.on('error',function(e){throw e;});
错误:量角器以代码1退出
基本上,突出显示的代码有问题。 由于我的路径中包含空格,因此出于某种原因它将停在那里。
这是我的e2e.js文件现在的样子:
var gulp = require('gulp'); var paths = require('../paths'); var to5 = require('gulp-babel'); var plumber = require('gulp-plumber'); var webdriverUpdate = require('gulp-protractor').webdriver_update; var webdriverStandalone = require("gulp-protractor").webdriver_standalone; var protractor = require('gulp-protractor').protractor; // for full documentation of gulp-protractor, // please check https://github.com/mllrsohn/gulp-protractor gulp.task('webdriver-update', webdriverUpdate); gulp.task('webdriver-standalone', ['webdriver-update'], webdriverStandalone); // transpiles files in // /test/e2e/src/ from es6 to es5 // then copies them to test/e2e/dist/ gulp.task('build-e2e', function() { return gulp.src(paths.e2eSpecsSrc) .pipe(plumber()) .pipe(to5()) .pipe(gulp.dest(paths.e2eSpecsDist)); }); // runs build-e2e task // then runs end to end tasks // using Protractor: http://angular.github.io/protractor/ gulp.task('e2e', ['build-e2e'], function(cb) { return gulp.src(paths.e2eSpecsDist + '/*.js') .pipe(protractor({ configFile: '/protractor.conf.js', args: ['--baseUrl', 'http://127.0.0.1:9000'] })) .on('end', function() { process.exit(); }) .on('error', function(e) { throw e; }); });
问题在于使用configFile选项的e2e任务中。
我尝试将行更改为以下内容:
configFIle: __dirname + '/protractor.conf.js',
但这也没有结果。 如果您知道在configFile路径中包含空格的解决方法,我将很高兴听到它。
对我来说,它的工作很好。
var angularProtractor = require('gulp-angular-protractor');
gulp.task('test', function (callback) {
gulp
.src([__dirname+'/public/apps/adminapp/**/test/**_test.js'])
.pipe(angularProtractor({
'configFile': 'public/apps/adminapp/app.test.config.js',
'debug': false,
'args': ['--suite', 'adminapp'],
'autoStartStopServer': true
}))
.on('error', function(e) {
console.log(e);
})
.on('end',callback);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.