Coverage of the protractor “no coverage object in the browser”

I had a problem with the reach of the springboard and it seems to be an open problem. Others had this problem here ( https://github.com/r3b/grunt-protractor-coverage/issues/10 ) and the problem was closed but not resolved.

I went ahead and reproduced the problem in my open source project https://github.com/peterhendrick/openSource . This is the mean.js template application, and I added the coverage of the protractor trace and its dependencies. When I run the grunt file, everything seems to work, the protrans is executed, the files are processed, but when the report comes out, I get 100% coverage of null files. I separated the protractor traffic file from the dev grunt file and named it gruntfile-e2e.js.

You can easily reproduce if you run the following commands:

~$ git clone https://github.com/peterhendrick/openSource 

Of course, install package.json:

 ~$ cd openSource ~/openSource$ npm install 

Update the selenium driver:

 ~/openSource$ ./node_modules/.bin/webdriver-manager update 

(I run the driver before testing, so there is no need to start the server for webdriver)

Run the application on the server (default is port 3000). You will need a mongodb instance to run:

 ~/openSource$ npm start 

Open another terminal and go to the application folder and run the euntte e2e file to see the problem:

 ~/openSource$ grunt --gruntfile gruntfile-e2e.js 

You should see the following near the end:

"Performing the task" protractor_coverage: local "(protractor_coverage) The collector is running on port 3001. The initial stand-alone server selenium ... [launcher] The start of 1 instance of the stand-alone WebDriver Selenium server began at http: // ......

There is no coverage object in the browser.

.

Finished in 4.716 seconds 1 test, 1 statement, 0 failures "

If someone can help me solve this problem, it will be very appreciated.

+5
source share

Source: https://habr.com/ru/post/1210593/


All Articles