Maven doesn't run selenium test
您好我正在尝试使用Maven运行JUnit测试。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | public final class CreateAllObject { public static final String INIT_URL = new String("http://fpt2:8080/webTest/"); @BeforeClass public static void initialisation() { Driver driver = new Driver(PROFILE_PATH); driver.getDriver().get(INIT_URL); driver.getDriver().findElement(By.xpath(ADMIN_ARM_XPATH)).click(); BASE_URL = driver.getDriver().getCurrentUrl(); driver.getDriver().close(); try { new File("C://logfiles//").mkdirs(); log_work = new BufferedWriter (new FileWriter( new File("C://logfiles//" + new SimpleDateFormat("dd.MM.yyyy 'at' HH-mm-ss").format( new GregorianCalendar().getTime())+".log_work"))); } catch (IOException e) { e.printStackTrace(); } } @Test public void test() { Driver driver = new Driver( PROFILE_PATH ); ... } @AfterClass public static void destruction() { try { log_work.close(); } catch (IOException e) { e.printStackTrace(); } } |
}
在项目的基目录中运行命令
[INFO] --- maven-compiler-plugin:2.3.2:testCompile
(default-testCompile) @ uitests-core ---[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @
uitests-core ---[INFO] Surefire report directory:
/var/opt/jenkins/workspace/platform-ui-tests/core/target/surefire-reports------------------------------------------------------- T E S T S
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
我不知道为什么它没有运行我的测试。
请帮帮我。
默认情况下,Maven会查找名为
看到这个答案:Maven没有发现JUnit测试也能运行。