Skip to content

This is sample TestNG + selenium project using JAVA.

Notifications You must be signed in to change notification settings

ershikhar/TestNG-java-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testng-maven-example

This is sample Testng + maven project in Java. It shows how to upload test result file on JIRA instance using QMetry for JIRA - Test Management.

Run test

please update these details in pom.xml file.

Step 1: Add the following to the <build> -> <plugins> block in your pom.xml:
<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>2.22.0</version>
		</plugin>
		<plugin>
			<groupId>com.qmetry</groupId>
			<artifactId>automation</artifactId>
			<version>1.0.2</version>
			<executions>
				<execution>
					<phase>test</phase>
					<goals>
						<goal>TestngFileUpload</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>
	
Step 2: Add the following to the <pluginRepositories> block in pom.xml like:
<pluginRepositories>
	<pluginRepository>
		<id>qmetrytestmanager-mvn-repo</id>
		<name>QMetry Test Manager Maven Repository</name>
		<url>https://raw.github.com/qmetry/qtm4j-maven-uploader/mvn-repo/</url>
		<releases>
			<enabled>true</enabled>
			<updatePolicy>always</updatePolicy>
		</releases>
	v</pluginRepository>
</pluginRepositories>
	
Step 3: Add qmetry.properties file to root directory of your project
Configure below properties:
automation.qmetry.enabled = true
automation.qmetry.url = https://importresults.qmetry.com/QmetryWisdom/importresults-qtm4j
automation.qmetry.apikey = aed606a7609feca7c4ac801677b7f825249d7358df9b72c3a2b9a91b046efb8e
automation.qmetry.filepath = /target/surefire-reports/testng-results.xml
automation.qmetry.testrunname = Test Run
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=0
	
if you are using on premise JIRA, then configure below properties as well:
automation.qmetry.authorization=Basic YWRtaW46YWRtaW4=
    	OR
automation.qmetry.username = admin
automation.qmetry.password = admin	
	
Once the file is configured, the automation test results will get uploaded automatically whenever the user executes the automation project (e.g. using 'mvn test').

After providing these details, you are ready to start test.

mvn test

It will generate surefile-reports.

Addionally, right after test completion, test result file will be uploaded on your JIRA instance if you have provided correct details in properties file.

About

This is sample TestNG + selenium project using JAVA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%