我们用 Java+Webdriver+Eclipse 编写测试并使用 Maven 运行它们。要启动应用程序,我们需要启动一个 java 文件 - STARTAPP.java/class
所以,如果我们开始运行测试(第一次),我们应该这样写: mvn test -Dtest=STARTAPP,myfirsttestname
下一次,我们是否应该跳过 STARTAPP(例如: mvn test -Dtest=mysecondtestname
是否测试目标,编译java文件?
此致
Does the test goal, compile the java file?
Test goal doesn't compile any java classes itself. It's done by maven compiler plugin goals 'compile' and 'testCompile'. But since test goal goes after compile goals, then you will have your java classes compiled.
Build phase test
is preceded by build phase compile
, during which the source code of the project is compiled. Take a look at Build Lifecycle in Maven.