Reputation: 1565
Thanks to the ng e2e, I can run the server and then execute end to end Protractor tests against it.
npm run ng e2e
command accomplish this task for me.
Now, I would like to create a Visual Studio configuration to debug those tests.
According to the description on MSDN blog
in .vscode/launch.json
, I created a configuration for debugging Protractor tests:
{
"type": "node",
"request": "launch",
"name": "Launch e2e tests",
"program": "${workspaceRoot}/node_modules/protractor/bin/protractor",
"stopOnEntry": false,
"args": ["${workspaceRoot}/protractor.conf.js"],
},
However it is not running the server, it runs the tests only. As a results, they're marked as failed.
How can I amend the configuration to not only run the tests, but to start the server first? Obviously I need to have debugging possibilities such as inserting the break points in VS Code.
Upvotes: 0
Views: 72
Reputation: 13712
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/node_modules/@angular/cli/bin/ng",
"cwd": "${workspaceFolder}",
"args": [
"e2e"
]
}
]
Upvotes: 1