【发布时间】:2017-06-02 13:30:25
【问题描述】:
我已经在本地安装了 npm 模块(在下面的 package.json 中找到依赖项详细信息)并尝试执行下面的黄瓜功能文件和 SD,但得到 未定义。实施.. 消息。
我已经准备好我的功能文件如下:存储在:test/features/sample.feature
Feature: Running Cucumber with Protractor
@test
Scenario: To verify the Search result
Given I am on home page
并实现SD如下:存储在:test/step_definitions/sample.steps.js
module.exports = function() {
this.Given(/^I am on home page$/, function () {
return browser.get("http://www.google.com");
});
}
我在 conf.js 中的 specs & cucumberOpts 如下:
specs: [
'./../features/*.feature'
],
cucumberOpts: {
require: ['./step_definitions/*.steps.js'],
tags: '@test',
strict: true,
format: 'pretty'
}
已安装的 package.json 依赖详情:
"dependencies": {
"chai": "^4.0.1",
"chai-as-promised": "^6.0.0",
"cucumber": "^2.3.0",
"protractor": "^5.1.2",
"protractor-cucumber-framework": "^3.1.1"
}
但在执行中获取消息为:
1 scenario (1 undefined)
1 step (1 undefined)
0m00.000s
谁能帮我出来...
【问题讨论】:
标签: npm protractor cucumber bdd cucumberjs