繁体   English   中英

量角器未运行黄瓜中的特征文件

[英]Protractor is not running features file from cucumber

我正在用量角器实现黄瓜,一切似乎都很好,因为它没有失败,但是当我执行术语时说执行了0个场景。

这是我的conf.js:

exports.config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
  framework: 'custom',
  frameworkPath: require.resolve('protractor-cucumber-framework'),

  capabilities: {
    'browserName': 'firefox'
  },

  specs: './features/login.feature',

  onPrepare: function(){
    browser.driver.manage().window().maximize()
    browser.get('http:www.google.com')
  },

  jasmineNodeOpts: {
    showColors: true, // Use colors in the command line report.
  },

  cucumberOpts: {
    require: 'features/steps/my_steps.js',
  }
};

这是我框架的树:

在此处输入图片说明

但是当我执行protractor conf.js时,我在终端中有以下输出:

[17:27:45] I/launcher - Running 1 instances of WebDriver
[17:27:45] I/hosted - Using the selenium server at    http://127.0.0.1:4444/wd/hub
0 scenarios
0 steps
0m00.000s

所以我只想知道conf.js上是否有问题,或者我应该执行另一个命令以使用量角器运行功能文件。

希望您能够帮助我。

这取决于您如何配置conf.js文件的运行。 例如。

root | |_features |_config | |_conf.js |_package.json

如果您在json包中包含一个脚本,该脚本从项目根目录触发量角器,而该脚本是通过例如从项目根目录进行npm test触发的,则量角器将从root/{config.specs}搜索文件

如果您从例如./config -folder运行脚本,则它将从root/config/{config.specs}

因此,这取决于您在搜索功能文件时触发脚本的位置

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM