使用IntelliJ IDEA的TestNG:如何在IntelliJ IDEA 9中使用testng.xml文件 [英] TestNG with IntelliJ IDEA: How to use the testng.xml file in IntelliJ IDEA 9

查看:1707
本文介绍了使用IntelliJ IDEA的TestNG:如何在IntelliJ IDEA 9中使用testng.xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在IntelliJ中运行TestNG单元测试,并在窗口中查看通过/失败输出;这是不使用任何testng.xml文件。我也可以使用maven在命令行中运行测试,即mvn clean test -Dgroups = fast,这样可以正常工作。

I'm able to run TestNG unit tests in IntelliJ and see the pass/fail output in a window; this is without using any testng.xml file. I can also run the tests in the command-line using maven, i.e. "mvn clean test -Dgroups=fast", and that works fine.

我创建了一个testng.xml文件并将其添加到我项目的目录中,但它似乎没有任何效果。

I've created a testng.xml file and added it to my project's directory, but it doesn't seem to have any effect.

如何整合testng.xml文件的用法以在IntelliJ IDEA 9中定义我的测试执行?

How do I integrate the usage of a testng.xml file to define my test execution within IntelliJ IDEA 9?

推荐答案

1.转至Intellij>首选项>插件>验证是否已启用TestNG-J。
2.配置testNG xml文件并将其作为外部源提供,方法是编辑配置并选择套件并提供您创建的testNG xml的路径。

1.Go to Intellij>Preferences>Plugins>Verify that TestNG-J is enabled. 2.Configure the testNG xml file and provide it as an external source by going to edit configurations and selecting suite and providing the path of the testNG xml you created.

这篇关于使用IntelliJ IDEA的TestNG:如何在IntelliJ IDEA 9中使用testng.xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆