我正在使用cypress cucumber测试框架和IDE VSCode 我找不到从功能到步骤定义导航的方法,反之亦然。我已经在 vs code 中安装了 Cucumber (Gherkin) Full Support 扩展,但没有帮助
是否有任何配置可以实现从功能到步骤定义的导航?
请在 VSCode 中导航文件 > 首选项 > 设置(Mac 上的代码 > 首选项 > 设置),然后选择 工作空间。
从右上角打开
settings.json
文件。
在
settings.json
文件中设置以下设置并保存文件。请保留您的文件层次结构。
"cucumberautocomplete.steps": [
"cypress/integration/*/*.js"
],
"cucumberautocomplete.syncfeatures": "cypress/integration/*.feature",
"cucumberautocomplete.strictGherkinCompletion": false,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.stepsInvariants": true
现在打开您的特征文件,将光标放在步骤线上,按 CTRL 并在线上右键单击或按 F12。
{
"cucumberautocomplete.steps": [
"cypress/e2e/**/*.js"
],
"cucumberautocomplete.syncfeatures": "/cypress/e2e/*.feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"editor.formatOnSave": true,
}