testlink-status-updater
v1.1.1
Published
Updates results in TestLink for use in a replacement tool
Downloads
2
Readme
Purpose
This tool can be used to generate a list of 100 test cases that can be imported into TestLink, and then automatically execute a number of those tests on a function call.
This allows engineers to use regression testing tools that don't suck while still allowing product mangers to refer to a single report in TestLink.
This tool has two functions: generateTestSuite
, and updateResults
generateTestSuite
This function generates a TestLink test suite that can be imported into TestLink.
The command can be run in node:
const updater = require('testlink-status-updater')
console.log(updater.generateTestSuite({
name: 'Test Results',
details: 'Output of some tool used for reporting test results in TestLink',
summary: 'A blank test representing a percentage of the total tests run'
}))
Parameters:
name
The name of the test plan. This needs to be unique; TestLink probably won't know what to do with a name clashdetails
Optional text that provides a summary for the test suitesummary
Optional text to show in each generated test case
This can also be run in the command line:
npm run generateTestSuite "Test Results"
To import a test plan into TestLink:
- Go to the TestLink homepage and select the Test Project you wish to add the test cases to
- Select Test Specification on the top bar
- Select a desired parent Test Suite folder
- In the right frame, click the cog and under Test Suite Operations, click the Import button
- Select the file you wish to import. It is crucial that under Action for duplicates, Update data on Latest version is selected. Otherwise extra garbage tests may get generated
To add tests to a Test Plan:
- Go to the TestLink homepage and select the Test Project you wish to add tests to
- On the right menu, select "Add / Remove Test Cases"
- Under the Settings section of the left frame, select the Test Plan to add tests to
- Select the tests that were uploaded earlier, and add all the tests (if prompted about removing execution status, click ok; the results are autogenerated)
updateResults
This function updates the results of the test cases created above in TestLink. It returns a promise.
const updater = require('testlink-status-updater')
updater.updateResults({
devKey: 't3stL1nkD3vK3y',
apiUrl: 'http://IP_ADDRESS:80/lib/api/xmlrpc/v1/xmlrpc.php',
project: 'Clouds',
plan: 'testing-test-plan',
build: 'build specified',
platform: 'Optional Platform',
suite: 'Test Results',
total: 9000,
passed: 10,
failed: 1,
blocked: 0
})
.then(() => console.log('done'))
Parameters:
devKey
A key generated for a particular user in TestLink. It can be found under "TestLink -> My Settings -> Personal API access key -> Generate a new key" in the web UIapiUrl
Some mysterious URL... honestly I don't even remember where I found it. Just replace IP_ADDRESS with the address you connect to to TestLink. Do not forget to add :80 to the endproject
The name of the Testlink Projectplan
The name of the Testlink Planbuild
The name of the Testlink Buildplatform
optional only required if the test cases are part of a platformsuite
The name of the Testlink Suite defined earlier with thegenerateTestSuite
functiontotal
The total number of actual testspassed
The number of tests out of the total that have passedfailed
The number of failed testsblocked
The number of blocked tests