Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set protractor arguments debugging in visual studio code

I'm debugging a protractor solution in visual studio code. How I can do to pass the baseUrl as parameter in launch.json file?

This is my protractor.conf.js file

exports.config = {
      seleniumAddress: 'http://localhost:4444/wd/hub',
      //baseUrl: 'xxx',
      ...

    };

This is my launch.json file:

{
        "version": "0.1.0",
        "configurations": [
            {
                "name": "Launch e2e Tests",
                "type": "node",
                "program": "node_modules/protractor/lib/cli.js",
                "stopOnEntry": false,
                "args": ["protractor.conf.js","--baseUrl='pippo'" ],
                "cwd": ".",
                "runtimeExecutable": null,
                "isShellCommand": true,
                "runtimeArgs": [],
                "env": { },
                "sourceMaps": false,
                "outDir": null
            }
        ]
    }
like image 493
Samuele Cozzi Avatar asked Aug 18 '15 09:08

Samuele Cozzi


2 Answers

I use the default launch.json and alter just these two settings:

"program": "c:/Users/lee/AppData/Roaming/npm/node_modules/protractor/bin/protractor",
"args": ["${workspaceRoot}/protractor.conf.js"],
like image 74
Lee Goddard Avatar answered Sep 20 '22 04:09

Lee Goddard


Try setting the runtime executable:

"runtimeExecutable": "node_modules/protractor/bin/protractor",
"args": ["--baseUrl=https://127.0.0.1"]
like image 36
alecxe Avatar answered Sep 22 '22 04:09

alecxe