idea安装配置testng及reportng测试报告

  • 文章可能会有纰漏,希望路过大神可以指点,在此感激不尽!

  • 大家可能注意我的项目是中文的,因为我用了汉化版的一个插件,如果需要可自行下载,安装后重启就可以了

一.安装配置testng

1、根据自己需要配置testng的jar包:https://mvnrepository.com/artifact/org.testng/testng

2、File -> Project Structure... -> Modules -> Dependencies -> Add JARs or directories 添加testng-7.0.0.jar -> Apply -> OK

3、创建测试用例

可参照我这篇文章:https://blog.csdn.net/weixin_38337769/article/details/102901676

4、根据截图步骤,添加配置testng

5、执行结果

6、生成testngxml文件

File-Settings-Plugins-Marketplace-搜索Create TestNG XML 插件

 

7、产生testng.xml文件

二、testng本身带的测试报告比较丑,所以使用了reportng

1、pom文件引入reportng、guice依赖,可自行粘贴引入

        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.testng</groupId>
                    <artifactId>testng</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>4.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.3</version>
        </dependency>

2、配置reportng的jar包,jar包链接:https://mp.csdn.net/console/upDetailed

3、eportng 开源维护到1..1.4版本     报告地址:\aututest\test\test-output\html\index.html    guice是测试报告UI界面

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

村东头老杨

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值