无法使用 Gauge Framework 启动 VSCode 调试器

Unable to start the VSCode debugger with the Gauge Framework

软件版本:

我有一个基于 Python 设置的 Gauge 框架。我有一个 spec 文件,其中安装了场景。我还在胶水代码中设置了一个断点。当我单击 Debug Spec 超链接时,我收到一条错误消息,内容如下:

无法启动调试器:调试器不适用于独立文件。请打开文件夹 c:\Projects\IAS_Desktop_Automation\ias_desktop_automation.

Error GIF

请告诉我如何让调试器工作。

更新:我也有来自 gauge.log

的日志文件结果
09-09-2021 11:06:34.700 [Gauge] [DEBUG] Created gauge_screenshots_dir at c:\Projects\GaugeFramework\ias_net_automation\reports\html-report\screenshots
09-09-2021 11:06:34.701 [Gauge] [INFO] Compatible version of plugin python not found. Installing plugin python...
09-09-2021 11:06:34.701 [Gauge] [DEBUG] Gathering metadata for python
09-09-2021 11:06:34.703 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.105 [Gauge] [DEBUG] Plugin python 0.3.17 is already installed.
09-09-2021 11:06:35.106 [Gauge] [DEBUG] Plugin html-report is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Plugin screenshot is already installed.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Parsing started.
09-09-2021 11:06:35.107 [Gauge] [DEBUG] Started concepts parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 38 concepts parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Started specifications parsing.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] 1 specifications parsing completed.
09-09-2021 11:06:35.144 [Gauge] [DEBUG] Parsing completed.
09-09-2021 11:06:35.504 [Gauge] [DEBUG] Checking updates...
09-09-2021 11:06:35.505 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.675 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.696 [python] [INFO] Python: 3.9.7
09-09-2021 11:06:35.696 [python] [DEBUG] Loading step implementations from c:\Projects\GaugeFramework\ias_net_automation\step_impl dirs.
09-09-2021 11:06:35.771 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:35.978 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/xml-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
09-09-2021 11:06:41.804 [python] [INFO] Runner Ready for Debugging

这是来自 lsp.log 的一个,可能还有一些更能揭示问题的信息:

09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: --> request #7: textDocument/codeLens: {"textDocument":{"uri":"file:///c%!!(MISSING)A(MISSING)/Projects/GaugeFramework/ias_net_automation/specs/testData.spec"}}
09-09-2021 11:07:16.033 [Gauge] [DEBUG] jsonrpc2: <-- result #7: textDocument/codeLens: [{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":12}},"command":{"title":"Run Scenario","command":"gauge.execute","arguments":["c:\Projects\GaugeFramework\ias_net_automation\specs\testData.spec:3"]}},{"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":14}},"command":{"title":"Debug Scenario","command":"gauge.debug","arguments":["c:\Projects\GaugeFramework\ias_net_automation\specs\testData.spec:3"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":8}},"command":{"title":"Run Spec","command":"gauge.execute","arguments":["c:\Projects\GaugeFramework\ias_net_automation\specs\testData.spec"]}},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":10}},"command":{"title":"Debug Spec","command":"gauge.debug","arguments":["c:\Projects\GaugeFramework\ias_net_automation\specs\testData.spec"]}}]

这个问题是由最新的仪表扩展更新(版本 0.0.21)引入的

  1. 将您的自动更新扩展更改为 None
  2. 将 vscode 中的仪表扩展调低至 0.0.20

您可以从此处的“版本历史记录”选项卡下获取版本 20: https://marketplace.visualstudio.com/items?itemName=getgauge.gauge#install-from-source

将下载文件放在您的工作区中,然后 运行 在终端中输入以下命令:

code --install-extension getgauge.gauge-0.0.20.vsix

我将 VSCode 的 Gauge 插件还原为 v0.0.20,调试器按预期工作。

enter image description here

在github中提出了一个问题,查看最新版本中的问题:https://github.com/getgauge/gauge-vscode/issues/726

我们最近在使用 python 3.7.3 并升级到 VSC 1.60 后看到了这一点。

我按照建议使用 python 3.9.7、VSC 1.60 和 gauge 0.0.20 进行了尝试,但我仍然遇到调试器的问题装饰器没有出现,只有“运行 场景”

我收到这条消息:

仪表无法初始化。安装 'ms-python.python' 代码洞察扩展。有关详细信息,请参阅问题,检查 logs.Troublesh

我安装了 python VSC ms-python.python 扩展:v2021.9.1218897484

我正在针对“虚拟”项目进行尝试,这是默认设置,因为 gauge init python 在本地安装 gauge 1.41 后 运行

忘记说了,Windows10系统