-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
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
Beta Was this translation helpful? Give feedback.
All reactions
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
-
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", "")
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1