How to generate skeleton using cucumber feature file

久未见 提交于 2019-12-24 09:29:40

问题


We have tried below steps:

  1. on node command prompt we tried exciting below commands

    Npm install -g cucumber Also we tried npm install -g protractor-cucumber

  2. cucumber --version

Above command opening webstorm editor.

  1. We have created feature file(feature/testfeature.feature)

  2. Now to generate skeleton we tried running below command on cmd prompt.

Cucumber.js It is opening webstorm editor

  1. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!