我是使用 Appium 进行自动化的新手。因此,在使用 Eclipse 时,我创建了一个 TestSuite.java 文件,其中包含我的所有测试用例。我想通过命令终端在 Eclipse 中使用 JUnit 运行该文件。请帮助我在 mac 中使用命令。
我正在使用 macOS。我正在添加我的项目的一些屏幕截图。
(1) 这是我在 eclipse 中的项目
<小时/>
(2) 这是我的 TestSuite.java 文件
(3) 运行后输出
mvn surefire:test - DrunSuite=com.appium.automation.MobileGesturesRevised/TestSuite.class
(4)pom.xml文件
最佳答案
我想我在屏幕截图中看到了 pom.xml,因此您可以运行
mvn surefire:test -DrunSuite=com.appium.automation.MobileGesturesRevised/TestSuite.class
您只需在 Eclipse 运行菜单下为其创建一个新的运行配置即可。
关于java - 通过命令终端在 Eclipse 中使用 JUnit 运行 java 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44871194/