gpt4 book ai didi

javascript - 将功能映射到 "VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete"插件的设置文件中的步骤定义

转载 作者:行者123 更新时间:2023-12-01 15:10:08 29 4
gpt4 key购买 nike

所以我刚刚下载了“VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete”插件来帮助在我的 vscode 编辑器中格式化 cucumber 。从他们的文档看来,“VSCode Cucumber (Gherkin)...”插件支持一项功能,通过将鼠标悬停在 .feature 文件中的相应文本上,您可以查看功能文件、步骤定义和页面对象之间的关系.

但是,“VSCode Cucumber (Gherkin)...”插件关于文件之间路径映射的文档很简单。有谁知道在给定以下目录结构的情况下,您将如何在功能文件、步骤定义和页面对象之间创建所需的语法链接?

src
├── features
│   ├── accessibility
│   │   └── FeatureFile.feature
│   ├── Directory
│   │   ├── featureFile.feature
│   │   ├── SomeDirectory
│   │   │   ├── FeatureFile.feature
│   ├── step_definitions
│   │   ├── SomeDirectory
│   │   │   ├── someFile.js
│   │   │   ├── given.js
│   │   │   └── then.js
│   │   ├── given.js
│   │   ├── someFeature.js
│   │   ├── then.js
│   │   └── when.js
├── pageobjects
│   ├── SomeDirectory
│   │   ├── SomeFeature


作为引用,这是他们的文档示例,说明了 vscode 配置文件应该如何启用这些功能
{
"cucumberautocomplete.steps": [
"test/features/step_definitions/*.js",
"node_modules/qa-lib/src/step_definitions/*.js"
],
"cucumberautocomplete.syncfeatures": "test/features/*feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"cucumberautocomplete.strictGherkinValidation": true,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.stepsInvariants": true,
"cucumberautocomplete.customParameters": [
{
"parameter":"{ab}",
"value":"(a|b)"
},
{
"parameter":/\{a.*\}/,
"value":"a"
},
],
"cucumberautocomplete.pages": {
"users": "test/features/page_objects/users.storage.js",
"pathes": "test/features/page_objects/pathes.storage.js",
"main": "test/features/support/page_objects/main.page.js"
},
"cucumberautocomplete.skipDocStringsFormat": true,
"cucumberautocomplete.formatConfOverride": {
"And": 3,
"But": "relative",
},
"cucumberautocomplete.onTypeFormat": true,
"editor.quickSuggestions": {
"comments": false,
"strings": true,
"other": true
}

最佳答案

cucumberautocomplete.steps应该有一组有效路径。在您的情况下,您可以指定 ["path_to_src/features/step_definitions/*.js"] .如果您想阅读 src 中任何文件夹中的步骤,您只需提及 ["path_to_src/**/*.js"]

关于javascript - 将功能映射到 "VSCode Cucumber (Gherkin) Full Language Support + Formatting + Autocomplete"插件的设置文件中的步骤定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59797408/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com