2

I have placed a test automation suite in GitLab, I am able to run the test suite using testng.xml from eclipse.

I would like to set up a schedule a daily run from GitLab using CI/CD, please help/suggest me the steps to achieve continues testing from GitLab.

I tried by creating .gitlab-ci.yml file, but don't know the script to run the testng.xml file

Please help me if anybody tried this scenario

2 Answers2

0

Create a job running testng from command line and schedule the job execution using Pipeline schedules gitlab feature

Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48
0

set the pom.xml of the project:

<properties>
  <testng> </testng>
</properties>

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>3.0.0-M3</version>
    <configuration>
      <suiteXmlFiles>                                                
        <suiteXmlFile>path_suite/${testng}.xml</suiteXmlFile>
      </suiteXmlFiles>
    </configuration>
</plugin>

you can define a environment variable in the gitlab ci to run your suite test