有没有一种方法可以定义两个不同的Testng侦听器的运行顺序? [英] Is there a way to define the runorder of two different Testng Listeners?

查看:86
本文介绍了有没有一种方法可以定义两个不同的Testng侦听器的运行顺序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个testng侦听器.一种创建带有测试运行结果的报告html文件,另一种将结果写入数据库. html文件必须可用,才能将它们写入数据库中,因此我必须控制运行顺序.

I have two testng Listeners. One to create report html files with results of the testrun, and one to write the results in a database. The html files must be available, to write them in the database, so i must control the runorder.

是否存在任何配置可能性或一种方法让听众相互交流? 我正在将maven与pom.xml中的listener属性一起使用.

Is there any configuration possibility or a way to let the listeners communicate with each other? I'm using maven with the listener property in the pom.xml.

推荐答案

否.也许您可以创建自己的记者,并按您想要的顺序调用这两个记者?

No. Maybe you could create your own reporter that calls these two in the order you want?

这篇关于有没有一种方法可以定义两个不同的Testng侦听器的运行顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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