Giter Club home page Giter Club logo

pitaya's Introduction

Pitaya

CircleCI Coverage Status GitHub license Maven Central

API coverage visualizer tool. Creates an easily readable html report based upon the executed API test cases.

Currently TestNG and JUnit5 are the supported frameworks

Usage

Dependency

Maven:

<dependency>
    <groupId>io.github.osvalda</groupId>
    <artifactId>Pitaya</artifactId>
    <version>1.2.1</version>
    <scope>test</scope>
</dependency>

Gradle:

dependencies {
    testCompile("io.github.osvalda:Pitaya:1.2.1")
}

Configuration

Input file

Pitaya endpoint list file

Create a text file in your resource directory and add lines in the following format:

DELETE /posts/{post_id}, Posts

GET /posts/{post_id}/comments, Comments
GET /comments/{post_id}, Comments

GET /posts/{post_id}/pics, Pictures
...
OpenAPI Version 3 file

Copy the open api file (json or yaml) to resources directory or use its URL

Properties file

Create a pitaya.properties file into the root of your resources directory and add the following properties to it:

Key Value Mandatory
application.name The name of your SUT Yes
endpoint.list.input The endpoint list file's relative path or Open API file URL Yes
bar.chart.width The width of the Area-wise Endpoint Coverages chart No
bar.chart.height The height of the Area-wise Endpoint Coverages chart No

Test case modifications

TestNG

To use Pitaya with TestNG add the reporter to the listeners in your test class(es):

@Listeners({PitayaCoverageReporter.class})
public class YourTestNGTestClass {
    // ...
}

JUnit 5

To use Pitaya with JUnit5 add the extension to the extensions in your test class(es):

@ExtendWith(PitayaCoverageExtension.class)
public class YourJUnit5TestClass {
    // ...
}

In Test Methods

Annotate all your test methods which you want to include in the report:

@Test
@TestCaseSupplementary(api = {GET + "/one_of_your_endpoint"})
public void yourTestMethod() {
    // ...
}

Tools and Plugins

The following tools are used across the project.

Name Version
testng 7.4.0
junit.jupiter 5.8.1
junit.platform 1.8.1
freemarker 2.3.29
lombok 1.18.12
assertj-core 3.14.0
apache.commons 3.8.1
commons-io 2.6
guava 11.0.2
slf4j 1.7.30
logback 1.2.3
jmockit 1.41
mockito 2.15.0
swagger-parser-v3 2.0.21

Preview

charts endpoint list

CI Issues and solutions

Jenkins

If Jenkins fails to display css, then run the following command in Manage Jenkins / Script console

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

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.