If the automation project includes Cucumber + Java (with Maven) structure, then configure the Maven dependency in the project as described below.
...
1. Use API Key for Importing Results
Please How to find & generate Generate API Key? if you don't have API key for selected project.
...
Step 1: Add the following to the <build> -> <plugins> block in your pom.xml:
Code Block |
---|
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.20<0</version> </plugin> <configuration><plugin> <groupId>com.qmetry</groupId> <properties> <artifactId>automation</artifactId> <version>1.0.2</version> <property><executions> <execution> <name>listener< <phase>test</name>phase> <goals> <value>com.qmetry.automation.JUnitResultUploader</value> <goal>JUnitFileUpload</goal> </property>goals> </properties>execution> </configuration>executions> </plugin> </plugins> </build> |
Please refer to View Import Results using REST API section to view all possible request parameters.
Step 2: Add Add the following to the <dependencies> <pluginRepositories> block in pom.xml:
Code Block |
---|
<dependencies>
<dependency>
<groupId>com.qmetry</groupId>
<artifactId>automation</artifactId>
<version>1.0.0</version>
<exclusions>
<exclusion>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> |
Step 3: Add the following to the <repositories> block in pom.xml like:
Code Block |
---|
<repositories> <repository> <pluginRepositories> <pluginRepository> <id>qmetrytestmanager-mvn-repo</id> <name>QMetry Test ManagementManager Maven Repository</name> <url>https://raw.github.com/qmetry/qtm4j-maven-uploader/mvn-repo/</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> </repository>pluginRepository> </repositories>pluginRepositories> |
Step 4Step 3: Add qmetry.properties file to root directory of your project. Download thesample file.
...
Code Block |
---|
automation.qmetry.enabled = true automation.qmetry.url =https http://importresultsqtm4jpostgres.qmetry.com/prod:8080/rest/qtm/latest/automation/importresults-qtm4j automation.qmetry.apikey=14e4380004b798efd25e494e14bdf0b397e7f80320126fe9aece38f1 = {{your API key}} automation.qmetry.filepath = /target/surefire-reports/junit-results.xml automation.qmetry.testrunname = Test run cucumberRun automation.qmetry.labels = lbl1,lbl2 automation.qmetry.components = com1,com2 automation.qmetry.version = v1,v2 automation.qmetry.sprint = sprint1 automation.qmetry.platform = chrome automation.qmetry.comment = this is test run comment automation.qmetry.testrunkey = automation.qmetry.testassethierarchy = TestCase-TestStep automation.qmetry.jirafields = automation.qmetry.debug = true automation.qmetry.testcaseupdatelevel=2 automation.qmetry.attachfile=true |
If you are using on-premise JIRA, then configure below properties as well:
Code Block |
---|
automation.qmetry.authorization=Basic YWRtaW46YWRtaW4=
OR
automation.qmetry.username=admin
automation.qmetry.password=admin
|
...
3. View imported test results
Please refer to How to view imported test results? View Imported Test Results section to view imported test results.
...