unable to make relative path for step and feature files in protractor cucumberJS

青春壹個敷衍的年華 提交于 2020-03-25 19:22:07

问题


I have designed framework for protractor and for this I want that for each feature file I should be able to navigate to its respective step definition, for that I went through documentation of cucumber gherkin full support https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete and added the given code to settings.json but then also its not navigating to steps

Please find the pic of my settings.json and folder structure and suggest me what should be the relative path which I should add for step files and feature files??


回答1:


Create a project using this structure first: src --> test --> features src --> test --> step_definitions

These two are two different folders here. After successful installation of cucumber auto complete extension, add this code in your settings.json file:

{
"cucumberautocomplete.steps": [
    "src/test/features/step_definitions/*.ts"
],
"cucumberautocomplete.syncfeatures": "src/test/features/*feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"files.exclude": {
    // include the defaults from VS Code
    "**/.git": true,
    "**/.DS_Store": true,

    // exclude .js and .js.map files, when in a TypeScript project
    "**/*.js": { "when": "$(basename).ts"},
    "**/*.js.map": true
}

}

Here, it will sync all feature files from 'src/test/features/' path with the step definitions 'src/test/features/step_definitions/' path and your issue will resolve automatically.



来源:https://stackoverflow.com/questions/59282181/unable-to-make-relative-path-for-step-and-feature-files-in-protractor-cucumberjs

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