问题
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.
回答1:
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']
}
};
来源:https://stackoverflow.com/questions/38605648/how-to-generate-skeleton-using-cucumber-feature-file