Skip to main content

Azure Pipeline Integration with SmartUI

Azure Pipelines is a cloud-based CI/CD service offered by Microsoft, part of the Azure DevOps suite. It helps automate the process of building, testing, and deploying applications to various platforms.

This guide explains how to integrate your project with the Azure CI/CD pipeline to trigger visual regression testing with LambdaTest SmartUI whenever changes are made to your repository.

Steps to Integrate Azure Pipeline with SmartUI

To integrate Azure Pipeline with SmartUI, follow the below steps. You can use your own project to configure and test it. For demo purposes, we are using the sample repository.

Sample repo

Download or Clone the code sample from the LambdaTest GitHub repository to run the tests on the SmartUI.

Image View on GitHub

Step 1: Set Up Your Repository

Ensure your project is hosted in Azure Repos, GitHub, or any supported repository.

Step 2: Create a New Pipeline:

  • Navigate to Pipelines in your Azure DevOps project.
  • Select New Pipeline and connect your repository.

Step 3: Add Environment Variables

Go to Pipeline Settings > Variables. Add the following variables:

  • LT_USERNAME: Your LambdaTest username.
  • LT_ACCESS_KEY: Your LambdaTest access key.

Step 4: Setup your Workflow

azure-pipelines.yml
trigger:
- '*'

variables:
LT_USERNAME: $(LT_USERNAME)
LT_ACCESS_KEY: $(LT_ACCESS_KEY)

jobs:
- job: SmartUI_Tests
pool:
vmImage: 'ubuntu-latest'

steps:
- task: UseNode@2
inputs:
version: '16.x'

- script: |
echo "Installing dependencies"
npm install @lambdatest/smartui-cli
displayName: 'Install Dependencies'

- script: |
echo "Running SmartUI tests"
npx smartui --version
npx smartui config:create smartui-web.json
npx smartui --config smartui-web.json exec -- mvn --quiet test -D suite=sdk-cloud.xml
displayName: 'Execute SmartUI Tests'

Step 5: Check the output

Create New Project

Best Practices

Secret Management

  • Never commit credentials to repository
  • Use Azure Pipeline Variables for all sensitive data
  • Mark variables as secret to hide values in logs
  • Rotate secrets regularly
  • Use different secrets for different environments

Troubleshooting

Issue: Pipeline Fails with "Variable Not Found"

Symptoms: Pipeline fails with error about missing variables

Possible Causes:

  • Variables not created in Azure DevOps
  • Variable names don't match
  • Variables not accessible to pipeline
  • Variable scope issues

Solutions:

  1. Verify variables exist in pipeline settings:

    • Go to Pipelines → Edit → Variables
    • Check LT_USERNAME, LT_ACCESS_KEY, and PROJECT_TOKEN exist
  2. Ensure variable names match exactly (case-sensitive)

  3. Check variable scope (pipeline, stage, or job level)

  4. Verify variables are marked as secret if needed

Additional Resources

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles