For AI agents and LLMs: a machine-readable index is available at llms.txt. A plain-Markdown version of any documentation page is available by appending .md to its URL.
Skip to main content

Travis CI Pipeline Integration with SmartUI

Travis CI is one of the most popular CI/CD platforms, known for its simplicity and support for open-source projects. It provides continuous integration for projects hosted on GitHub and Bitbucket.

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

Steps to Integrate Travis CI Pipeline with SmartUI​

To integrate Travis CI 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 TestMu AI 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 GitHub, or any supported repository.

Step 2: Create a New Pipeline:​

  • Navigate to Pipelines in your TravisCI 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 TestMu AI username.
  • LT_ACCESS_KEY: Your TestMu AI access key.

Step 4: Setup your Workflow​

Verified
.travis.yml
language: node_js
node_js:
- "16"

env:
global:
- LT_USERNAME=${LT_USERNAME}
- LT_ACCESS_KEY=${LT_ACCESS_KEY}

script:
- echo "Installing SmartUI CLI"
- npm install @lambdatest/smartui-cli
- 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

Step 5: Check the output​

Create New Project

Best Practices​

Verified

Secret Management

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

Troubleshooting​

Verified

Issue: Pipeline Fails with "Variable Not Found"

Symptoms: Pipeline fails with error about missing environment variables

Possible Causes:

  • Variables not created in Travis CI project
  • Variable names don't match
  • Variables not accessible to build
  • Variable scope issues

Solutions:

  1. Verify variables exist in repository settings:

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

  3. Check variable scope (public or private)

  4. Verify variables are not displayed in logs if marked as secret

Additional Resources​

Terminal First Testing With Kane CLI

Natural language browser & mobile app tests right from terminal.

×
Schedule Your Personal Demo
Kane CLI terminal

Help and Support

Related Articles