> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tester.army/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a test

> Update a structured test definition. `settings` is merged field by field; every other field replaces its stored value.



## OpenAPI

````yaml /openapi.json patch /v1/tests/{testId}
openapi: 3.0.0
info:
  title: TestArmy API
  version: 1.0.0
  description: >-
    AI-powered browser automation API for QA testing. Automate web testing
    workflows using natural language prompts.
servers:
  - url: https://tester.army/api
    description: Production API server
security: []
paths:
  /v1/tests/{testId}:
    patch:
      tags:
        - Tests
      summary: Update a test
      description: >-
        Update a structured test definition. `settings` is merged field by
        field; every other field replaces its stored value.
      parameters:
        - schema:
            type: string
            format: uuid
            description: Test ID
          required: true
          description: Test ID
          name: testId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 500
                description:
                  type: string
                steps:
                  type: array
                  items:
                    $ref: '#/components/schemas/TestStep'
                  minItems: 1
                  maxItems: 30
                settings:
                  allOf:
                    - $ref: '#/components/schemas/TestSettings'
                    - description: Settings patch; omitted fields keep their stored value.
                enabled:
                  type: boolean
      responses:
        '200':
          description: Test updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  test:
                    $ref: '#/components/schemas/TestDefinition'
                required:
                  - test
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '429':
          description: Too Many Requests - Usage limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '504':
          description: Gateway Timeout - Test execution exceeded time limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  schemas:
    TestStep:
      oneOf:
        - type: object
          properties:
            title:
              type: string
              minLength: 1
              maxLength: 2000
            type:
              type: string
              enum:
                - act
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - title
            - type
        - type: object
          properties:
            title:
              type: string
              minLength: 1
              maxLength: 2000
            type:
              type: string
              enum:
                - assert
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - title
            - type
        - type: object
          properties:
            title:
              type: string
              maxLength: 2000
            type:
              type: string
              enum:
                - login
            credentialId:
              type: string
              format: uuid
            temporaryEmail:
              type: boolean
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - title
            - type
        - type: object
          properties:
            title:
              type: string
              maxLength: 2000
            type:
              type: string
              enum:
                - files
            fileIds:
              type: array
              items:
                type: string
                format: uuid
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - title
            - type
            - fileIds
        - type: object
          properties:
            title:
              type: string
              maxLength: 2000
            type:
              type: string
              enum:
                - screenshot
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - type
        - type: object
          properties:
            title:
              type: string
              maxLength: 2000
            type:
              type: string
              enum:
                - javascript
            code:
              type: string
              maxLength: 10000
              description: >-
                JavaScript run in the browser page. Runs as an awaited function
                body; passes if it completes without throwing (returns nothing
                or { success: true }) and fails if it returns { success: false,
                reason } or throws. Web tests only.
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - type
            - code
        - type: object
          properties:
            title:
              type: string
              maxLength: 2000
            type:
              type: string
              enum:
                - microphone
            fileId:
              anyOf:
                - type: string
                  format: uuid
                - type: string
                  enum:
                    - ''
              description: >-
                Project file ID (UUID) of the audio file (e.g. MP3) to play
                through the microphone. Empty string marks an unconfigured draft
                that must have a file attached before the test runs.
            mode:
              type: string
              enum:
                - blocking
                - loop
              description: >-
                blocking: the agent waits for playback to finish before
                continuing. loop: playback repeats until the run ends and the
                agent continues immediately. Web tests only.
            disabled:
              type: boolean
              description: >-
                When true, the step stays saved on the test but is skipped
                during runs.
          required:
            - type
            - fileId
            - mode
    TestSettings:
      type: object
      properties:
        executionMode:
          type: string
          enum:
            - fast
            - deep
          description: deep uses a higher-effort model for complex steps.
        browserRegion:
          type: string
          nullable: true
          enum:
            - eu
            - us
            - null
          description: Per-test proxy exit region. null falls back to the project's region.
        simulatorRegion:
          type: string
          enum:
            - eu-north1
            - us-west1
          description: Region the simulator or emulator runs in. Mobile tests only.
        viewport:
          type: string
          nullable: true
          enum:
            - desktop
            - desktop-hd
            - mobile
            - tablet
            - null
          description: >-
            Browser viewport preset: desktop (1280x800), desktop-hd (1920x1080),
            mobile (390x844), tablet (768x1024). null restores the default. Web
            tests only.
        webSearchEnabled:
          type: boolean
          description: Allow the test to use internet search for factual checks.
        prepGroupId:
          type: string
          nullable: true
          format: uuid
          description: Group whose preparation test a solo run of this test uses.
    TestDefinition:
      type: object
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
        description:
          type: string
          nullable: true
        enabled:
          type: boolean
        platform:
          type: string
          enum:
            - web
            - mobile
        settings:
          $ref: '#/components/schemas/TestSettings'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/TestStep'
        projectId:
          type: string
          format: uuid
        projectUrl:
          type: string
          nullable: true
          format: uri
        projectName:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - title
        - steps
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token format

````