Integrate Testsigma with Codemagic


You can integrate Codemagic with your version control system to automate test execution using a shell script that triggers Testsigma tests via CI/CD. This article discusses configuring Codemagic with a repository and executing test automation workflows using a codemagic.yaml file.


Prerequisites

Before you begin, ensure you have:

  • A repository on a supported version control system (e.g., GitHub).
  • A Codemagic account.
  • A shell script in your repository that triggers Testsigma test execution.

Sign Up and Authorize Codemagic

  1. Navigate to Codemagic.
  2. Sign up using your version control system (We’re using GitHub).
  3. After signing in, authorize Codemagic by clicking Authorize Codemagic CI/CD.
  4. On the How will you be using Codemagic? page, select the preferred option. codemagic 4
  5. On the Welcome Onboard page, under Connect Code, choose your version control provider (e.g., GitHub). codemagic 5
NOTE:
  • If your repositories do not appear, click Click here, then select Install and Authorize to refresh the connection.

Select and Configure Your Repository

  1. Under Select repository, choose the appropriate repository from the dropdown menu and click Select repository. codemagic 6
  2. Enter the relative path to your project in the Project path field.
  3. Click Retry to allow Codemagic to scan the repository.

Alternatively, click Set Type Manually to specify the project type. codemagic 7

  1. Select the project type and click Create Application. codemagic 8

Configure the YAML Workflow

  1. On the workflow screen, click Switch to YAML configuration. codemagic 9
  2. In the Update Settings dialog, select the codemagic.yaml radio button and click Save changes. odemagic 10

Add the YAML Configuration File

  1. In your repository, create a new file named codemagic.yaml at the root directory.
  2. Add the following YAML script:
workflows:
  run-testsigma:
    name: Run Testsigma Shell Script
    scripts:
      - name: Trigger Testsigma
        script: |
          chmod +x ./magictrigger.sh
          ./magictrigger.sh

codemagic 11

  1. Commit and push the file to your repository.
  2. (Optional) Configure Environment Variables, Webhooks, and other settings in Codemagic if necessary.
NOTE:
  • Ensure the magictrigger.sh file is present in the same repository and marked as executable. For information on the generic shell script, see Shell Script.
  • Ensure you have an API key and a Test Plan ID. For more information, see API Keys and Get Test Plan ID. shell script for Azure DevOps

Trigger the Workflow

  1. Navigate to Codemagic.
  2. Click Start new build. codemagic 13

Codemagic will detect the codemagic.yaml file and initiate the workflow. After the build completes, you can view the execution logs and test results.