Skip to content

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

License

Notifications You must be signed in to change notification settings

adpllc/reportizer

Repository files navigation

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

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •