pytest-html report on Jenkins does not have check box for filter and no column sort

2.1k views Asked by At

--- Problem resolved. see comment ---
pytest-html is great. When viewing the report locally I can click the check box [pass][fail][skip]. I also can click the sort button for each column pytest html report local



I use Jenkins "publish html report" to see the report on Jenkins. The column sort button is gone, the check boxes are gone. Thanks in advance.

pytest html report in Jenkins

pytest -vs ${test_suite} --url $url --junitxml ${test_suite_xml} --html=${test_suite_html}
pytest-html 1.19.0
Jenkins 2.121.2
html publisher plugin 1.16

1

There are 1 answers

0
Soprano86 On

Found the reason. Java Script is disabled. follow this link to set Content Security Policy

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

What confused me was, nothing seems happen after running that command. Here is why:

How to interpret the output:

No output below "Result" header: default protection
Output Result: below "Result" header: protection disabled
Output Result: some text here below "Result" header: custom protection