如何使用黄瓜特征文件生成骨架 [英] How to generate skeleton using cucumber feature file
问题描述
我们尝试了以下步骤:
-
在节点命令提示符下,我们尝试了令人兴奋的命令
Npm install -g cucumber
我们也尝试了
npm install -g protractor-cucumber
-
cucumber --version
上面的命令开启webstorm编辑器。
-
file(feature / testfeature.feature)
- 现在生成骨架,我们在cmd提示符下运行以下命令。
Cucumber.js
正在打开webstorm编辑器
- 我们无法看到骨骼文件
请提前感谢。
$ b $ b如果您必须在控制台中生成步骤定义
量角器命令
量角器your_conf.js
您的 conf.js 应该像这样 -
exports.config = {
directConnect:true,
baseUrl:'',
capabilities:{
'browserName':
(process.env.TEST_BROWSER_NAME || 'firefox'),
'version':
(process.env.TEST_BROWSER_VERSION ||'ANY')
},
onPrepare:function b $ b var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
global.expect = cheai.expect;
browser.manage()。window()。maximize();
},
setDefaultTimeout:60 * 1000,
framework:'custom',
frameworkPath:require.resolve('protractor-cucumber-framework'),
specs:[
'../Features/*.feature'
],
cucumberOpts:{
monochrome:true,
strict :true,
plugin:[pretty],
require:['../StepDefinitions/*.js','../Support/*.js']
}
};
We have tried below steps:
on node command prompt we tried exciting below commands
Npm install -g cucumber Also we tried npm install -g protractor-cucumber
cucumber --version
Above command opening webstorm editor.
We have created feature file(feature/testfeature.feature)
Now to generate skeleton we tried running below command on cmd prompt.
Cucumber.js It is opening webstorm editor
- We are not able to see skeleton file
Could you please suggest if we are missing anything We should be able to create skeleton file using npm command.
Thanks in advance.
If you have to generate Step definitions
structure/skeleton in your console you have to run the protractor command
protractor your_conf.js
your conf.js should look like this -
exports.config = {
directConnect: true,
baseUrl: '',
capabilities: {
'browserName':
(process.env.TEST_BROWSER_NAME || 'firefox'),
'version':
(process.env.TEST_BROWSER_VERSION || 'ANY')
},
onPrepare: function () {
var chai = require('chai');
var chaiAsPromised = require('chai-as-promised');
chai.use(chaiAsPromised);
global.expect = chai.expect;
browser.manage().window().maximize();
},
setDefaultTimeout : 60 * 1000,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
specs: [
'../Features/*.feature'
],
cucumberOpts: {
monochrome: true,
strict: true,
plugin: ["pretty"],
require: ['../StepDefinitions/*.js', '../Support/*.js']
}
};
这篇关于如何使用黄瓜特征文件生成骨架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!