0

I am not able to get debugging working on VSCode for a testing framework using WebdriverIO . Only this message is displayed: - Waiting for the debugger to disconnect.

However, I am able to get debugging up and running for a TS code one time. If I am starting my machine once, and then again, it is giving same issue as - Waiting for the debugger to disconnect.

Below is the launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [{
        "type": "node",
        "request": "launch",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "outputCapture": "std",
        "name": "Launch Program",
        "program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
        "args": ["${workspaceRoot}/build/main/config/wdio.conf.js"],
         "preLaunchTask": null,
        "sourceMaps": true,
        "outFiles": [
            "${workspaceFolder}/out/**/*.js"
        ],
        "resolveSourceMapLocations": [ //code to avoid 'Could not read sourcemaps' issues
            "${workspaceFolder}/**",
            "!**/node_modules/**"
        ]
    }]
}

Console-log stack-trace:

C:\Program Files\nodejs\node.exe .\node_modules@wdio\cli\bin\wdio.js C:\Automation\angular_ui-auto-framework/build/main/config/wdio.conf.js

Debugger attached.   Execution of 1 workers started at 2022-12-21T15:25:32.199Z   [2022-12-21 20:55:32:902] - DONE - File 'c:\Automation\angular_ui-auto-framework\src\osr_ui-automation\Results\testReport.json' is deleted successfully    Waiting for the debugger to disconnect...


iamdanchiv
  • 4,052
  • 4
  • 37
  • 42

1 Answers1

0

I have faced similar problems with latest version of the vscode. I had to downgrade to nodejs 16lts and downgrade vscode to 1.57 and using below launch.json working fine so far.

{
  "name": "Start Spec",
  "type": "node",
  "request": "launch",
  "args": ["wdio.conf.js", "--spec", "${file}"],
  "cwd": "${workspaceFolder}",
  "autoAttachChildProcesses": true,
  "program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
  "console": "integratedTerminal"
}
hmm-alt
  • 1
  • 3