cucumberjs --version 1.2.2
protractor --version 4.0.1
Both installed globally via npm
升级到上面的 cucumberJs 版本后,我不断收到此错误。
Failures:
1) Scenario: Get records from DB
e2e\features\transac.feature:7
Step: Given I am logged in as "username" with "password"- e2e\features\transac.feature:8
Step Definition: e2e\steps\loginSteps.js:17
Message:
function timed out after 5000 milliseconds
1 scenario (1 failed)
1 step (1 failed)
0m06.608s
请注意,我在黄瓜选项块中包含了上面的 env.js,这是我的 env.js 内容:
exports.config = {
// set to "custom" instead of cucumber.
framework: 'custom',
// path relative to the current config file
frameworkPath: require.resolve('./node_modules/protractor-cucumber-framework'),
// relevant cucumber command line options
cucumberOpts: {
require: [
conf.paths.e2e + '/steps/**/*Steps.js',
conf.paths.e2e + '/support/env.js',
],
format: 'pretty'
}
};
这是 env.js 文件 // features/support/env.js
var configure = function () {
this.setDefaultTimeout(60*1000);
};
module.exports = configure;