Tosca Integration with Azure DevOps Pipelines
Integrating **Tosca** with **Azure DevOps Pipelines** enables automated test execution as part of your CI/CD workflow. Here's a comprehensive guide to help you achieve this:
---
### ✅ **Overview of the Integration**
* **Tosca**: A model-based test automation tool by Tricentis.
* **Azure DevOps Pipelines**: Automates the build, test, and deployment of applications.
By integrating them, you can:
* Trigger Tosca test executions from Azure pipelines
* Collect and analyze test results within the DevOps pipeline
* Automate regression tests during builds or releases
---
### ๐งฐ **Prerequisites**
1. **Tosca TestCases**: Already created and validated in Tosca Commander.
2. **Tosca Execution Server / Distributed Execution (DEX)** installed.
3. **Azure DevOps Agent** (self-hosted) installed on the same machine as Tosca.
4. **Tricentis Tosca CLI tools** (e.g., `TestEvent`, `TCExe`) installed.
5. **License setup**: Ensure licenses are available for automated runs.
---
### ๐ง **Steps to Integrate Tosca with Azure DevOps Pipelines**
#### 1. **Install the Azure DevOps Agent on Tosca Machine**
* Go to **Azure DevOps > Organization Settings > Agent Pools**
* Create a self-hosted agent
* Download and configure the agent on the Tosca machine
* This allows Azure Pipelines to run jobs on a machine that has Tosca installed
#### 2. **Create a Tosca TestEvent or Use Existing Test Configuration**
* Use Tosca Commander to define a **TestEvent**
* This defines the test cases to execute
* Optionally use `ExecutionLists`
#### 3. **Create a PowerShell or Command Line Script**
Use Tosca CLI tools in your script:
**Example (PowerShell):**
```powershell
& "C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\ToscaCommander\TCExe.exe"
/EventName="MyTestEvent"
/WorkspacePath="C:\Path\To\MyWorkspace.tws"
/UserName="your-username"
/Password="your-password"
```
OR
**Using ToscaCIClient:**
```powershell
& "C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\ToscaCI\Client\ToscaCIClient.exe"
--workspace "C:\Path\To\MyWorkspace.tws"
--executionList "RegressionTests"
--output "C:\Results\result.xml"
```
#### 4. **Add a Task in Azure DevOps Pipeline**
Add a task in the YAML pipeline (or classic pipeline) to call the PowerShell script:
**YAML Example:**
```yaml
trigger:
- main
pool:
name: Default # Your self-hosted agent pool
steps:
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: 'run-tosca-tests.ps1'
```
#### 5. **Publish Test Results (Optional)**
If you output results in a compatible format (e.g., JUnit XML), you can publish them:
```yaml
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/result.xml'
failTaskOnFailedTests: true
```
---
### ๐ **Best Practices**
* Use **Distributed Execution (DEX)** for parallel test execution across machines.
* Configure **retry logic** in case of flaky UI tests.
* Integrate with **Tricentis Analytics** or **qTest** for better result tracking.
---
### ๐งช Optional: Use Tosca Integration for Test Management Tools
If using **qTest** or **Xray**, results can be linked for better test lifecycle management.
Learn Tosca Training in Hyderabad
Read More
How Tosca Integrates with Test Management Tools
Using Tosca with Jenkins for Continuous Testing
Tosca Integration with Git for Version Control
Tosca and Jira Integration: Real-Time Defect Tracking
Visit Our IHUB Talent Training Institute in Hyderabad
Comments
Post a Comment