Code Monkey home page Code Monkey logo

reportizer's Introduction

Reportizer

Reportizer is a TS/JS library for interacting with the Report Portal API. Works best with cucumber-js.

Contents

Installation

Use the package manager npm to install reportizer.

npm install --save-dev reportizer

Usage

Please note, before using this package, you should set up an instance of Report Portal for yourself. A public instance is offered by the Report Portal team for demonstration purposes on their site.

Create item

const reportPortalClient = new ReportPortalClient(baseUrl, launchId, authToken);

const itemId = await reportPortalClient.createItem(
    'The one where employees get paid.',
    'Tests the payment process for employees works.',
    'SCENARIO'
);

Valid item types can be seen in the ItemType type in this repo.

Finish item

Finishing an item automatically maps a cucumber status to a Report Portal status. Inspect the ReportPortalClient class in this repo if you want to know how the statuses are mapped.

await reportPortalClient.finishItem(
    itemId,
    Status.PASSED
);

Alternatively, as part of a cucumber After hook:

After(async function({ result }) {
    await reportPortalClient.finishItem(
        itemId,
        result.status
    );
});

Add logs to item

await reportPortalClient.addLogToItem(
    itemId,
    'info',
    'This is a log message!'
);

Valid log levels can be seen in the LogLevel type in this repo.

Contributing

See the contributing guidelines.

License

Apache-2.0

reportizer's People

Contributors

dependabot[bot] avatar pwookey avatar ricool06 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  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.