manoj
manoj

Reputation: 121

How to share html report of pytest-html with out changing the css

I am using python 3.6 and pytest-html to generate HTML reports . Everything is successfully working but when i share my html report to my manager the css of the entire document is out of placed .can someone tell the reason to why it is happening and the solution for it .

The view of reports when i run:enter image description here

The view of the reports when i share the document with my manager enter image description here

Upvotes: 4

Views: 4408

Answers (3)

Joseph Peter
Joseph Peter

Reputation: 11

html=report.html --self-contained-html

Upvotes: 1

Satbeen Thakur
Satbeen Thakur

Reputation: 111

include --self-contained-html when you are calling your pytest...such as pytest your.pyfilename --html=pathandfilename --self-contained-html.

Your result file have inline css in it.

Upvotes: 11

Prany
Prany

Reputation: 2133

It seems like you are not sharing whole bunch of items like CSS with html file you are giving. Just place the CSS code inside your HTML rather than giving the path and it will solve your problem.

Upvotes: 0

Related Questions