Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
testrail-api-client
Advanced tools
TypeScript and JavaScript binding for TestRail API v2
Using npm:
$ npm install testrail-api-client
Using yarn:
$ yarn add testrail-api-client
const client = require("testrail-api-client");
const client_options = require("testrail-api-client").default;
const options = {
domain: "example.testrail.com",
username: "example@example.com",
password: "ABC",
};
const client = new client_options(options);
const runName = "Example Run Name";
const runDescription = "Example Run Description";
const projectId = 1;
const testSuiteId = 123; // optional
const caseIds = [1, 2, 3]; // optional
const milestoneId = 4; // optional
client
.addRun(runName, runDescription, projectId, testSuiteId, caseIds, milestoneId)
.then(function (runId) {
console.log(`Created run with id: ${runId}`);
})
.catch((error) => console.error(error));
const runId = 123;
client
.getTests(runId)
.then(function (cases) {
console.log(`Number of cases from run #${runId}: ${cases.length}`);
})
.catch((error) => console.error(error));
const runId = 123;
client
.closeRun(runId)
.then(console.log(`Closed run with id: ${runId}`))
.catch((error) => console.error(error));
const projectId = 1;
const suiteId = 123; // optional
client
.getCases(projectId, suiteId)
.then(function (cases) {
console.log(`Number of cases in suiteid=${suiteId}: ${cases.length}`);
})
.catch((error) => console.error(error));
const runId = 123;
const reportTests = [{ case_id: 12345, status_id: 1, comment: "Test comment" }];
client
.addResultsForCases(runId, reportTests)
.then(() => {
console.log("Done");
})
.catch((err) => {
console.log(err);
});
const runId = 123;
const description = "Run Description";
client
.updateRunDescription(runId, description)
.then(() => {
console.log("Done");
})
.catch((err) => {
console.log(err);
});
const runId = 123;
client
.addAttachmentToResult(runId, '../testrail-api-client/README.md')
.then((response) => {
console.log("Done", response);
})
.catch((err) => {
console.log(err);
});
Variable | Description |
---|---|
TESTRAIL_DOMAIN | This is a required variable to point the client to your TestRail instance. Required Example: example.testrail.com |
TESTRAIL_USERNAME | This is a required variable to authenticate HTTP communication. Required Example: example@example.com |
TESTRAIL_APIKEY | This is a required variable to authenticate HTTP communication. Can be obtained in TestRail settings, see [http://docs.gurock.com/testrail-api2/accessing]. Required Example: ABC |
TESTRAIL_PROJECTID | This is a required variable to point client to the right project. Required Example: 1 |
FAQs
JavaScript client for TestRail API
We found that testrail-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.