0

I created Maven project using Java for automation testing. When i run mvn verify it does not open any browser. What wrong with it? I can easily run testng class from eclipse but i need to run for CI/CD.

<build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
             <source>1.8</source>
             <target>1.8</target>
          </configuration>
        </plugin>

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.0.0-M3</version>
        <configuration>
            <suiteXmlFiles>
                <suiteXmlFile>testng.xml</suiteXmlFile>
            </suiteXmlFiles>
        </configuration>

        <executions>
            <execution>
                <goals>
                    <goal>integration-test</goal>
                    <goal>verify</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

      </plugins>
    </pluginManagement>
  </build>

Please help. Thanks.

Maven Console Output

Project Structure

nicholas
  • 2,581
  • 14
  • 66
  • 104
  • can you share maven console output? – Adi Ohana Jun 17 '19 at 08:17
  • Added the maven console output. – nicholas Jun 17 '19 at 08:28
  • there could be many reason for not executing the test. Check you have executable permission on CI/CD for the file testng.xml or the folder of it. also, don't use plugin management plugin. please check the link https://stackoverflow.com/questions/10483180/what-is-pluginmanagement-in-mavens-pom-xml – Murthi Jun 17 '19 at 09:03
  • The run failed on locally and it has nothing to do with CI/CD now. – nicholas Jun 17 '19 at 09:07
  • 1
    Move the configuration of maven-failsafe-plugin from pluginManagement to outside of pluginManagement.. – khmarbaise Jun 17 '19 at 11:08

0 Answers0