我正在捕获失败时的屏幕截图,而扩展报告显示了它。当我单击extent report中捕获的屏幕截图时,它并不是全屏。它的两边都短了大约1厘米。
如何增强它使其全屏显示?
发布于 2018-12-28 22:28:16
您可以在extent config.xml中更改css样式配置。下面的例子,改变了图像的宽度。
<!-- custom styles -->
<styles>
<![CDATA[
.featherlight-image { border: 1px solid #f6f7fa; cursor: zoom-in; width: 75px; }
]]>
</styles>检查报告中的css变量,并根据需要调整图像。
发布于 2019-10-23 04:16:16
对于范围报告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);
}https://stackoverflow.com/questions/53790432
复制相似问题