pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

Support FORMAT_TEXT on recent chrome with self contained html

Open csm10495 opened this issue 4 years ago • 2 comments

Right now doing something like this:

import pytest

from pytest_html import extras

def test_ex(extra):
    print ("hey")
    extra.append(extras.text("Hello World!\n", "Hello Text"))

leads to something like this:

image

The problem is if you click the "Hello Text" link, chrome will close it immediately. This is a standard behavior as of recent chrome (https://stackoverflow.com/questions/46818033/opening-datatext-plain-window-in-chrome-showing-up-blank).

Can we come up with a different way to make the text openable/viewable in self contained html?

csm10495 avatar Mar 03 '20 04:03 csm10495

Would the download attribute work perhaps?

https://www.geeksforgeeks.org/html-a-download-attribute/amp/

christiansandberg avatar Mar 03 '20 06:03 christiansandberg

@christiansandberg , I think so. Opened #278 to use that. Thanks!

csm10495 avatar Mar 05 '20 01:03 csm10495