问题
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