Testsigma Documentation

repository·dev·Indexed 22 days ago

https://github.com/testsigmahq/testsigma

A GenAI-powered, codeless test automation platform for automating web, mobile, API, and desktop applications. Features include specialized AI agents for test generation, execution, analysis, and healing, as well as a Testsigma SDK for building custom add-ons like custom actions and data generators. Supports deployment via Cloud, Docker, or downloadable packages.

Tokens
2.5K
Snippets
3
Records
14
Agent score
72%

What's inside Testsigma

  1. Overview of Testsigma AI Agents

    dev

    Testsigma utilizes several specialized AI agents to manage the test automation lifecycle:

    • Generator Agent: Automatically generates test scenarios based on requirements, UI, or APIs.
    • Runner Agent: Executes tests across hundreds or thousands of parallel sessions to accelerate validation.
    • Analyzer Agent: Diagnoses test failures, identifies root causes, and recommends fixes.
    • Healer / Maintenance Agent: Detects and automatically adapts to UI changes to minimize manual repair effort.
    • Optimizer Agent: Suggests improvements for test suite pruning, prioritization, and coverage.
  2. Extend Testsigma with Add-ons

    dev

    Add-ons allow you to extend the platform's capabilities by automating unique user actions or scenarios not covered by default actions. You can build custom extensions using the Testsigma SDK.

    Supported Add-on types include:

    • Custom Actions: Automate actions unique to your Application Under Test (AUT).
    • Custom Data Generators: Create custom logic to generate specific test data for automation scenarios.
    • Conditional If: Implement custom logic to execute a sequence of steps only if a specific condition is met.
    • While Loops: Implement custom logic to execute a sequence of steps until a specific condition is matched.
  3. Deploy Testsigma via Cloud, Docker, or Downloadable Package

    dev

    You can deploy Testsigma using one of three primary methods depending on your infrastructure needs:

    1. Testsigma Cloud: The easiest method with one-click deployment. Ideal for quick starts without managing infrastructure.
    2. Docker: Deploy using Docker containers for a containerized environment.
    3. Downloadable Package: Use a downloadable package for manual installation on your own infrastructure.

    Once deployed, you can begin automating Web, Mobile Web, Android, iOS, or REST API applications.

  4. Deploy Testsigma using Docker Compose

    dev

    You can deploy Testsigma locally using Docker Compose. The setup consists of two main services: a mysql database and the testsigma_server.

    Service Details

    1. MySQL Database (mysql)

    • Image: mysql:5.7 (Note: Use mysql:8.0.32 if running on Apple Silicon/M1).
    • Platform: linux/x86_64 (Note: Use linux/arm64/v8 if running on Apple Silicon/M1).
    • Container Name: testsigma_mysql
    • Environment Variables:
      • MYSQL_ROOT_PASSWORD: Set to root by default.
      • MYSQL_DATABASE: Set to testsigma_opensource by default.
      • LANG & LC_ALL: Set to C.UTF-8.
    • Persistence: Data is stored in the ./db_data directory on the host.
    • Ports: Exposed on port 3306.
    • Configuration: Uses --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci.

    2. Testsigma Server (testsigma_server)

    • Image: testsigmahq/server:v3.0.1 (Note: Use testsigmahq/server:v3.0.1-m1 if running on Apple Silicon/M1).
    • Container Name: testsigma_server
    • Ports:
      • 9090:9090
      • 443:443
    • Persistence: Application data is stored in the ./ts_data directory on the host.
    • Dependencies: The server waits for the mysql service to pass its healthcheck before starting.

    M1/Apple Silicon Compatibility

    If you are using an M1 Mac, you must modify the following fields in the docker-compose.yml:

    1. Change mysql image to mysql:8.0.32.
    2. Change mysql platform to linux/arm64/v8.
    3. Change testsigma_server image to testsigmahq/server:v3.0.1-m1.
    version: "3.9"
    services:
      mysql:
        image: mysql:5.7 # Replace with mysql:8.0.32 for m1
        platform: linux/x86_64 # Replace with linux/arm64/v8 for m1
        container_name: testsigma_mysql
        restart: always
        volumes:
          - ./db_data:/var/lib/mysql
        environment:
          MYSQL_ROOT_PASSWORD: root
          MYSQL_DATABASE: testsigma_opensource
          LANG: C.UTF-8
          LC_ALL: C.UTF-8
        ports:
          - "3306"
        command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
        healthcheck:
          test: out=$$(mysqladmin ping -h localhost -P 3306 -u root --password=root 2>&1); echo $$out | grep 'mysqld is alive' || { echo $$out; exit 1; }
          interval: 1s
          retries: 120
      testsigma_server:
        image: testsigmahq/server:v3.0.1 # Replace with testsigmahq/server:v3.0.1-m1 for m1
        container_name: testsigma_server
        ports:
          - "9090:9090"
          - "443:443"
        volumes:
          - ./ts_data:/opt/app/ts_data
        depends_on:
          mysql:
            condition: service_healthy
  5. Troubleshoot and get support for Testsigma

    dev

    If you encounter issues or bugs, use the following channels:

    • Documentation: Search for solutions in the official Documentation.
    • Discord: For real-time support and community feedback.
    • GitHub Issues: For formal bug tracking and reporting.
    • Discussions: To ask questions and engage with the community forum.
    • Website Chat: For direct communication via the Testsigma website.
  6. Configure TS_DATA_DIR environment variable

    dev

    The TS_DATA_DIR is the directory where the Testsigma Agent stores its data. You can control this location in two ways:

    1. Environment Variable: Set ENV_TS_DATA_DIR before running the script.
    2. CLI Flag: Use the --TS_DATA_DIR=<path> argument.

    If neither is provided, the script uses the following defaults:

    • macOS (darwin): $HOME/Library/Application Support/Testsigma/Agent
    • Linux/FreeBSD: $HOME/.testsigma/agent
  7. Reference the UI enumeration types

    dev

    The ui/src/app/enums/index.ts file serves as the central export point for all enumeration types used within the Testsigma UI. Developers building extensions, add-ons, or custom UI components should import these enums to ensure type safety and consistency with the platform's internal state and logic.

    Key categories of enums include:

    • Test Execution & Steps: test-case-status.enum, test-step-type.enum, test-step-priority.enum, execution-type.enum.
    • Element & Locators: element-locator-type.enum, element-create-type.enum, element-status.enum.
    • REST API & HTTP: rest-method.enum, rest-authorization.enum, http-header-names.enum.
    • Platform & Environment: platform.enum, workspace-type.enum, active-environment-form-controls.
    • Scheduling & Status: schedule-status.enum, schedule-type.enum, invoice-status.enum, user-status.enum.
    • Mobile & Browser: mobile-inspection-status.enum, screen-orientation.enum, chrome-recorder-step.enum.
  8. Start the Testsigma Agent via start.sh

    dev

    The start.sh script is the entrypoint for starting the Testsigma Agent on POSIX-compliant systems (macOS, Linux, FreeBSD). It configures the necessary environment variables, sets the data directory, and executes the Java-based agent launcher.

    By default, the script determines the TS_DATA_DIR based on the operating system if not explicitly provided via environment variables or CLI flags.