python - 发送折叠行的 html 报告

标签 python pytest pytest-html

我正在尝试通过电子邮件发送 pytest html 报告,但是电子邮件中的 javascript 被禁用。因此,html 报告默认展开所有行,并使电子邮件内容变得相当长。在哪里可以设置默认折叠的行?

我尝试添加自定义 css 来折叠。但这也会在启用 JavaScript 时使报表折叠。

.results-table-row tr:nth-child(2) {
    display: none;
}

最佳答案

我通过添加 collapsed 来解决类(class) <tr>在发送 html 报告内容之前手动... - -!

关于python - 发送折叠行的 html 报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57282301/

相关文章:

python - 在不通过 SSH 进入我的容器的情况下运行测试

python - Pytest HTML 报告 : how to get the name of the report file?

python - 如何在 pytest bdd 中包含 selenium 屏幕截图以通过测试?

python - Pandas DataFrame 中的舍入条目

Python Selenium - 自动填写表单 - 单击不是提交按钮的按钮并从列表中填写表单

python - 如何分割/细化 xarray 数据集中的维度?

python-3.x - 如何在不更改 css 的情况下共享 pytest-html 的 html 报告

python - 如果我在 python 中有 10 个虚拟环境,是否会下载相同的库 10 次?

python - pytest 和 codecov : no coverage report found

python - 使用 QT 运行 pytest 时出现致命的 Python 错误