My JDK is 1.8 version, Surefire is 2.22.2, Maven is 3.6.3. I am using junit and spring annotations.
When I try to run my tests with mavn test command, I get no errores, I get success build and no cases run.
Running testCases.TestLogin Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@7bb11784 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.808 sec
When I run the class using IntellIJ UI runner, the cases are run correctly. My class name starts with Test*. Here is my test code.
package testCases; import appium.AppiumController; import org.junit.*; import org.springframework.context.annotation.Description; import screens.HomeScreen; import screens.LoginScreen; public class TestLogin extends AppiumController { protected static LoginScreen loginScreen; protected static HomeScreen homeScreen; @BeforeClass public static void setUp() throws Exception { startAppium(); loginScreen = new LoginScreen(driver, wait); homeScreen = new HomeScreen(driver, wait); } @After public void afterEach() { loginScreen.appReset(); } @Test @Description("Verify user can login with valid credentials") public void validLoginTest() throws Exception { loginScreen.login("admin", "admin"); Assert.assertTrue("Home screen is not visible\n", homeScreen.isHomeScreenVisible()); } @Test @Description("Verify user can not login with invalid credentials") public void invalidLoginTest() throws Exception { loginScreen.login("admin1", "admin1"); Assert.assertFalse("Home screen is visible\n", homeScreen.isHomeScreenVisible()); } @AfterClass public static void tearDown() throws Exception { stopAppium(); }
What is the problem and how can I run the test cases using command line?
*Test.java.. apart from that classes should start with an uppercase character ... The error output does not look like that .. Please show a full example of your test class. Where have you located your class etc. and which Maven version, JDK version, maven-surefire-plugin versions etc. are you using ?... - khmarbaiseConfiguring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configu... - khmarbaise