pankaj pankaj - 1 month ago
151 0

Hello,
I am trying to debug protractor test using javascript along with Jasmine framework in Visual studio Code. However, whenever I run my test cases by adding breakpoints, as soon as the script halts at breakpoint, the actions are not reflected( e.g, filling the text field, click button, etc.) on chrome browser.
Once we continue the debugging(play button) then the all actions are reflected on browser. In short, browser and code doesn't debug Synchronously when applied breakpoint.

Please give me solution in order to resolve issue.

Thanks.

Javascript

How to debug Protractor test scripts (on breakpoint) using javascript along with Jasmine framework in Visual studio Code?

launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/node_modules/protractor/built/cli.js",
            "stopOnEntry": false,
            "args": ["${workspaceRoot}/conf.js"],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": null,
            "externalConsole": false,
            "runtimeExecutable": null,
            "runtimeArgs": [
                "--nolazy"
            ],
            "env": {
                "NODE_ENV": "development"
            },
            "console": "internalConsole",
            "sourceMaps": true,
            "outFiles": []
        },
        {
            "name": "Attach",
            "type": "node",
            "request": "attach",
            "port": 5858,
            "address": "localhost",
            "restart": false,
            "sourceMaps": false,
            "outFiles": [],
            "localRoot": "${workspaceRoot}",
            "remoteRoot": null
        },
        {
            "name": "Attach to Process",
            "type": "node",
            "request": "attach",
            "processId": "${command.PickProcess}",
            "port": 5858,
            "sourceMaps": false,
            "outFiles": []
        }
    ]
}