# testrailmetrics

> this project provides the testmetrics from testrail

Latest version **1.1.9** (published 2022-10-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install testrailmetrics
pnpm add testrailmetrics
yarn add testrailmetrics
bun add testrailmetrics
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.9 |
| Published | 2022-10-11 |
| First published | 2022-09-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 7.7 MB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Author | Durga and Vishal |
| Maintainers | vishalbabuks |
| Keywords | testrail, api |

## Links

- npm: https://www.npmjs.com/package/testrailmetrics
- Repository: https://github.com/vishalbabuks/TestRailMetrics
- Homepage: https://github.com/vishalbabuks/TestRailMetrics#readme
- Issues: https://github.com/vishalbabuks/TestRailMetrics/issues
- npm.io page: https://npm.io/package/testrailmetrics

## Dependencies (11)

- [umd](https://npm.io/package/umd.md) ^3.0.3
- [path](https://npm.io/package/path.md) ^0.12.7
- [axios](https://npm.io/package/axios.md) ^0.27.2
- [https](https://npm.io/package/https.md) ^1.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.1
- [webpack](https://npm.io/package/webpack.md) ^5.74.0
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.19.1
- [babel-loader](https://npm.io/package/babel-loader.md) ^8.2.5
- [testrail-api](https://npm.io/package/testrail-api.md) ^1.3.6
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.19.1
- [webpack-node-externals](https://npm.io/package/webpack-node-externals.md) ^3.0.0

## Recent versions

- 1.1.9 (latest) — 2022-10-11
- 1.1.8 — 2022-10-10
- 1.1.7 — 2022-09-21
- 1.1.6 — 2022-09-21
- 1.1.5 — 2022-09-19
- 1.1.4 — 2022-09-13
- 1.1.3 — 2022-09-13
- 1.1.1 — 2022-09-09
- 1.1.0 — 2022-09-09
- 1.0.0 — 2022-09-01

## README

# testrailmetrics
testrailmetrics package display the test metrics from the TestRail application.

# Pre-Requisite
- NodeJS
- Visual Studio Code.

## Installation
Create a node project

Create a package.json file using npm init -y command

Install the package using below command.

npm i testrailmetrics

# Usage
getPassFail

This functions extracts the pass and fail count of the test runs/test plans present in a respective testrail project.

Pass the below arguments to the function to get the count
- Baseurl --> The URL of the testrail instance eg(https://pocmodule.testrail.io)
- TestRailuser--> TestRail User email id
- APIkey---> API Key for the respective Testrail User generated inside TestRail application
- projectId-->The ID of the project
- runId--->The ID of the test run. 
- limit-->The number of test cases the response should return (The response size is 250 by default) 
- Offset-->Where to start counting the tests cases from (the offset)

getautomationmanualcount

This functions extracts the manual and automation test cases count for a given project in the testrail application

Pass the below arguments to the function to get the count
- Baseurl --> The URL of the testrail instance eg(https://pocmodule.testrail.io)
- TestRailuser--> TestRail User email id
- APIkey---> API Key for the respective Testrail User generated inside TestRail application
- projectId-->The ID of the project
- suiteId--->The ID of the test suite. 
- limit-->The number of test cases the response should return (The response size is 250 by default) 
- Offset-->Where to start counting the tests cases from (the offset)



# Example
```javascript
import {passfail} from 'testrailmetrics';

passfail.getpassfail("https://www.example.testrail.in","testuser@test.com","password or apikey",/*projectid=*/ 1, /*runid=*/ 1,limit,offset).then(function(result) {
    console.log(result);
 }))
 ```

 ```javascript
import {manualautomated} from 'testrailmetrics';

manualautomated.getautomationmanualcount("https://www.example.testrail.in","testuser@test.com","password or apikey",/*projectid=*/ 1, /*suiteid=*/ 1,limit,offset).then(function(result) {
    console.log(result);
 }))
 ```

getJiraopenbugs

 This function returns the open bugs present in the given jira project

 Pass the below arguments to the function to get the count
- Baseurl --> The URL of the Jira instance eg(https://testing.atlassian.net)
- Jirauser--> Jira User email id
- Jirauser API Key---> API Key for the respective JIRA instance User generated inside Jira application
- Jiraprojectcode-> The jira project code for the respective project.
- Isbearertoken ---> User can authenticate bearertoken using true flag. 
  If flag is false then basicauth takes place, the condition is handled internally in our code.


# Example
```javascript
import { jirametrics} from "testrailmetrics";


jirametrics.getJiraopenbugs("https://testingcompany.testco.net","test@testjira.com","<Jira API Key>",<"your jiraproject code">,true)
.then(function(result) {
    console.log(result) 
 })
 ```

 getJiraticketsperlatestrelease

 This function returns the tickets present in the latest release.

 Pass the below arguments to the function to get the count
- Baseurl --> The URL of the Jira instance eg(https://testing.atlassian.net)
- Jirauser--> Jira User email id
- Jirauser API Key---> API Key for the respective JIRA instance User generated inside Jira application
- Jiraprojectcode-> The jira project code for the respective project.
- Isbearertoken ---> User can authenticate bearertoken using true flag. 
  If flag is false then basicauth takes place, the condition is handled internally in our code.


# Example
```javascript
import { ticketperlatestrelease} from "testrailmetrics";


ticketperlatestrelease.getJiraticketsperlatestrelease("https://testingcompany.testco.net","test@testjira.com","<Jira API Key>",<"your jiraproject code">,true)
.then(function(result) {
    console.log(result) 
 })
 ```

 getJirabugsperlatestrelease

 This function returns the bugs present in the latest release.

 Pass the below arguments to the function to get the count
- Baseurl --> The URL of the Jira instance eg(https://testing.atlassian.net)
- Jirauser--> Jira User email id
- Jirauser API Key---> API Key for the respective JIRA instance User generated inside Jira application
- Jiraprojectcode-> The jira project code for the respective project.
- Isbearertoken ---> User can authenticate bearertoken using true flag. 
  If flag is false then basicauth takes place, the condition is handled internally in our code.


# Example
```javascript
import { bugsperlatestrelease} from "testrailmetrics";


bugsperlatestrelease.getJirabugsperlatestrelease("https://testingcompany.testco.net","test@testjira.com","<Jira API Key>",<"your jiraproject code">,true)
.then(function(result) {
    console.log(result) 
 })
 ```

---
_Source: https://npm.io/package/testrailmetrics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
