如何在 ExtentReports 4.0.9 中增加屏幕截图缩略图的大小

问题描述:

我正在尝试自定义 ExtentReports 4.0.9当我在测试失败后打开报告时,它将屏幕截图显示为非常小的缩略图.如何增加缩略图的大小.

I'm trying to customize ExtentReports 4.0.9 When I'm opening report after test fails, It displays screenshot as very small thumbnails. How can i increase size of the Thumbnail.

我试过extent-config.xml

I've tried extent-config.xml

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

截图是:https://imgur.com/eSy5fLz

但是没有用.请建议我如何增加缩略图的大小.

but it didn't work. Please suggest How can i Increase the size of thumbnail.

我研究了一下,终于找到了解决我的问题的方法.我从 Extent Report 4 的 htmlreported 添加了一些 CSS 代码.

I have researched about it and finally got the solution for my problem. I have added some CSS code from htmlreported of Extent Report 4.

htmlReporter.config().setCSS(".r-img { width: 30%; }");
report=new ExtentReports();
report.attachReporter(htmlReporter);

我在配置 ExtentReport 时添加了上面的代码.

I have added above code when configuring ExtentReport.

我希望它对面临同样情况的人有用.

I hope it will work for someone who face the same situation.