Giter Site home page Giter Site logo

jiratestng's Introduction

JIRATestNGListener for TestNG

JIRATestNGListener for TestNG is a Java library for creating proper artifact for Jenkins plugin.

Installation

Add rows below in pom.xml file

<repositories>
    <repository>
        <id>JiraTestNG-mvn-repo</id>
        <url>https://raw.github.com/EDbarvinsky/JiraTestNG/mvn-repo</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
....
</repositories>
<dependencies>
    <dependency>
        <groupId>com.epam.jira</groupId>
        <artifactId>adapter-java-testng</artifactId>
        <version>2.0-SNAPSHOT</version>
     </dependency>
....
</dependencies>

Usage

There is a few different ways to use a library:

  1. Using @Listener on test class
@Listeners(JIRATestNGListener.class)
public class YourTestClass {
....
}
  1. Add proper listener in testng.xml
<suite name="your_suite_name">
    <listeners>
        <listener class-name="com.epam.testng.JIRATestNGListener"/>
    </listeners>
....
</suite>
  1. If you are going to add current listener thrue the TestNG runner configuration
public class Runner {
    public static void main(String[] args) {
        TestNG testNG = new TestNG();
        testNG.addListener((ITestNGListener) new JIRATestNGListener());
....
        testNG.run();
    }
}

Test results mapping

Test result statuses in TestNG is not equal for the statuses in QASpace. Plugin provides next way of mapping:

TestNG status QASpace status
Excluded Out of Scope
Scipped Untested
Failed Failed
Passed Passed

Features

  • JIRATestKey annotaion Necessarily attribute of annotation is a key, whick must be taken from JIRA ticket.
@Test
@JIRATestKey(key = "JIRA ticket")
 public void test1() {
....
}

Also, there is a flag accordinaly to which value execution and preparation of test results could be skipped.

@Test
@JIRATestKey(key = "JIRA ticket", disabled = true)
 public void test1() {
....
}
  • Test execution proccess

    If test data is delivered using parameters or data provider, for that test is going to be formed one final result, e.g. if one collection of test data is failed, then all test is going to be marked is failed.

  • Attachment

    To add attachment use static method addAttachment() in JIRAAttachment class, which takes two parametrs - the first one is File object and the second is a String which should contain a JIRA ticket. After the testing procces all attachments is going to be mapped to the proper JIRA tickets and added to testresult.xml file. Too add attachment to the JIRA ticket add row bellow:

....
JIRAAttachment.addAttachment(((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE), "test1");
....

Implemented functionality

  • Attachments
  • Annotation approach
  • Multithreading

jiratestng's People

Contributors

edbarvinsky avatar

Watchers

James Cloos 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.