Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

report.html not displaying properly #3428

Answered by mdmintz
Jeremy-QA asked this question in Q&A
Discussion options

Hello Michael Mintz,

First of all, thank you for your automation framework. It has been incredibly helpful!

Currently, the report.html file is sent to our Slack channel from Jenkins once the testing execution is complete.

The report.html is not displaying properly, as the design appears distorted when accessed or downloaded from the Slack channel.

However, it works perfectly on my local machine.
Screenshot_10

You must be logged in to vote

If viewing pytest-html reports in Jenkins, you may need to configure Jenkins settings 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", "")

Replies: 1 comment 1 reply

Comment options

If viewing pytest-html reports in Jenkins, you may need to configure Jenkins settings 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", "")
You must be logged in to vote
1 reply
Comment options

Thank you for your insight. However, my goal is to send the report.html to the Slack channel so the team can download and view the report.

Based on my investigation, this issue occurs because when I run pytest --html=report.html, it generates the HTML and CSS as separate files. When the report.html is sent to Slack, it needs to find the style.css file. To solve this, I used the --self-contained-html option. This ensures that all necessary resources (like CSS, JS, etc.) are embedded directly within the report, making it fully self-contained.

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /