Sha*_*man 5 angularjs protractor gulp gulp-protractor
我正在尝试用量角器和茉莉花来完成我的端到端测试.我protractor protractor.config.js直接打电话时效果很好.
但是,当我使用gulp-protractor时,我不断得到"Spec模式与任何文件都不匹配"的错误,并且测试不会运行.
这是我的量角器转轮gulp任务:
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 })
});
Run Code Online (Sandbox Code Playgroud)
这是错误:
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.
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我设法让它工作。通过提供一个空的可读流。然后您在配置文件中指定您的规范文件。
var protractor = require('gulp-protractor').protractor;
gulp.task('protractor', ['webdriverUpdate'],function(){
return gulp.src([])
.pipe(protractor({
configFile: __dirname + '/protractor.conf.js'
}));
});
Run Code Online (Sandbox Code Playgroud)
也不要忘记 webdriverUpdate
var webdriverUpdate = require('gulp-protractor').webdriver_update;
gulp.task('webdriverUpdate', webdriverUpdate );
Run Code Online (Sandbox Code Playgroud)
并在配置文件中这样:
seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
Run Code Online (Sandbox Code Playgroud)
这样我就不再收到错误了。
更新
自 2.5.0 起,问题#2551已关闭并修复
| 归档时间: |
|
| 查看次数: |
1985 次 |
| 最近记录: |