加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – Gulp-protractor一直说“Spec pattern与任何文件都

发布时间:2020-12-17 06:47:57 所属栏目:安全 来源:网络整理
导读:我正在尝试用量角器和茉莉花来完成我的端到端测试.当我直接调用量角器protractor.config.js时,它工作得很好. 但是,当我使用gulp-protractor时,我不断得到“Spec模式与任何文件都不匹配”的错误,并且测试不会运行. 这是我的量角器转轮gulp任务: gulp.task('p
我正在尝试用量角器和茉莉花来完成我的端到端测试.当我直接调用量角器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 })
});

这是错误:

WARNING - pattern C:pathtoappe2e-testsloginlogin-spec.js did not math any files.
[launcher] Process exited with error code 1
C:pathtoappnode_modulesprotractornode_modulesqq.js:126
                   throw e;
                   ^

Error: Spec patterns did not match any files.

我错过了什么?

解决方法

我设法让它运作起来.通过提供空的可读流.然后在配置文件中指定spec文件.

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 );

在配置文件中:

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

有了这个我停止了错误.

更新

issue #2551从2.5.0开始关闭并修复

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读