Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

testlink-xmlrpc

Nyaran605GPL-3.0-or-later3.0.0TypeScript support: included

Connect to TestLink using XML-RPC API

testlink, api, test, testsuite, testcase, xmlrpc, connect, testlink-api, testlink-connect, xml-rpc

readme

testlink-xmlrpc

License: GPL v3 Test codecov npm testlink

ko-fi

testlink-xmlrpc is a NodeJS module that connect with TestLink XML-PRC API in order to provide methods to handle Test Suites, Test Case and any other internal functionality exposed in the API.

Usage

Library is prepared to work with JS Promises, so you should use them or Async/Await

import {TestLink} from 'testlink-xmlrpc';

const testlink = new TestLink({
    host: "testlink.my-server.com",
    port: 8080, // Set if you are not using default port
    secure: true, // Use https, if you are using http, set to false.
    apiKey: "MY_API_KEY", // The API KEY from TestLink. Get it from user profile.
});

Now you can interact with TestLink server. E.g.:

Check connection (with async/await)

async function checkConnection() {
    let ping = await testlink.sayHello();
    if (ping === "Hello!") {
        console.log("connection established");
    }
}

Validate API KEY (with Promise)

testlink.checkDevKey({devKey: 'APIKEY_to_check'}).then(reply => {
    if (reply === true)
        console.log("API KEY is valid");
    else
        console.log("API KEY is invalid");
});

Create a Test Case (with async/await)

async function createTestCase() {
    let testCase = await testlink.createTestCase({
        testprojectid: 5, // Project id in TestLink.
        testsuiteid: 63, // TestSuite id in TestLink.
        testcasename: "This is my new testCase", // Test Case name.
        authorlogin: "my_user", // Author of Test Case.
        summary: "This Test Case is an example", // Test Case description.
        steps: [] // Array containing the Test Case steps.
    });
}

Disclaimer

The development of this project is completely separated from TestLink development. So please, before open any issue here or in TestLink issue tracker, make sure you are opening the ticket in the right place.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[3.0.0] - 2024-07-07

💥 Breaking Change

  • This package is now pure ESM. Please read this.
  • Drop Node 14 and 16 support.

🏠 Internal

  • Update eslint config to use flat config.
  • Update eslint to v9.
  • Add restrictive Code Style with eslint.
  • Replace istanbuljs/nyc with c8.
  • Improve linting
  • Fix some non-working tests

[2.1.0] - 2023-04-07

Added

  • New methods supported:
    • getTestCaseRequirements
    • getRequirement
    • createUser
    • setUserRoleOnProject

      Changed

  • Add platformondesign & platformonexecution flag in createPlatform helper. (#258 thanks @HedCET)
  • Support TestLink 1.9.20_fixed:
    • Logic:
      • updateBuildCustomFieldsValues The parameter customfields now is a map with name as key.
      • getReqCoverage The parameter requirementdocid was replaced with requirementversionid.
      • getTestCaseAttachments: Added version parameter.
      • assignTestCaseExecutionTask: Parameters platformid and platformname are no longer required.
    • Tests: Updated and recorded.

Internal

[2.0.4] - 2022-12-18

Changed

  • Added tests for node 18 and 19.
  • Remove tests for node 17.

Fix

  • Exports typings properly. Fixes #207

[2.0.3] - 2022-02-06

Added

  • Add funding links to package.json
  • Add scripts.prepare (allows to use repo as version directly)
  • Run tests on node 17.

Changed

  • Update devDependencies and use closed versions.
  • Not launch tests on Node 15 as is not maintained.
  • Rename "master" branch to "main"
  • Improve packaging discarding .npmignore and using files property on package.json.

Fixed

Removed

  • Run tests on node 15.

[2.0.2] - 2021-05-27

Changed

  • Upgrade ts-node to v10.
  • Move ts-node to devDependencies.
  • Add links on README badges.

Fixed

  • Ignore .idea directory by git.
  • Ignore unnecessary files from package.
  • Fix repository url on package.json.

[2.0.1] - 2021-04-25

Fixed

  • Fix README badges.

[2.0.0] - 2021-04-25

Added

  • Added a lot of tests.

Changed

  • Now the project uses its own versioning, not linked to TestLink.
  • Migrated to TypeScript.

Fixed

  • Few fixes on mandatory fields on some methods.

[1.9.18-5] - 2019-02-27

Added

  • Allow using secure mode

Changed

  • platform is not required on getLastExecutionResult method

[1.9.18-4] - 2018-11-07

Added

  • Added "thanks" section to README

Fixed

[1.9.18-3] - 2018-10-26

Fixed

[1.9.18-2] - 2018-10-25

Fixed

  • #1
  • Few fixes on README

[1.9.18-1] - 2018-09-30

Added

  • Project begins