如何 运行 java 我在 testng xml 中提到的文件?
How to run java files that I have mentioned in my testng xml?
我有一个 testng.xml 文件和一个 build.xml 文件。我想知道我们如何在 build.xml 文件中编写代码,它可以 运行 我在 testng.xml 文件中提到的所有 java 文件?
您可以定义 testng
任务并调用它。
详情请见the doc
<taskdef resource="testngtasks" classpath="testng.jar"/>
<testng classpathref="run.cp"
outputDir="${testng.report.dir}"
sourcedir="${test.src.dir}"
haltOnfailure="true">
<xmlfileset dir="${test14.dir}" includes="testng.xml"/>
</testng>
我有一个 testng.xml 文件和一个 build.xml 文件。我想知道我们如何在 build.xml 文件中编写代码,它可以 运行 我在 testng.xml 文件中提到的所有 java 文件?
您可以定义 testng
任务并调用它。
详情请见the doc
<taskdef resource="testngtasks" classpath="testng.jar"/>
<testng classpathref="run.cp"
outputDir="${testng.report.dir}"
sourcedir="${test.src.dir}"
haltOnfailure="true">
<xmlfileset dir="${test14.dir}" includes="testng.xml"/>
</testng>