
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
testmo-api-client
Advanced tools
Official TypeScript SDK for the Testmo API - Automation runs, threads, and test results
Official TypeScript SDK for the Testmo API. Manage automation runs, threads, and test results programmatically.
npm install testmo-api-client
import { TestmoClient } from 'testmo-api-client';
const client = new TestmoClient({
baseUrl: 'https://your-org.testmo.net',
apiToken: process.env.TESTMO_API_TOKEN!
});
// Create an automation run
const { id: runId } = await client.automationRuns.create(projectId, {
name: 'CI Build #123',
source: 'backend',
tags: ['nightly', 'regression']
});
// Create a thread and submit test results
const { id: threadId } = await client.threads.create(runId);
await client.threads.append(threadId, {
tests: [
{ name: 'test_login', status: 'passed', elapsed: 1500000 },
{ name: 'test_checkout', status: 'failed', fields: [
{ name: 'Error', type: 4, value: 'Timeout', is_highlight: true }
]}
]
});
// Complete thread and run
await client.threads.complete(threadId);
await client.automationRuns.complete(runId, { measure_elapsed: true });
new TestmoClient({
baseUrl: string, // Your Testmo instance URL
apiToken: string, // API token for authentication
timeout?: number // Request timeout in ms (default: 30000)
})
const runs = await client.automationRuns.list(projectId, {
page: 1,
per_page: 100,
status: '3', // Filter by status (2=success, 3=failure, 4=running)
created_after: '2024-01-01T00:00:00.000Z',
expands: 'automation_sources,configs,users'
});
const run = await client.automationRuns.get(runId, {
expands: 'automation_sources,users'
});
const { id } = await client.automationRuns.create(projectId, {
name: 'Run Name',
source: 'frontend', // Auto-created if doesn't exist
config: 'Chrome', // Optional configuration
milestone: 'v2.0', // Optional milestone
tags: ['smoke', 'ci'],
artifacts: [{
name: 'build-log.txt',
url: 'https://storage.example.com/logs/build.txt',
mime_type: 'text/plain',
size: 1024
}],
fields: [{
name: 'Build Number',
type: 1,
value: '12345'
}],
links: [{
name: 'CI Build',
url: 'https://ci.example.com/build/123'
}]
});
await client.automationRuns.append(runId, {
artifacts: [{ name: 'log.txt', url: 'https://...' }],
fields: [{ name: 'Duration', type: 1, value: '5m' }],
links: [{ name: 'Report', url: 'https://...' }]
});
await client.automationRuns.complete(runId, {
measure_elapsed: true // Auto-calculate execution time
});
const { id: threadId } = await client.threads.create(runId, {
elapsed_observed: 600000000, // 10 minutes in microseconds
artifacts: [{ name: 'thread-log.txt', url: 'https://...' }]
});
await client.threads.append(threadId, {
elapsed_observed: 120000000,
tests: [
{
key: 'unique-test-hash', // Optional unique identifier
name: 'test_user_creation',
folder: 'Users',
status: 'passed',
elapsed: 60000000, // Microseconds
file: 'users.test.js',
line: 100,
assertions: 5,
artifacts: [{
name: 'screenshot.png',
url: 'https://storage.example.com/screenshot.png'
}]
},
{
name: 'test_user_deletion',
folder: 'Users',
status: 'failed',
fields: [{
name: 'Error',
type: 4,
value: 'AssertionError: expected 200 but got 500',
meta: { type: 'AssertionError' },
is_highlight: true
}]
}
]
});
await client.threads.complete(threadId, {
elapsed_observed: 600000000,
elapsed_computed: 580000000
});
import { TestmoApiError, TestmoNetworkError, TestmoConfigError } from 'testmo-api-client';
try {
await client.automationRuns.get(999999);
} catch (error) {
if (error instanceof TestmoApiError) {
console.error(`API Error: ${error.statusCode} - ${error.message}`);
console.error('Response:', error.response);
} else if (error instanceof TestmoNetworkError) {
console.error(`Network Error: ${error.message}`);
} else if (error instanceof TestmoConfigError) {
console.error(`Config Error: ${error.message}`);
}
}
All TypeScript types are exported for your convenience:
import type {
AutomationRun,
TestResult,
Artifact,
Field,
Link,
PaginatedResponse,
CreateAutomationRunParams,
AppendToThreadParams,
} from 'testmo-api-client';
| Type | Description |
|---|---|
| 1 | String |
| 2 | Integer |
| 3 | Boolean |
| 4 | Text/Multiline |
| Status | Description |
|---|---|
| 2 | Success |
| 3 | Failure |
| 4 | Running |
fetch)MIT © MAkhamis
FAQs
Official TypeScript SDK for the Testmo API - Automation runs, threads, and test results
The npm package testmo-api-client receives a total of 9 weekly downloads. As such, testmo-api-client popularity was classified as not popular.
We found that testmo-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.