Qase API JavaScript Client

2.4.3 · deprecated · verified Sun Apr 19

The `qaseio` package provides a JavaScript client for interacting directly with the Qase Test Management System (TMS) API. It offers a comprehensive set of functionalities to programmatically manage various entities within Qase, including projects, test cases, test suites, milestones, shared steps, test plans, test runs, test run results, defects, custom fields, and attachments. The current npm version is 2.4.3, though the project's monorepo includes more recently updated sub-packages like `qase-javascript-commons` (v2.6.4) and various framework-specific reporters (e.g., `qase-jest` v2.3.0). This package is primarily intended for developers who need to build custom integrations with the Qase API or create bespoke test reporters for niche testing frameworks. A key differentiator and warning is that for common testing frameworks like Jest, Cypress, Playwright, TestCafe, or Mocha, the project strongly recommends using their dedicated, framework-specific reporter packages (e.g., `@qase-tms/qase-jest`) instead of this generic `qaseio` client, which is geared towards lower-level API interactions.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates how to initialize the Qase API client, fetch all available projects, create a new project, and check for its existence using environment variables for authentication.

import { QaseApi, ProjectCreate } from 'qaseio';

const QASE_API_TOKEN = process.env.QASE_API_TOKEN ?? '';
const PROJECT_CODE = process.env.QASE_PROJECT_CODE ?? 'PRJCODE';

const qase = new QaseApi({
    token: QASE_API_TOKEN,
});

async function manageQaseProjects() {
  if (!QASE_API_TOKEN) {
    console.error('QASE_API_TOKEN environment variable is not set.');
    return;
  }

  try {
    console.log('Fetching all projects...');
    const allProjects = await qase.projects.getAll();
    console.log('All Projects Data:', allProjects.data);

    const newProjectTitle = `My New Project ${Date.now()}`;
    const newProjectCode = `NPRJ${Date.now().toString().slice(-4)}`;
    console.log(`Creating a new project: ${newProjectTitle} (${newProjectCode})...`);
    const prj = new ProjectCreate(newProjectTitle, newProjectCode);
    const createdProject = await qase.projects.create(prj);
    console.log('Created Project:', createdProject.data);

    console.log(`Checking if project ${newProjectCode} exists...`);
    const projectExists = await qase.projects.exists(newProjectCode);
    console.log(`Project ${newProjectCode} exists:`, projectExists);

  } catch (error) {
    console.error('An error occurred:', error.response ? error.response.data : error.message);
  }
}

manageQaseProjects();

view raw JSON →