2015-09-29 3 views
5

私は分度器とジャスミンで書かれたテストを終了するようにしています。それはprotractor protractor.config.jsに直接電話すると完全に動作します。「スペックパターンはどのファイルとも一致しません」と言い続けています

しかし、gulp-protractorを使用すると、「Spec patterns were any files」エラーが発生し、テストは実行されません。

これは私の分度器ランナー一気の作業です:

gulp.task('protractor-run', function (done) { 
    return gulp.src(["./e2e-tests/**/*-spec.js"]) 
     .pipe(protractor({ 
      configFile: "./config/protractor-config.js", 
      args: ['--baseUrl', 'http://127.0.0.1:8000'] 
     })) 
     .on('error', function(e) { throw e }) 
}); 

、これは誤りです:

WARNING - pattern C:\path\to\app\e2e-tests\login\login-spec.js did not math any files. 
[launcher] Process exited with error code 1 
C:\path\to\app\node_modules\protractor\node_modules\q\q.js:126 
        throw e; 
       ^

Error: Spec patterns did not match any files. 

私は何をしないのですか?

+0

私は同じ問題を持っているが、 – Gustav

+0

SOのような2秒前にここで尋ねた最新の分度器2.3.0にアップデートした後、同じ問題を持っています。それは更新の前に働いた(2.2.0)。 – rustyx

+2

分度器も参照してください[問題番号2551](https://github.com/angular/protractor/issues/2551) – rustyx

答えて

4

私はそれを稼働させることができました。空の読み取り可能なストリームを提供することによって。次に、設定ファイルで仕様ファイルを指定します。私はエラーを取得して停止した。これにより

seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar', 

var protractor = require('gulp-protractor').protractor; 

gulp.task('protractor', ['webdriverUpdate'],function(){ 
     return gulp.src([]) 
      .pipe(protractor({ 
      configFile: __dirname + '/protractor.conf.js' 
      })); 
}); 

もwebdriverUpdate

var webdriverUpdate = require('gulp-protractor').webdriver_update; 

gulp.task('webdriverUpdate', webdriverUpdate); 

、configファイルでこれを忘れないでください。

更新

issue #2551は2.5.0

+0

私は同じ問題を抱えています。私の主な問題は、私のパスに "Documents \ Visual Studio 2013 \ ..."というスペースがあり、スペースがあるためVisualビットを超えないということです。 __dirnameは私のためのトリックをしていないようです。しかしそれは正しい方向にある。私はそれが私のディレクトリパス全体を使用する方法を理解する必要があります –

0

私はgulp.srcのパラメータにファイルパスを置くことによって、分度器テストを起動gulpfileでこれを解決するため、閉じて固定されています([」 file_path_goes_here '])。私が実行しようとしていたタスクは、角かっこの間にファイルパスがなく、エラーをスローしていました。

gulp.task('works', 'Run some tests', function() { 
    gulp.src(['path/to/test.spec.js']) 
    .pipe(protractor({ 
     configFile: __dirname + '/../test/protractor.conf.js', 
     args: ['--baseUrl', 'http://localhost:9099'] 
    })) 
}); 

gulp.task('error', 'Run feature tests locally', function() { 
    gulp.src(['']) 
    .pipe(protractor({ 
     configFile: __dirname + '/../test/protractor_local.conf.js', 
     args: ['--baseUrl', 'http://localhost:9099'] 
    })) 
}); 
関連する問題