gpt4 book ai didi

java - 测量驻留在单独项目中的 Selenium 测试的代码覆盖率

转载 作者:行者123 更新时间:2023-12-02 08:15:42 25 4
gpt4 key购买 nike

我有两个独立的 java maven 项目:一个是我的 Web 应用程序本身,另一个是我的 Web 的碲+ Selenium 自动化测试(我将这些测试移至单独的项目,因为它们的代码并不真正属于 Web 应用程序项目代码并且不使用我的网络应用程序的java类,我也想重用这些测试的某些部分来测试我的其他网络应用程序)。因此,除了碲/ Selenium 配置文件(主机名、凭据、浏览器)之外,我的测试所在的项目对我的网络应用程序一无所知。

所以问题是:有没有什么方法可以测量由驻留在单独项目中的碲/ Selenium 测试调用的 Web 应用程序后端的代码覆盖率?

提前致谢。非常感谢任何帮助。

最佳答案

EMMA 或 cobetura 可以对您的类进行检测,以便在测试运行后创建覆盖率报告。

http://emma.sourceforge.net/reference/ch02s03.html

<instr>/instr is EMMA's offline class instrumentor. It adds bytecode
instrumentation to all classes found in an instrumentation path that
also pass through user-provided coverage filters. Additionally, it
produces the class metadata file necessary for associating runtime
coverage data with the original class definitions during coverage
report generation.

关于java - 测量驻留在单独项目中的 Selenium 测试的代码覆盖率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6422899/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com