TeamCity Integration

Qualitia Automation Studio (QAS) supports integration with TeamCity, a Java-based build and continuous integration (CI) server. This integration helps streamline test execution and enhances software release quality with minimal effort.

With TeamCity integration, you can:

  • Trigger Qualitia test executions as part of your CI pipeline.

  • Access detailed execution reports that help analyze failures with in-depth logs.

  • Receive reports on demand or via email after execution completes.

To enable this integration, make sure your offline execution package is properly configured for use with TeamCity.

📚Prerequisites

Ensure the following software is installed before you begin:

  • TeamCity

  • JDK 11 or later

Installing TeamCity

To install TeamCity and the TeamCity Agent:

  1. Download the latest version of TeamCity and JDK 11 or later.

  2. Install JDK on your system.

  3. Right-click the downloaded TeamCity.exe and select Run as Administrator.

  4. Follow the on-screen installation instructions.

Installing the TeamCity Agent

  1. After TeamCity installation completes, install the TeamCity Agent.

  2. Open the Run window (Win + R), type services.msc, and stop the TeamCity Agent service.

  3. Open Command Prompt as Administrator.

  4. Navigate to the directory containing the agent.bat file.

  5. Run the agent.bat start to register and start the agent.

  6. Once the setup is complete, you will see a message confirming TeamCity installation along with a URL for further configuration (for example: http://localhost:<port defined while installation>). 

Configuring Project and Build in TeamCity

Once TeamCity.exe and JDK 11 or later are installed successfully, TeamCity is now ready for further configurations.

Creating a Project

  1. Open the TeamCity URL and log in using your credentials.

  2. Click Create Project and select Manually using the drop-down list.

  3. Provide the following details:

    • Name

    • Project ID

    • (Optional) Description

  4. Click Create.

Creating a Build Configuration

  1. In the Build Configurations section, click Create build configuration and select Manually using the drop-down list.

  2. Enter:

    • Name and the system update the Build ID accordingly

    • (Optional) Description

  3. Click Create.

Build is now successfully created, and you can proceed to configure build execution steps

Configuring Artifact Paths

  1. Open Project Settings by clicking the project name on the top of the screen.

  2. Click Edit link next to your build configuration.

  3. Under the General Settings tab, in the Artifact Paths field, enter:

    %env.qualitiareportpath%/**/* => Report

  4. Click Save.

Adding Build Steps

  1. Go to Build Steps > Click Add build step.

  2. In the Runner Type dropdown, select Command Line.

  3. Provide the following:

    1. Step Name: (e.g., Download Execution Agent)

    2. Run: Select Custom Script from the drop-down.

    3. Custom Script: Enter

      For HTTP:

      curl -o executionAgent.jar -LJ http://<domain.name>/api/v1/download/executionAgent

      For HTTPS:

      curl -k -o executionAgent.jar -LJ https://<domain.name>/api/v1/download/executionAgent

  4. Click Add build step again.

  5. Set the following:

    • Runner Type: Select Command Line using the drop-down list.

    • Step Name: Enter step name as per your requirement (e.g., Run Qualitia Test Execution).

    • Run: Select Custom Script using the drop-down list.

    • Custom Script: Enter

      java -jar executionAgent.jar serverUrl="<https://<domain.name>>" ProjectName="<Project Name>" Suite="<Suite Name>" executiontrigger="TeamCity" branch="main" CI_Tool="TeamCity"

  • First command hits Qualitia Bot API endpoints to generate a executionAgent.jar. This jar is bridge between CI tool (in this case TeamCity) and Qualitia Server for provided server URL.

  • In second command, utilize this bridge and provide arguments to access required artifacts.

Parameters Description

Parameter

Description

serverUrl

URL of the Qualitia Server

ProjectName

Name of the project in Qualitia

Suite

Name of the suite to execute

executiontrigger

Must be set to "TeamCity"

branch

Branch name (e.g., "main")

CI_Tool

Must be set to "TeamCity"

You can also include additional arguments such as browser, driverPath, and pollingInterval.

Running the Agent and Executing the Build

Once configuration is complete, you can proceed to execute your test cases.

  1. Navigate to the TeamCity Agent installation directory.

  2. Open Command Prompt and run the following command to start the agent:

    agent.bat start

  3. Open the TeamCity project and select the desired build configuration.

  4. Click Run from the top right corner of the screen.

  5. To check logs, click In Progress Builds, and go to Build Logs section.

  6. Once the build is complete, you can see Build finished at the end in the Build Log section.