visual-studio-code - Cucumber Protractor 测试在 VS Code 中启动,但不会在断点处停止
问题描述
我正在尝试使用特定标签调试场景。@debug
在这种情况下。我能够启动并运行该案例。但是,VS Code 不会在断点处停止脚本。
这是一个用 TypeScript 编写的 Cucumber + Protractor 脚本。
启动.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"protocol": "inspector",
"console": "integratedTerminal",
"name": "AHA",
"stopOnEntry": false,
// "program": "${workspaceRoot}/node_modules/cucumber/bin/cucumber-js",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"args": [
"${workspaceRoot}/dist/config/config.js",
"--cucumberOpts.tags",
"@debug",
"--params.env",
"QADev"
],
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"--nolazy"
],
"sourceMaps": true
}
]
}
设置.json
"cucumberautocomplete.syncfeatures": "./features/**/*.feature",
"cucumberautocomplete.strictGherkinCompletion": true,
"cucumberautocomplete.smartSnippets": true,
"cucumberautocomplete.onTypeFormat": true,
"cucumberautocomplete.steps": [
"step_definitions/*.ts"
],
tsconfig.json
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "commonjs",
"target": "ES2020",
"moduleResolution": "node",
"sourceMap": true,
"mapRoot": "/dist/step_definitions/",
"declaration": false,
"removeComments": false,
"noImplicitAny": false,
"skipLibCheck": true,
"outDir": "dist",
"typeRoots": ["./node_modules/@types"],
"types": ["node", "reflect-metadata"],
"lib": ["ES2020"],
"resolveJsonModule": true
},
"exclude": ["node_modules", "dist"]
}
解决方案
推荐阅读
- .net - 如何在点网框架类库的程序集级别指定 ExcludeFromCodeCoverage?
- java - Spring Data MongoDB - 使用 Pageable 查找数百万个数据 - 内存过载?
- r - 如何在基本 R 中为我的茎叶图添加标题?
- javascript - obj.hasOwnProperty 即使在属性创建后也总是返回 false
- ios - 如果用户拒绝了 AppTrackingTransparency 对话框,我们可以初始化 Firebase 吗?
- yugabyte-db - 手动刷新不会删除 YugabyteDB 中的所有 WAL 文件?
- r - 某些列和整个数据框的总和
- mysql - 如何根据以前的列值更新 sql 列
- python - 在为 django 模型创建 TextField 值时扫描三引号字符串文字时的 EOF。(如何正确连接字符串)
- javascript - CSS Rotate 与 Stacking Context Electron APP 混淆