GithubHelp home page GithubHelp logo

reportportal-client-js's Introduction

#ReportPortal js client

Library used only for implementors of custom listeners for ReportPortal

Allready implemented listeners:

  • EMPTY

Installation

The latest stable version will be available on npm soon:

npm install reportportal-client

Usage

Main classes are:

  • RPClient

Basic usage example:

var Service = require("reportportal-client");

function now() {
    return new Date().getTime();
}

var rpConfig = {
    endpoint: "http://your_reportportal_url",
    project: "project",
    token: "your_reportportal_token"
};

var rp = new Service(rpConfig);

var startLaunchRQ = {
    name: "JSLaunchName",
    description: "Some LaunchDescription",
    tags: ["tag1", "tag2"],
    start_time: now(),
    mode: null
};

var startLaunchResponse = rp.startLaunch(startLaunchRQ);

var launchId;

startLaunchResponse.then(function (response) {
    var startTestItemRQ = {
        name: "Suite1",
        description: "SuiteDescription",
        tags: ["suite_tag1", "suite_tag2"],
        start_time: now(),
        launch_id: response.id,
        type: "SUITE"
    };
    var startSuiteResponse = rp.startTestItem(null, startTestItemRQ);
    startSuiteResponse.then(function (data) {
        var finishTestItemRQ = {
            end_time: now(),
            status: status.PASSED
        };
        rp.finishTestItem(data.id, finishTestItemRQ).then(function (data) {
            var finishExecutionRQ = {
                end_time: now(),
                status: status.PASSED
            };

            startLaunchResponse.then(function (response) {
                console.log(response.id);
                rp.finishLaunch(response.id, finishExecutionRQ)
                    .then(function (data) {
                        console.log(data);
                    })
            }, function (err) {
                console.log(err);
            });
        });
    })
});

Copyright Notice

Licensed under the GPLv3 license (see the LICENSE.txt file).

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.