question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code Coverage view not rendering linked css / js files in artifact

See original GitHub issue

I’m creating a javascript test coverage report using the karma-coverage plugin. It generates an HTML coverage report based on the Istanbul and a Cobertura report file.

I’m using the output directory for the html report as the report directory in the “Publish Code Coverage Results” task.

My build artifact then contains the full contents of the html folder, as well as the Cobertura report.

Build Artifact: artifact

When I navigate to the Code Coverage page for the build, I see the results of my tests, and I’m able to navigate through the results, I just don’t have any of the styling or scripts that are associated with the report.

Results: results

Expected: expected

When I navigate to the coverage page in chrome, I get the following console error:

Blocked script execution in 'https://MYPROJECTHERE.visualstudio.com/_apis/Containers/321454/Code%20Coverage%20Report_2015/index.html' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:18
  • Comments:31 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
soham-dongargaonkarcommented, Jun 10, 2020

Any updates on this?

12reactions
kohlikohlcommented, May 1, 2018

In the meantime, here is a little script that inlines the external CSS into the HTML pages generated by the coverage reporter. I run it as a post processing step in the build after the coverage has been collected.

https://gist.github.com/kohlikohl/ef77c751cfd3b731923ca74fec9443d5

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code coverage report on build should not strip stylesheet tags ...
Now, the same coverage artifact displays without any of the included css styles. Looking at the frame source shows all the stylesheet tags...
Read more >
Not able to render Code Coverage HTML results in the "Code ...
Run tests using above tool and generate .coverage file; Install CodeCoverage.exe from Nuget; PowerShell script to convert .coverage to .xml ...
Read more >
Artifacts: Make it possible to view HTML files with relative links ...
This makes relative links between artifacts unusable when viewed directly on the web UI. This issue mainly affects HTML files/reports, where the ...
Read more >
Extend online view of HTML artifacts to private projects - GitLab
Given my job run and generates code coverage reports - static files in HTML format (with JS and CSS), still can not view...
Read more >
Code Coverage - Cypress Documentation
Let's look at the one file that has a "missed" line. It is the src/selectors/index.js file shown below. ... The source line not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found