如何在 ExtentReports 4.0.9 中增加屏幕截图缩略图的大小 [英] How to increase the size of the Screenshot Thumbnails in ExtentReports 4.0.9

查看:57
本文介绍了如何在 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.

这篇关于如何在 ExtentReports 4.0.9 中增加屏幕截图缩略图的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆