Run Test Bot
Run test bot with JWT-based authentication for CI/CD pipelines
jwtToken (required)
JWT token for authentication. The token must contain:
organizationId - Organization identifier (required)
urlDetails - Array containing URL configuration with key executorServiceApiUrl (required)
- The
executorServiceApiUrl value is used directly as the service endpoint
JWT Token Format:
{
"organizationId": "c599bd03-9b32-46da-891a-267c351f207a",
"organizationName": "Your Organization",
"partnerId": "partner-uuid-here",
"tokenType": "USER",
"iat": 1234567890,
"exp": 1234567890,
"urlDetails": [
{
"key": "executorServiceApiUrl",
"value": "https://ca-utap-gateway-svc.example.net/ca-utap-test-bot-executor-svc"
}
]
}
testBotConfiguration (required)
Stringified JSON configuration for the test bot. Must include at minimum:
testBotId - The ID of the test bot to execute (required)
Additional optional fields:
{
"testBotId": "string (required)",
"projectId": "string (optional)",
"name": "string (optional)",
"executionConfiguration": {
"browser": "string",
"browserVersion": "string",
"closeBrowserAfterEachExecution": "boolean",
"customProperties": [
{
"customPropertyId": "string",
"name": "string",
"value": "string"
}
],
"type": "string",
"gridId": "string",
"excludeToBeRepairedTest": "boolean",
"gridUrl": "string",
"gridUrlForExecution": "string",
"osType": "string",
"resolution": "string",
"screenshotAfterEachStep": "boolean",
"screenshotOnError": "boolean",
"screenshotOnFinish": "boolean",
"timeout": "number",
"waitForElementTimeout": "number"
}
}
Example Usage
- task: runTestBot@1.4.5
inputs:
jwtToken: '$(JWT_TOKEN)'
testBotConfiguration: '{"testBotId":"6d3879da-5bde-47d3-99c4-8639f0ce6e4a","name":"API Validation Test Bot"}'
How It Works
- Token Parsing: The task extracts
organizationId and executorServiceApiUrl from the JWT token's urlDetails array
- Execution Trigger: Sends POST request to
{executorServiceApiUrl}/rest/api/testops/{testBotId}/execute with JWT authentication
- Status Monitoring: Polls for execution status every 5 seconds at
/rest/api/testops/execution/{executionId}/status
- Results Retrieval: Fetches detailed results from
/rest/api/testops/execution/{executionId}/detailed-results when execution completes
- Result Display: Displays comprehensive execution summary including:
- Test suites, scripts, and iterations
- Pass/fail counts
- Error messages and execution details
- Screenshot and video URLs (if available)
- Task Result: Sets Azure DevOps task result based on test bot execution outcome (Succeeded/Failed)
Features
- Bundled Dependencies: All npm dependencies are bundled into a single file, eliminating the need for
npm install during deployment
- Comprehensive Error Handling: Validates inputs and provides clear error messages
- Detailed Reporting: Displays execution results with status icons, timing information, and failure details
- Timeout Protection: Maximum polling time of 30 minutes to prevent indefinite waiting
Technical Details
- Runtime: Node.js 10, 16, or 20.1
- Bundling: Uses tsup to bundle all dependencies
- Dependencies:
azure-pipelines-task-lib (bundled)
jwt-decode (bundled)
ofetch (bundled)