簡體   English   中英

gulp-protractor e2e任務無法運行

[英]gulp-protractor e2e task fails to run

更新:似乎這是吞咽量角器中的錯誤。 他們在他們的github頁面上將其歸檔為bug,並將對其進行調查。 資料來源: https : //github.com/mllrsohn/gulp-protractor/issues/64

在解決錯誤之前,您只能采取的解決方法是將項目目錄更改為不包含空格的目錄。


所以我試圖開始一個Aurelia項目,包括前端單元測試。 這是問題開始的地方。 當我嘗試運行e2e gulp任務時,出現以下錯誤:

[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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM