diff --git a/src/pytest_html/nextgen.py b/src/pytest_html/nextgen.py index 9eba6f8b..e228c1bb 100644 --- a/src/pytest_html/nextgen.py +++ b/src/pytest_html/nextgen.py @@ -206,6 +206,10 @@ def pytest_sessionfinish(self, session): self._report.data["runningState"] = "Finished" self._generate_report() + @pytest.hookimpl(trylast=True) + def pytest_terminal_summary(self, terminalreporter): + terminalreporter.write_sep("-", f"Generated html report: file://{self._report_path}") + @pytest.hookimpl(trylast=True) def pytest_collection_finish(self, session): self._report.data["collectedItems"] = len(session.items) diff --git a/src/pytest_html/resources/index.jinja2 b/src/pytest_html/resources/index.jinja2 index 0d3b9e74..f38a3190 100644 --- a/src/pytest_html/resources/index.jinja2 +++ b/src/pytest_html/resources/index.jinja2 @@ -73,7 +73,7 @@ diff --git a/src/pytest_html/scripts/dom.js b/src/pytest_html/scripts/dom.js index 145878cc..6b4f8d41 100644 --- a/src/pytest_html/scripts/dom.js +++ b/src/pytest_html/scripts/dom.js @@ -82,20 +82,22 @@ const dom = { const media = [] extras?.forEach(({ name, format_type, content }) => { - const extraLink = aTag.content.cloneNode(true) - const extraLinkItem = extraLink.querySelector('a') - - extraLinkItem.href = content - extraLinkItem.className = `col-links__extra ${format_type}` - extraLinkItem.innerText = name - resultBody.querySelector('.col-links').appendChild(extraLinkItem) + if (['json', 'text', 'url'].includes(format_type)) { + const extraLink = aTag.content.cloneNode(true) + const extraLinkItem = extraLink.querySelector('a') + + extraLinkItem.href = content + extraLinkItem.className = `col-links__extra ${format_type}` + extraLinkItem.innerText = name + resultBody.querySelector('.col-links').appendChild(extraLinkItem) + } if (['image', 'video'].includes(format_type)) { media.push({ path: content, name, format_type }) } if (format_type === 'html') { - resultBody.querySelector('.extraHTML').insertAdjacentHTML('beforeend', `
${content}
`) + resultBody.querySelector('.extraHTML').insertAdjacentHTML('beforeend', `
${content}
`) } }) mediaViewer.setUp(resultBody, media)