按特定顺序执行测试套件

编程入门 行业动态 更新时间:2024-10-08 07:32:27
本文介绍了按特定顺序执行测试套件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在使用 maven-failsafe 插件来触发配置类似于

I'm using the maven-failsafe plugin to trigger testng suites with configuration similar to

<suiteXmlFiles>
 <file>src/test/resources/suites/somesuite.xml</file>
 <file>src/test/resources/suites/anothersuite.xml</file>
 <file>src/test/resources/suites/yetanothersuite.xml</file>
</suiteXmlFiles>

但是套件或其中的测试没有以正确的顺序执行.有没有办法指定套件应按以下顺序执行

but the suites or the tests within them are not getting executed in the correct order. Is there a way to specifiy that the suites should be executed in the below order

somesuite.xmlanothersuite.xml又一个suite.xml

我不关心套件中测试的执行顺序,但只想在前一个套件完成后执行一个套件.是否有一些配置可以用来实现相同的目标?

I don't care about the order in which the tests within a suite is executed, but would like to execute one suite only after the previous one has completed. Is there some configuration which I could use to achieve the same?

推荐答案

创建一个单独的 testng.xml 文件并添加如下内容:

Create a seperate testng.xml file and add something like below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng/testng-1.0.dtd">
<suite name="Suite">
    <suite-files>
        <suite-file
            path="path-to\suite1.xml" />
        <suite-file
            path="path-to\suite2.xml" />
    </suite-files>
</suite>

然后将此 testng.xml 文件添加到您的 maven 套件中

And then add this testng.xml file to your maven suite

这篇关于按特定顺序执行测试套件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 22:09:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1400879.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:套件   顺序   测试

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!