user18148705
user18148705

Reputation: 325

Pytest html report is not showing in html format

I have python selenium automation and I am executing them using pytest. The pytest html report is getting generated but the format does not have CSS. Earlier it was working fine and I was getting a proper report with CSS, but now I am getting just a raw HTML report. My issue is similar to this

I am not sure what exactly is the issue. Any help would be appreciated, Thank you.

Upvotes: 2

Views: 901

Answers (1)

Michael Mintz
Michael Mintz

Reputation: 15526

If viewing pytest-html reports in Jenkins, you may need to configure the Jenkins settings (https://stackoverflow.com/a/46197356) for the HTML to render correctly. This is due to Jenkins CSP changes. That setting can be changed from Manage Jenkins > Script Console by running:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

Upvotes: 1

Related Questions