0

我正在捕获失败时的屏幕截图,并且范围报告会显示它。当我在范围报告中单击捕获的屏幕截图时,它不是全屏。它的四边短约 1 厘米。

如何增强它以使其全屏?

4

2 回答 2

1

您可以在 extent-config.xml 中更改 css 样式配置。下面的例子,改变了图像的宽度。

<!-- custom styles -->
<styles>
    <![CDATA[
        .featherlight-image {   border: 1px solid #f6f7fa;   cursor: zoom-in;    width: 75px; }
    ]]>
</styles>

检查报告中的 css 变量并根据需要调整图像。

于 2018-12-28T14:28:16.397 回答
0

对于范围报告 v4,您可以使用 htmlReporter

public ExtentHtmlReporter htmlReporter;


@BeforeTest
public void setExtentReport() {
    String reportUrl = System.getProperty("user.dir") + "/test-output/ExtentReportVersion4.html";
    htmlReporter = new ExtentHtmlReporter(reportUrl);
    String css = ".r-img {width: 100%;}";
    htmlReporter.config().setCSS(css);
}
于 2019-10-22T20:16:16.437 回答