Selenium/How-to/Debug with Visual Studio Code

Environments

edit

This tip works if you're _targeting:

launch.json

edit

Create .vscode/launch.json file.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "run select spec",
      "type": "node",
      "request": "launch",
      "args": [ "tests/selenium/wdio.conf.js", "--spec", "${file}" ],
      "cwd": "${workspaceFolder}",
      "autoAttachChildProcesses": true,
      "program": "${workspaceRoot}/node_modules/@wdio/cli/bin/wdio.js",
      "console": "integratedTerminal",
      "skipFiles": [
        "${workspaceFolder}/node_modules/**/*.js",
        "${workspaceFolder}/lib/**/*.js",
        "<node_internals>/**/*.js"
      ]
    }
  ]
}

Make the browser visible

edit

To make the browser visible, see Selenium/How-to/Make the browser visible.

Run Selenium tests

edit

Open a file in tests/selenium/specs folder in VSCode. Click Run > Start Debugging.

More information

edit
  NODES
INTERN 1