UNPKG

@nicodoggie/node-kiwi-tcms-api

Version:

Vibe-coded Node.js wrapper for Kiwi TCMS XML-RPC API. Use at your own risk.

74 lines 2.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TestRunAPI = void 0; /** * Test Run API module */ class TestRunAPI { client; constructor(client) { this.client = client; } /** * Create a new test run */ async create(testRunData) { return await this.client.authenticatedCall('TestRun.create', [testRunData]); } async filter(query = {}, options) { const testRuns = await this.client.authenticatedCall('TestRun.filter', [query]); if (options?.includePermalinks) { // Get URL API instance from the main client const urlApi = this.getUrlApi(); return urlApi.injectPermalinksArray('run', testRuns, 'summary'); } return testRuns; } /** * Get the URL API instance for permalink injection * @private */ getUrlApi() { // Import here to avoid circular dependencies const { UrlAPI } = require('./utilities'); return new UrlAPI(this.client); } /** * Update a test run */ async update(testRunId, updateData) { return await this.client.authenticatedCall('TestRun.update', [testRunId, updateData]); } /** * Add a test case to test run */ async addCase(testRunId, testCaseId) { return await this.client.authenticatedCall('TestRun.add_case', [testRunId, testCaseId]); } /** * Remove a test case from test run */ async removeCase(testRunId, testCaseId) { await this.client.authenticatedCall('TestRun.remove_case', [testRunId, testCaseId]); } /** * Get test cases in test run */ async getCases(testRunId) { return await this.client.authenticatedCall('TestRun.get_cases', [testRunId]); } /** * Add a tag to test run */ async addTag(testRunId, tag) { return await this.client.authenticatedCall('TestRun.add_tag', [testRunId, tag]); } /** * Remove a tag from test run */ async removeTag(testRunId, tag) { await this.client.authenticatedCall('TestRun.remove_tag', [testRunId, tag]); } } exports.TestRunAPI = TestRunAPI; //# sourceMappingURL=testrun.js.map