I want to get the coverage report for my Protractor E2E UI tests against a running node code. I have tried the following steps:
Using Istanbul, I instrumented the code on one of my app server
managed through Nginx.istanbul instrument . --complete-copy -o instrumented
Stopped the actual node code, and started instrumented code on the same port (port 3000), without changing the NGINX config, so that any traffic hitting that app server will be directed to the instrument
code which is running on the same server.Run the protractor end to end tests which is on another machine. This is another local machine, which I run the test from and the instrumented app is in another server.
- At the end of the run, I stopped the Instrumented code
Now: - There is no coverage variable available - There is no Coverage Folder - No report generated
I thought the coverage report would be generated if the instrumented code was hit through the protractor script.
I also googled around, and found some plugin "protractor-istanbul-plugin"
but not sure if this is what I should use.
My questions:
- Is it even possible to generate coverage report if the instrumented code is in a different server and protractor script is run from a different machine?
- If possible, is my assumption that report would be generated if instrumented code is hit is wrong?
- should I use
istanbul cover
command here and if yes, how?
My goal is to instrument the code after deploying to QA env. and trigger the protractor script which is placed in another machine pointing to the QA env having the instrumented code.
Thanks in Advance.