GithubHelp home page GithubHelp logo

pghildiy / junit-java-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qmetry/junit-java-example

0.0 1.0 0.0 135 KB

This is sample junit + selenium project using JAVA.

Java 98.84% Dockerfile 1.16%

junit-java-example's Introduction

JUnit-maven-example

This is sample JUnit + 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>JUnitFileUpload</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>
	
Step 2: Add the following to the <pluginRepositories> block in pom.xml:
<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/prod/importresults-qtm4j
automation.qmetry.apikey = {{your API key}}
automation.qmetry.filepath = target/surefire-reports/TEST-com.javacodegeeks.examples.junitmavenexample.CalculatorTest.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.

junit-java-example's People

Contributors

pghildiy avatar prajapatihiten avatar vishaljhala avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.