Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-red-contrib-testmonitor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-red-contrib-testmonitor
A comprehensive Node-RED wrapper for the TestMonitor API providing test case management, test runs, milestones, and test result operations for test automation workflows.
Features
- Complete TestMonitor API Coverage: Access all major TestMonitor endpoints
- Authentication Management: Secure API key authentication with connection testing
- Intelligent Caching: Configurable caching for improved performance
- Error Handling: Comprehensive error reporting and status indicators
- Flexible Input/Output: Support for both message properties and node configuration
- Status Tracking: Visual feedback for all operations
Installation
From Node-RED Palette Manager
- Open Node-RED in your browser
- Go to Menu → Manage Palette
- Click the Install tab
- Search for
node-red-contrib-testmonitor - Click Install
From npm
npm install node-red-contrib-testmonitorManual Installation
cd ~/.node-red
npm install node-red-contrib-testmonitorQuick Start
- Add Credentials: Drag a TestMonitor Credentials config node and configure your API details
- Add Operation Nodes: Drag TestMonitor nodes for your desired operations
- Configure Operations: Set up each node with the appropriate operation and parameters
- Connect and Deploy: Wire up your flow and deploy
Node Types
TestMonitor Credentials
Configuration node for API authentication and connection management.
Configuration:
- Base URL: Your TestMonitor instance API URL
- Project ID: Numeric ID of your TestMonitor project
- API Key: Your TestMonitor API key (securely encrypted)
TestMonitor TestCase
Manage test cases with full CRUD operations.
Operations:
get- Retrieve a specific test case by IDlist- List all test cases (optionally filtered by folder)create- Create a new test caseupdate- Update an existing test casedelete- Delete a test case
Input Parameters:
msg.payload = {
testCaseId: 123, // Required for get, update, delete
name: "Test Login", // Required for create
testCaseFolderId: 45, // Folder for organization
expected_result: "Success", // Expected outcome
instructions: ["Step 1", "Step 2"], // Test steps
tags: ["smoke", "authentication"], // Tags for categorization
description: "Test description", // Custom field
expected_value: "true", // Custom field
skip_time: 99 // Custom field
};TestMonitor TestRun
Manage test runs and execution cycles.
Operations:
get- Retrieve test run detailslist- List test runs (optionally filtered by milestone)create- Create a new test runupdate- Update test run propertiesdelete- Delete a test rungetTestCases- Get test cases in a test rungetTestResults- Get test results for a test runaddTestCases- Add test cases to a test runopenTestRun- Open test run for execution (set draft=false)closeTestRun- Close test run for editing (set draft=true)
Input Parameters:
msg.payload = {
testRunId: 456, // Required for most operations
milestoneId: 789, // Required for create
name: "Sprint 1 Testing", // Test run name
test_case_ids: [1, 2, 3], // For addTestCases operation
draft: true, // Draft status
users: [3], // Assigned users
tags: ["sprint1"] // Tags
};TestMonitor TestResult
Record and manage test execution results.
Operations:
get- Retrieve test result detailslist- List test results (filtered by test run/case)create- Create a new test resultupdate- Update test resultdelete- Delete test resultaddComment- Add comment to test resultaddAttachment- Upload file attachmentensureExists- Create or update test result
Input Parameters:
msg.payload = {
testResultId: 789, // Required for get, update, delete
testCaseId: 123, // Required for create
testRunId: 456, // Required for create
statusId: "passed", // Status: passed, failed, blocked, not_tested, retest
description: "Test completed successfully",
comment: "Additional notes", // For addComment
filePath: "/path/to/file" // For addAttachment
};TestMonitor Milestone
Manage project milestones and releases.
Operations:
get- Retrieve milestone detailslist- List all milestones in projectcreate- Create a new milestoneupdate- Update milestone propertiesdelete- Delete milestonegetTestRuns- Get test runs for milestonegetLastTestRun- Get the most recent test runcreateTestRun- Create new test run under milestone
Input Parameters:
msg.payload = {
milestoneId: 101, // Required for most operations
name: "Release 2.0", // Milestone name
milestoneTypeId: "release", // Type: release, feature, iteration, plan, sprint, version
description: "Major release", // Description
ends_at: "2024-12-31", // End date (YYYY-MM-DD)
testRunName: "Release Testing" // For createTestRun
};TestMonitor Project
Access project-level information and resources.
Operations:
get- Get project informationgetMilestones- List project milestonesgetMilestoneTypes- Get available milestone typesgetTestSuites- List test case folders/suitesgetTestCases- List all project test casesgetTestRuns- List project test runsgetCustomFields- Get custom field definitionsgetRequirements- List project requirementsupdate- Update project settings
Input Parameters:
msg.payload = {
milestoneId: 101, // Filter test runs by milestone
model: "test-cases", // Model for custom fields
filterTag: "api", // Filter requirements by tag
name: "Updated Project Name" // For update operation
};Configuration Examples
Basic Test Execution Flow
// 1. Get test cases from folder
msg.testCaseFolderId = 45;
// 2. Create test run
msg.payload = {
operation: "create",
milestoneId: 101,
name: "Automated Test Run",
test_cases: [1, 2, 3, 4, 5]
};
// 3. Record test results
msg.payload = {
operation: "ensureExists",
testCaseId: 1,
testRunId: 456,
statusId: "passed",
description: "Test completed successfully"
};Test Case Management
// Create test case
msg.payload = {
operation: "create",
name: "Verify User Login",
testCaseFolderId: 45,
expected_result: "User successfully logs in",
instructions: [
"Navigate to login page",
"Enter valid credentials",
"Click login button",
"Verify dashboard loads"
],
tags: ["authentication", "smoke"],
description: "Verifies the user login functionality"
};Milestone and Test Run Setup
// Create milestone
msg.payload = {
operation: "create",
name: "Sprint 3",
milestoneTypeId: "sprint",
description: "Sprint 3 development cycle",
ends_at: "2024-03-31"
};
// Create test run under milestone
msg.payload = {
operation: "createTestRun",
milestoneId: 101,
testRunName: "Sprint 3 Testing",
draft: false
};Authentication
The package uses Bearer token authentication with the TestMonitor API:
- Generate an API key from your TestMonitor account settings
- Configure the TestMonitor Credentials node with:
- Your TestMonitor instance URL
- Project ID
- API key
- Use the "Test Connection" button to verify connectivity
Caching
All nodes support intelligent caching for read operations:
- Default Duration: 5 minutes (300 seconds)
- Configurable: Adjust cache duration per node
- Automatic: Read operations are cached automatically
- Cache Keys: Generated based on operation and parameters
Error Handling
The package provides comprehensive error handling:
- Visual Status: Node status shows current operation state
- Error Messages: Detailed error information in Node-RED debug
- Graceful Degradation: Failed operations don't crash flows
- Validation: Input validation with helpful error messages
Status Indicators
Nodes display status using colored dots:
- Grey: Ready/idle
- Blue: Processing operation
- Green: Operation completed successfully
- Red: Error occurred
Custom Fields
TestMonitor custom fields are supported:
- Test Cases:
description,expected_value,skip_time - Automatic Processing: Custom fields are extracted and included in responses
- Create/Update: Custom fields can be set during creation/updates
Security
- Encrypted Storage: API keys are stored encrypted in Node-RED's credential system
- HTTPS Only: All API communications use HTTPS
- Token Based: Uses secure Bearer token authentication
- No Logging: Sensitive data is not logged
Requirements
- Node-RED: Version 1.0.0 or higher
- Node.js: Version 14.0.0 or higher
- TestMonitor Account: With API access enabled
- Network Access: HTTPS connectivity to TestMonitor instance
Dependencies
axios: HTTP client for API requestsnode-cache: Intelligent caching system
Support
For issues and feature requests:
- GitHub Issues: Report Issues
- Documentation: TestMonitor API Docs
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Changelog
1.0.0
- Initial release
- Full TestMonitor API coverage
- Comprehensive error handling
- Intelligent caching system
- Complete documentation