问题描述
所以我的典型工作流程是
So my typical workflow is
- 我在IntelliJ中使用TestNG编写数据驱动测试。
- 我提供数百个数据项
- 运行测试,其中一两个失败
- I在运行窗格中查看已通过/未通过测试的列表。
- I write a data driven test using TestNG in IntelliJ.
- I supply hundreds of data items
- Run the test and one or two of them fail
- I see the list of passed/failed tests in the "Run" pane.
我希望能够右键单击测试的实例并单独运行该测试(使用断点)。目前IntelliJ似乎没有这个功能。我必须右键单击测试,当我运行时,它会运行包含数百个数据点的整套测试。
I would like the ability to just right click that "instance" of the test and run that test alone (with breakpoints). Currently IntelliJ does not seem to have that feature. I would have to right click the test and when I run, it runs the whole set of tests with hundreds of data points.
这可能吗?
推荐答案
TestNG在 testng.xml
级别支持此操作可以指定应使用数据提供者的哪些索引。它被称为调用数字,您可以通过使用数据提供程序运行测试,查看它的部分调用数并查看 testng-failed.xml $ c $来查看它的样子。 c>生成。
TestNG supports this at the testng.xml
level, where you can specify which indices of your data provider should be used. It's called "invocation-numbers" and you can see what it looks like by running a test with a data provider, failing some of its invocation numbers and looking at the testng-failed.xml
that gets generated.
回到你的问题:你的IDE需要支持这个功能才能在UI中使用它,所以我建议你问一下IDEA论坛
Back to your question: your IDE needs to support this feature in order to make it available in the UI, so I suggest you ask on the IDEA forums
这篇关于Intellij在TestNG中运行一个测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!