npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zephyr_api

v0.0.8

Published

Node Js wrapper for Zephy for Jira Cloud API calls

Downloads

795

Readme

Zephyr Api

A simpified wrapper for making common zephyr for jira cloud api calls. This package uses native promises so all calls are thenable.

Install:

npm install zephyr_api

Auth: Save credential variable as gloabl var to be used by the module:

global.__ZAPIcreds = [process.env.ZAPI_ACCESS_KEY, process.env.ZAPI_SECRET_KEY, process.env.ASSIGNEE];

Require the module:

const ZAPI = require('zephyr_api');

Then use the available funtions :

Get a cycleId from a cyleName

ZAPI.getCycleIdFromCycleName(jiraProjectId: '156478', jiraProjectVersion: '45678', cycleName: 'myTestCycle');

Get a list of all cycles

ZAPI.getAllCycles(jiraProjectId: '45678', jiraProjectVersion: '45675');

Perform a zephyr test search

Pass in the query as a string. ZQL ref

let string = 'project=14598 AND issuetype=Test AND labels=RegressionTests';
ZAPI.zqlSearch(query: string);

Create a new cycle

The cycleId parameteter is optional and allows you to copy cycle info from an existing cyle.

let bodyData = {
	'name': `Name of your test cycle`,
	'build': 'Latest Build',
	'environment': 'dev',
	'description': `Enter your cycle description here`,
	'startDate': Date.now(), // or w/e you want
	'endDate': Date.now() + 600000,  // or w/e you want
	'projectId': yourProjectId,
	'versionId': yourVersionId
};
ZAPI.createNewCycle(body: bodyData, cycleId: '5458678945264654643524685764654');

Create a new execution

ZAPI.createExecution(cycleId:'45676456456484688945465446' , projectId: '14578', versionId: '14578', issueId: '15623', testStatus: '0', assignee: '[email protected]');

Get execution statuses

These are the pass / fail statuses

ZAPI.getExecutionStatuses();

Get execution info

ZAPI.getExecutionInfo(issueId: '14578', projectId: '12345', cycleId: '123121245644456677', executionId: '545645465465489756487');

Get test steps for a given test

ZAPI.getTestSteps(issueId: '14578', testId: '12345', projectId: '12356');

Update a step result

ZAPI.stepResultUpdate(stepResultId: '1654612368546454', issueId: '12345', executionId: '45648676545263567456', status: '0');

Update a test step

ZAPI.testStepUpdate(testStep: 'User logs in', testData: 'User Credentials', expectedResult: 'User is able to log in', stepNum: '1', testId: '12345', projectId: '12356');

Delete all steps for a given test

Note: this does an api call for each step

ZAPI.deleteAllTestSteps(testId: '12345', projectId: '45678');

Get server info

ZAPI.getServerInfo();

Get license info

ZAP.getLicenseInfo();

Get general info

ZAPI.getGeneralInfo();

Get a cycles issue ids

ZAPI.getCyclesIssueIds(cycleId: string, versionId: string, projectId: string);

Reference

A lot of the ids above have similar names. Here are some examples of where to find these ids.

jiraProjectId - You can get this from the Jira API , https://docs.atlassian.com/jira/REST/cloud/#api/2/project-getAllProjects For example a GET on https://company.atlassian.net/rest/api/2/project

jiraProjectVersion - Once you get the project Id from the above call you can append it to the same url to get the different versions: For example a get on https://company.atlassian.net/rest/api/2/project/14578

cycleId - User the provided funciton above to convert the name to an id or use the provided get all cylces and parse the results to grab the id.

issueId - You can get this from the Jira API , https://docs.atlassian.com/jira/REST/cloud/#api/2/issue For example a GET on https://company.atlassian.net/rest/api/2/issue/AOE-1234

executionId - From calling the getExecutionsStatuses above

stepResultId - From having the result of an execution id and getting that execution info

Prereq: node 6.10+