发送 html 行折叠的报告

send html report with row collapsed

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

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

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

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