QAF-如何在运行BDDStepFactory2时更新junistreports.xml



我目前在工作中使用QAF,最近使用Azure Devops设置了一些CICD测试。

Azure Devops目前仅设计用于向Junit读取其报告数据库中的.XML结果。

当运行Maven测试时,TestNG会自动创建一个JunitReports文件夹,其中包含一个.xml报告。

问题是,当在我的config.xml文件中使用QAF和BDDStepFactory2时,我的junit报告显示所有测试都被忽略了。

有没有办法让我继续使用BDDStepFactory2,让青少年队显示通过或失败?

编辑:

JunitResult正在生成,然而,这就是的样子

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by org.testng.reporters.JUnitReportReporter -->
<testsuite skipped="2" hostname=
name="com.qmetry.qaf.automation.step.client.DataDrivenScenario" tests="4" failures="0" timestamp="2021-12-27T16:21:34 EST" time="12.916" errors="0">
<testcase name="Validate the Home Page" time="7.287" classname="com.qmetry.qaf.automation.step.client.DataDrivenScenario"/>
<system-out/>
<testcase name="Validate the Home Page" time="5.629" classname="com.qmetry.qaf.automation.step.client.DataDrivenScenario"/>
<system-out/>
<testcase name="scenario" classname="com.qmetry.qaf.automation.step.client.DataDrivenScenario">
<skipped/>
</testcase> <!-- scenario -->
<system-out/>
<testcase name="scenario" classname="com.qmetry.qaf.automation.step.client.DataDrivenScenario">
<skipped/>
</testcase> <!-- scenario -->
<system-out/>
</testsuite> <!-- com.qmetry.qaf.automation.step.client.DataDrivenScenario-> ```
At the top, the xml is showing skipped="2". Since this is what Azure devops is reading, it is seeming like two of my tests have been skipped.

很可能是TestNG版本的问题。使用最新(3.1.0-RC1(版本的QAF尝试最新(7.4.0(版本的TestNG。

<dependency>
<groupId>com.qmetry</groupId>
<artifactId>qaf</artifactId>
<version>3.1.0-RC1</version>
</dependency>
<!-- order is important -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.4.0</version>
</dependency> 

为了在junit报告中写入步骤信息(就像testng报告器输出一样(,通过设置属性启用testng输出。

report.log.testngoutput=true

检查您的测试结果目录,您可能会发现每次执行的junit报告。例如<project-root>test-results<timestamp>junitreports。如果您没有发现生成的junit报告,您可以启用testng默认侦听器。

最新更新