openapi: 3.1.0
info:
  title: TMT API
  description: API working with Test folders in TMT
  version: 1.0.0
paths:
  /api/v2/rpc (GET_DOCUMENT):
    post:
      summary: Get test run
      description: Get content of a test run by given document reference
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDocumentRequest'
              examples:
                $ref: example/GET_TEST_RUN-request.json
      responses:
        '200':
          description: Content of the test run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestRunDocumentResponse'
                examples:
                  $ref: example/GET_TEST_RUN-response.json
  /api/v2/rpc (LIST_TEST_RUNS):
    post:
      deprecated: true
      summary: List test run
      description: >-
        List test run documents for given search criteria. This is deprecated
        and will not be supported in the next release. Please use **List test
        run documents** instead
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTestRunRequest'
              examples:
                $ref: example/LIST_TEST_RUN-request.json
      responses:
        '200':
          description: List of test runs matched the search criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTestRunResponse'
                examples:
                  $ref: example/LIST_TEST_RUN-response.json
  /api/v2/rpc (LIST_DOCUMENT):
    post:
      summary: List test run documents
      description: List test run documents for given search criteria.
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTestRunDocumentRequest'
              examples:
                $ref: example/LIST_DOCUMENT_TEST_RUN-request.json
      responses:
        '200':
          description: List of test runs matched the search criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTestRunDocumentResponse'
                examples:
                  $ref: example/LIST_DOCUMENT_TEST_RUN-response.json
  /api/v2/rpc (ADD_DOCUMENT):
    post:
      summary: Create a test run
      description: Create a new test run
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddTestRunRequest'
              examples:
                $ref: example/ADD_TEST_RUN-request.json
      responses:
        '200':
          description: Document reference of created test run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddDocumentResponse'
                examples:
                  $ref: example/ADD_TEST_RUN-response.json
  /api/v2/rpc (MODIFY_DOCUMENT):
    post:
      summary: Update test run
      description: Update test run content
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyTestRunRequest'
              examples:
                $ref: example/MODIFY_TEST_RUN-request.json
      responses:
        '200':
          description: Updated test run's content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModifyDocumentResponse'
                examples:
                  $ref: example/MODIFY_TEST_RUN-response.json
  /api/v2/rpc (DELETE_TEST_RUN):
    post:
      summary: Delete a test run
      description: >-
        It is only possible to delete an empty run. For non empty test run, you
        must remove its test suites first, which can be done by calling
        DELETE_SUITE_FROM_RUN operation
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTestRunRequest'
              examples:
                $ref: example/DELETE_TEST_RUN-request.json
      responses:
        '200':
          description: true if successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanDocumentResponse'
                examples:
                  $ref: example/DELETE_TEST_RUN-response.json
  /api/v2/rpc (CHECK_TEST_RUN_EMPTY):
    post:
      summary: Check a run is empty
      description: >-
        Check a run is empty or not. You should call this endpoint before
        deleting a test run.
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckRunEmptyRequest'
              examples:
                $ref: example/CHECK_TEST_RUN_EMPTY-request.json
      responses:
        '200':
          description: true if test run is empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BooleanDocumentResponse'
                examples:
                  $ref: example/CHECK_TEST_RUN_EMPTY-response.json
  /api/v2/rpc (GET_AVAILABLE_TEST_SUITES):
    post:
      summary: Get available test suites to add to run
      description: >-
        List all suites that are available to add into Run, which excludes the
        suites already in Run. **This is not applicable for closed run**
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetAvailableSuiteRequest'
              examples:
                $ref: example/GET_AVAILABLE_TEST_SUITES-request.json
      responses:
        '200':
          description: Return list of suites
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAvailableSuiteResponse'
                examples:
                  $ref: example/GET_AVAILABLE_TEST_SUITES-response.json
  /api/v2/rpc (ADD_TEST_SUITES_TO_RUN):
    post:
      summary: Add test suites to open run
      description: Add available test suites to an open run
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddAvailableSuiteToRunRequest'
              examples:
                $ref: example/ADD_TEST_SUITES_TO_RUN-request.json
      responses:
        '200':
          description: list of relationship spec of test suites that added into run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAvailableSuiteToRunResponse'
                examples:
                  $ref: example/ADD_TEST_SUITES_TO_RUN-response.json
  /api/v2/rpc (DELETE_TEST_SUITES_FROM_RUN):
    post:
      summary: Delete test suites from open run
      description: >-
        Delete the test suites from an open run. **This is not applicable to
        closed run**
      parameters:
        - $ref: '#/components/parameters/ProjectIdHeader'
        - $ref: '#/components/parameters/SubProjectIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteTestSuiteFromRunRequest'
              examples:
                $ref: example/DELETE_TEST_SUITES_FROM_RUN-request.json
      responses:
        '200':
          description: list of relationship spec of test suites that added into run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NullDocumentResponse'
                examples:
                  $ref: example/DELETE_TEST_SUITES_FROM_RUN-response.json
security:
  - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    ModifyTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/ModifyDocumentRequest'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
                - locale
                - document
              properties:
                document:
                  $ref: '#/components/schemas/TestRunDocument'
      examples:
        - id: MODIFY_TEST_RUN
          method: MODIFY_DOCUMENT
          params:
            document:
              Root:
                General:
                  ProjectId: P_9
                  ProjectVersionNumber: 1.2.0
                  SubprojectId: SP_1
                  Status: active
                  Title: Performance test
                  Configuration: qftest, chrome
                  Description: Test the app performance around the order's actions
                  TenantId: T_1
                  TechnicalId: 19612ea0-bd5d-49da-9004-32f54d63645a
                  Id: R_4
                Metadata:
                  CreatedBy: trung
                  DisplayCreatedOn: '2024-11-13T02:09:50'
                  CreatedOn: 1731463790165
                  EditedBy: trung
                  DisplayEditedOn: '2024-11-13T02:09:50'
                  EditedOn: 1731463790165
                Attachments:
                  - FileName: bapserver-metrix-snapshot 10.55.51.png
                    CreatedAt: '2024-11-13T02:09:45'
                    UploadOn: '2024-11-13'
                    OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
                    File:
                      content: null
                      attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                      internal_filename: 1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                      original_filename: bapserver-metrix-snapshot 10.55.51.png
                      size: 635194
                      mime_type: image/png
              __meta:
                creator: trung
                modifier: trung
                createdAt: '2024-11-13T02:09:50'
                modifiedAt: '2024-11-13T02:09:50'
                modelReference: TestRun-dm
                docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                modelVersion: null
            locale: en
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    AddTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/AddDocumentRequest'
        - type: object
        - required:
            - params
        - properties:
            method:
              type: string
              description: ADD_DOCUMENT
            params:
              type: object
              properties:
                documentModelName:
                  type: string
                  description: TestRun-dm
                document:
                  $ref: '#/components/schemas/TestRunDocumentToAdd'
      examples:
        - id: ADD_TEST_RUN
          method: ADD_DOCUMENT
          params:
            document:
              Root:
                General:
                  ProjectId: P_9
                  ProjectVersionNumber: 1.2.0
                  SubprojectId: SP_1
                  Status: active
                  Title: Performance test
                  Configuration: qftest
                  Description: Test the app performance around the order's actions
                Attachments:
                  - FileName: bapserver-metrix-snapshot 10.55.51.png
                    File:
                      content: null
                      attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                      internal_filename: 1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                      original_filename: bapserver-metrix-snapshot 10.55.51.png
                      size: 635194
                      mime_type: image/png
                    CreatedAt: '2024-11-13T02:09:45'
                    UploadOn: '2024-11-13'
                    OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
            documentModelName: TestRun-dm
            locale: en
    TestRunDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              allOf:
                - $ref: '#/components/schemas/TestRunDocumentResult'
      examples:
        - jsonrpc: '2.0'
          id: GET_DOCUMENT-2
          result:
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            documentModelName: TestRun-dm
            document:
              id: '-1'
              Root:
                General:
                  ProjectId: P_9
                  ProjectVersionNumber: 1.2.0
                  SubprojectId: SP_1
                  Status: active
                  Title: Performance test
                  Configuration: qftest
                  Description: Test the app performance around the order's actions
                  TenantId: T_1
                  TechnicalId: 19612ea0-bd5d-49da-9004-32f54d63645a
                  Id: R_4
                Metadata:
                  CreatedBy: trung
                  DisplayCreatedOn: '2024-11-13T02:09:50'
                  CreatedOn: 1731463790165
                  EditedBy: trung
                  DisplayEditedOn: '2024-11-13T02:09:50'
                  EditedOn: 1731463790165
                Attachments:
                  - FileName: bapserver-metrix-snapshot 10.55.51.png
                    CreatedAt: '2024-11-13T02:09:45'
                    UploadOn: '2024-11-13'
                    OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                    UploadBy: trung
                    Referenced: false
                    CopyNumber: 0
                    ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
                    File:
                      content: null
                      attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                      internal_filename: 1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                      original_filename: bapserver-metrix-snapshot 10.55.51.png
                      size: 635194
                      mime_type: image/png
              __meta:
                creator: trung
                modifier: trung
                createdAt: '2024-11-13T02:09:50'
                modifiedAt: '2024-11-13T02:09:50'
                modelReference: TestRun-dm
                docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                modelVersion: null
    ListTestRunDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/ListDocumentRequest'
        - type: object
          properties:
            params:
              required:
                - documentModelName
                - filter
                - page
                - sort
              properties:
                documentModelName:
                  type: string
                  description: TestRun-dm
      examples:
        - id: TestRun.DataProvider-98
          jsonrpc: '2.0'
          method: LIST_DOCUMENTS
          params:
            documentModelName: TestRun-dm
            filter:
              filters:
                - Root.General.ProjectId:P_28
                - Root.General.SubprojectId:_
                - Root.General.ProjectVersionNumber:1.0.0
              fulltext: ''
              lang: ''
            page:
              offset: 0
              limit: 2800
            sort:
              - order: Root.General.Title ASC
    ListTestRunDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/ListDocumentResponse'
        - type: object
          properties:
            result:
              properties:
                entries:
                  items:
                    allOf:
                      - $ref: '#/components/schemas/TestRunDocumentResult'
      examples:
        - jsonrpc: '2.0'
          id: TestRun.DataProvider-98
          result:
            fullSize: 2
            page:
              offset: 0
              limit: 2800
            entries:
              - docRef: TestRun-dm/0b248ab1-a236-4b46-97a9-2da5115aa335
                documentModelName: TestRun-dm
                document:
                  id: '-1'
                  Root:
                    General:
                      ProjectId: P_28
                      ProjectVersionNumber: 1.0.0
                      SubprojectId: _
                      Status: active
                      Title: Random testRunName no.10.09.2024T1725954320028
                      Description: >-
                        Random testRunDescription
                        no.10.09.2024T1725954320028![04_28_16.jpg](/cs/download/07c0b5e0-8a5e-4176-b07a-c2a6665aa740)
                      TenantId: T_12
                      TechnicalId: c8b5d0e4-2e3d-4a05-af93-891c96a92374
                      Id: R_3
                    Metadata:
                      CreatedBy: tmtautotest
                      DisplayCreatedOn: '2024-09-10T07:45:34'
                      CreatedOn: 1725954334071
                      EditedBy: tmtautotest
                      DisplayEditedOn: '2024-09-10T07:45:34'
                      EditedOn: 1725954334071
                    Attachments:
                      - FileName: 04_28_16.jpg
                        CreatedAt: '2024-09-10T07:45:24'
                        UploadOn: '2024-09-10'
                        OriginalFileName: 04_28_16.jpg
                        UploadBy: tmtautotest
                        Referenced: true
                        CopyNumber: 0
                        ThumbnailId: 07c0b5e0-8a5e-4176-b07a-c2a6665aa740
                        File:
                          content: null
                          attachment_id: 6f6ba4a6-942c-4030-928a-6c7dde257be7
                          internal_filename: >-
                            1725954323929-bdbac78c-c26e-4938-b85b-2ba73dfd1bb1.jpg
                          original_filename: 04_28_16.jpg
                          size: 133059
                          mime_type: image/jpeg
                  __meta:
                    creator: tmtautotest
                    modifier: tmtautotest
                    createdAt: '2024-09-10T07:45:34'
                    modifiedAt: '2024-09-10T07:45:34'
                    modelReference: TestRun-dm
                    docRef: TestRun-dm/0b248ab1-a236-4b46-97a9-2da5115aa335
                    modelVersion: null
              - docRef: TestRun-dm/bc2fb16e-a393-49fb-9b49-91009ad24eec
                documentModelName: TestRun-dm
                document:
                  Root:
                    General:
                      ProjectId: P_28
                      ProjectVersionNumber: 1.0.0
                      SubprojectId: _
                      Status: inactive
                      Title: Random updatedTestRunName no.10.09.2024T1725953838072
                      Description: >-
                        Random updatedTestRunDescription
                        no.10.09.2024T1725953838072[04_28_16_02.xlsx]
                      TenantId: T_12
                      TechnicalId: d8b77444-797c-4bce-b4ef-e530fe4acb8e
                      Id: R_1
                    Metadata:
                      CreatedBy: tmtautotest
                      DisplayCreatedOn: '2024-09-10T07:38:19'
                      CreatedOn: 1725953899934
                      EditedBy: tmtautotest
                      DisplayEditedOn: '2024-09-10T07:40:01'
                      EditedOn: 1725954001329
                      ClosedBy: tmtautotest
                      ClosedOn: 1725954001326
                      DisplayClosedOn: '2024-09-10T07:40:01'
                    Attachments:
                      - FileName: 04_28_16.jpg
                        CreatedAt: '2024-09-10T07:39:55'
                        UploadOn: '2024-09-10'
                        OriginalFileName: 04_28_16.jpg
                        UploadBy: tmtautotest
                        Referenced: false
                        CopyNumber: 0
                        ThumbnailId: a3f479ea-e3ed-415b-a5b6-916741ccab3e
                        File:
                          content: null
                          attachment_id: 01482b8f-645b-4e8e-ba22-b1e61e190831
                          internal_filename: >-
                            1725953994549-d6b55ae4-eac2-44eb-b61f-2acee938fae3.jpg
                          original_filename: 04_28_16.jpg
                          size: 133059
                          mime_type: image/jpeg
                  __meta:
                    creator: tmtautotest
                    modifier: SYSTEM
                    createdAt: '2024-09-10T07:38:19'
                    modifiedAt: '2024-09-10T07:40:01'
                    modelReference: TestRun-dm
                    docRef: TestRun-dm/bc2fb16e-a393-49fb-9b49-91009ad24eec
                    modelVersion: null
    ListTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - required:
            - method
            - params
        - properties:
            method:
              description: LIST_TEST_RUNS
            params:
              type: object
              required:
                - page
                - sort
                - filter
              properties:
                filter:
                  $ref: '#/components/schemas/FilterSpec'
                page:
                  $ref: '#/components/schemas/PageSpec'
                sort:
                  type: array
                  $ref: '#/components/schemas/SortSpecArray'
      examples:
        - id: TestRuns.DataProvider-3
          jsonrpc: '2.0'
          method: LIST_TEST_RUNS
          params:
            page:
              offset: 0
              limit: 50
            sort:
              - order: Root.Metadata.CreatedOn DESC
            filter:
              filters:
                - Root.General.ProjectId:P_9
                - Root.General.ProjectVersionNumber:1.2.0
                - Root.General.SubprojectId:SP_1
              fulltext: ''
              lang: ''
    ListTestRunResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              properties:
                filterItemMap:
                  type: object
                  properties:
                    Root.DisplayFields.TesterOfTestCases:
                      type: array<string>
                      description: list of testers of all test cases in run
                result:
                  type: object
                  properties:
                    fullSize:
                      type: integer
                      description: Total number of the found item
                    page:
                      $ref: '#/components/schemas/PageSpec'
                    entries:
                      type: array
                      items:
                        allOf:
                          - $ref: '#/components/schemas/TestRunDocumentResultWithId'
      examples:
        - jsonrpc: '2.0'
          id: TestRuns.DataProvider-3
          result:
            result:
              fullSize: 1
              page:
                offset: 0
                limit: 50
              entries:
                - docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                  documentModelName: TestRun-dm
                  document:
                    id: '-1'
                    Root:
                      General:
                        ProjectId: P_9
                        ProjectVersionNumber: 1.2.0
                        SubprojectId: SP_1
                        Status: active
                        Title: Performance test
                        Configuration: qftest
                        Description: Test the app performance around the order's actions
                        TenantId: T_1
                        TechnicalId: 19612ea0-bd5d-49da-9004-32f54d63645a
                        Id: R_4
                        TestSuiteCount: 0
                        Progress: 0
                      Metadata:
                        CreatedBy: trung
                        DisplayCreatedOn: '2024-11-13T02:09:50'
                        CreatedOn: 1731463790165
                        EditedBy: trung
                        DisplayEditedOn: '2024-11-13T02:09:50'
                        EditedOn: 1731463790165
                      Attachments:
                        - FileName: bapserver-metrix-snapshot 10.55.51.png
                          CreatedAt: '2024-11-13T02:09:45'
                          UploadOn: '2024-11-13'
                          OriginalFileName: bapserver-metrix-snapshot 10.55.51.png
                          UploadBy: trung
                          Referenced: false
                          CopyNumber: 0
                          ThumbnailId: 74303fd3-a9e7-498d-bd71-83c05ecdaad6
                          File:
                            content: null
                            attachment_id: d3e5dbda-603f-478d-9b1f-c0c5f10ff776
                            internal_filename: >-
                              1731463781565-0886b4f1-f863-473c-9e3d-0aba8cf06158.png
                            original_filename: bapserver-metrix-snapshot 10.55.51.png
                            size: 635194
                            mime_type: image/png
                      DisplayFields:
                        Result:
                          - result: '1'
                            count: 0
                            label: Untested
                          - result: '2'
                            count: 0
                            label: Passed
                          - result: '3'
                            count: 0
                            label: Blocked
                          - result: '4'
                            count: 0
                            label: Customer
                          - result: '6'
                            count: 0
                            label: Failed (known)
                          - result: '5'
                            count: 0
                            label: Failed (new)
                          - result: '7'
                            count: 0
                            label: In progress
                          - result: '8'
                            count: 0
                            label: On hold (external)
                          - result: '9'
                            count: 0
                            label: On hold (internal)
                          - result: '10'
                            count: 0
                            label: Retest
                          - result: '11'
                            count: 0
                            label: Skipped
                        TestCasesWithTester: '-'
                        TestersOfTestCases: []
                    __meta:
                      creator: trung
                      modifier: trung
                      createdAt: '2024-11-13T02:09:50'
                      modifiedAt: '2024-11-13T02:09:50'
                      modelReference: TestRun-dm
                      docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                      modelVersion: null
            filterItemMap:
              Root.DisplayFields.TestersOfTestCases: []
    CheckRunEmptyRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: CHECK_TEST_RUN_EMPTY
            params:
              required:
                - testRunDocRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: CHECK_TEST_RUN_EMPTY_6f1f3601-88bb-47e0-b4b5-42f4ff3596be
          jsonrpc: '2.0'
          method: CHECK_TEST_RUN_EMPTY
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    DeleteTestRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: DELETE_TEST_RUN
            params:
              required:
                - testRunDocRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - id: DELETE_TEST_RUN_TestRun-dm/11825df5-4460-479d-a282-e996d804b571
          jsonrpc: '2.0'
          method: DELETE_TEST_RUN
          params:
            testRunDocRef: TestRun-dm/11825df5-4460-479d-a282-e996d804b571
    GetAvailableSuiteRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          properties:
            method:
              type: string
              description: GET_AVAILABLE_TEST_SUITES
            params:
              allOf:
                - $ref: >-
                    #/components/schemas/ListDocumentRequestParamWithoutModelName
                - type: object
                  required:
                    - testRunDocRef
                  properties:
                    testRunDocRef:
                      type: string
                      description: test run document reference
      examples:
        - id: TestSuites.DataProvider-0
          jsonrpc: '2.0'
          method: GET_AVAILABLE_TEST_SUITES
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            page:
              offset: 0
              limit: 50
            sort:
              - order: Root.General.Order ASC
            filter:
              filters: []
              fulltext: ''
              lang: ''
    GetAvailableSuiteResponse:
      allOf:
        - $ref: '#/components/schemas/ListDocumentResponse'
        - type: object
          properties:
            result:
              properties:
                entries:
                  items:
                    allOf:
                      - $ref: '#/components/schemas/EnrichTestSuiteDocumentResult'
      examples:
        - jsonrpc: '2.0'
          id: TestSuites.DataProvider-0
          result:
            fullSize: 1
            page:
              offset: 0
              limit: 50
            entries:
              - docRef: TestSuite-dm/20740
                documentModelName: TestSuite-dm
                document:
                  Root:
                    General:
                      ProjectId: P_9
                      ProjectVersionNumber: 1.2.0
                      SubprojectId: SP_1
                      Title: 00 Main landing page
                      Description: >-
                        * Access the shop's main landing page,

                        * Check URL & SSL status,

                        * Check menu,

                        * Check feature links,

                        * Check sections and banners,

                        * Check footer.


                        ![Screenshot 2022-12-06
                        141258.png](/api/attachment/thumbnail/d374b1f3-ce88-4328-9699-3d508c1c02ab/thumb_big)
                      Id: S_1
                      TechnicalId: 06b4d076-c11e-447f-8f83-98c3061c25f9
                      TenantId: T_1
                      TimeBookingAccount: mgm-internal
                      Order: '0.1'
                      RecommendedPriority:
                        Value: MEDIUM
                    Metadata:
                      CreatedBy: peter.parker
                      DisplayCreatedOn: '2022-12-05T13:06:04'
                      CreatedOn: 1670245564074
                      EditedBy: peter.parker
                      DisplayEditedOn: '2022-12-06T13:25:01'
                      EditedOn: 1670333101154
                      IsImported: false
                      AssignedToVersion:
                        AssignedToNumber: 1.0.0
                        AssignedToTitle: Frontend
                    Attachments:
                      - FileName: Screenshot 2022-12-06 141258.png
                        UploadOn: '2022-12-06'
                        OriginalFileName: Screenshot 2022-12-06 141258.png
                        UploadBy: peter.parker
                        Referenced: true
                        CopyNumber: 0
                        File:
                          internal_filename: d374b1f3-ce88-4328-9699-3d508c1c02ab.png
                          original_filename: Screenshot 2022-12-06 141258.png
                          mime_type: image/png
                          attachment_id: d374b1f3-ce88-4328-9699-3d508c1c02ab
                          content: null
                          size: 614589
                    DisplayFields:
                      TotalTestCases: 17
                  __meta:
                    creator: SYSTEM
                    modifier: SYSTEM
                    docRef: TestSuite-dm/20740
                    modelReference: TestSuite-dm
                    createdAt: '2023-08-09T06:45:04'
                    modifiedAt: '2023-11-20T03:58:46'
                    modelVersion: null
    AddAvailableSuiteToRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
        - required:
            - method
            - params
          properties:
            method:
              type: string
              description: ADD_TEST_SUITES_TO_RUN
            params:
              required:
                - testRunDocRef
                - testSuiteDocRefs
              properties:
                testRunDocRef:
                  type: string
                  description: test run document reference
                testSuiteDocRefs:
                  type: array<string>
                  description: list of test suite's document references
      examples:
        - id: ADD_TEST_SUITES_TO_RUN_1
          method: ADD_TEST_SUITES_TO_RUN
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            testSuiteDocRefs:
              - TestSuite-dm/20740
              - TestSuite-dm/20742
    AddAvailableSuiteToRunResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: array
              items:
                $ref: '#/components/schemas/LinkRef'
      examples:
        - jsonrpc: '2.0'
          id: ADD_TEST_SUITES_TO_RUN_1
          result:
            - linkDescriptor:
                relationshipModel: TestRunTestSuite-rm
                entities:
                  - role: TestRun
                    modelName: TestRun-dm
                    docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                  - role: TestSuite
                    modelName: TestSuite-dm
                    docRef: TestSuite-dm/20740
                predecessorLinkRef: null
                position: TOP
              id: '947573'
            - linkDescriptor:
                relationshipModel: TestRunTestSuite-rm
                entities:
                  - role: TestRun
                    modelName: TestRun-dm
                    docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
                  - role: TestSuite
                    modelName: TestSuite-dm
                    docRef: TestSuite-dm/20742
                predecessorLinkRef: null
                position: TOP
              id: '947574'
    DeleteTestSuiteFromRunRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
        - required:
            - method
            - params
          properties:
            method:
              type: string
              description: DELETE_TEST_SUITES_FROM_RUN
            params:
              required:
                - testRunDocRef
                - testSuiteDocRefs
              properties:
                testRunDocRef:
                  type: string
                  description: test run document reference
                testSuiteDocRefs:
                  type: array<string>
                  description: list of test suite's document references
      examples:
        - id: DELETE_TEST_SUITES_FROM_RUN_1
          method: DELETE_TEST_SUITES_FROM_RUN
          params:
            testRunDocRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
            testSuiteDocRefs:
              - TestSuite-dm/20740
              - TestSuite-dm/20742
    RpcRequestWithIdAndJsonRpc:
      type: object
      required:
        - id
        - jsonrpc
      properties:
        id:
          type: string
          description: id of the operation
        jsonrpc:
          type: string
          description: must be 2.0
          example: '2.0'
    GetDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: GET_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
      examples:
        - jsonrpc: '2.0'
          method: GET_DOCUMENT
          id: GET_DOCUMENT-2
          params:
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    RpcResult:
      type: object
      properties:
        jsonrpc:
          type: string
          description: request jsonrpc version
        id:
          type: string
          description: id of the operation
        result:
          type: object
    DocumentResult:
      type: object
      properties:
        docRef:
          type: string
          description: document reference
        documentModelName:
          type: string
          description: model name
        document:
          type: object
    GeneralToAdd:
      type: object
      properties:
        ProjectId:
          type: string
          description: Project's Id that containing this test run
        ProjectVersionNumber:
          type: string
          description: Sub Project's version number that containing this test run
        SubprojectId:
          type: string
          description: Sub Project's Id that containing this test run
        Title:
          type: string
          description: Title of the test run
        Description:
          type: string
          description: Description for the test run
        Configuration:
          type: string
          description: Configuration for the test run
        Status:
          type: string
          description: >-
            Status of the test run. Must be **active** in case of adding new
            test run
          enum:
            - active
            - inactive
    General:
      allOf:
        - $ref: '#/components/schemas/GeneralToAdd'
        - type: object
          properties:
            Id:
              type: string
              description: Business id of the test suite. It is unique in a sub project
            TenantId:
              type: string
              description: Tenant Id
            TechnicalId:
              type: string
              format: uuid
              description: Technical id of the test suite. It is unique in the whole system
    Metadata:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Metadata of the document. It will be ignored if
        included in the request of the add/update operations (e.g ADD_DOCUMENT,
        MODIFY_DOCUMENT)
      properties:
        CreatedBy:
          type: string
          description: who created this project
        DisplayCreatedOn:
          type: string
          format: date-time
          description: creation time in the human readable format (UTC time zone)
        CreatedOn:
          type: integer
          description: creation time of the project
        EditedBy:
          description: the last person who edited this project document
          type: string
        DisplayEditedOn:
          type: string
          format: date-time
          description: edited time in the human readable format (UTC time zone)
        EditedOn:
          description: the last edited time of the project
          type: integer
    TestRunMetadata:
      allOf:
        - $ref: '#/components/schemas/Metadata'
        - type: object
        - properties:
            ClosedBy:
              type: string
              readOnly: true
              description: who closed this test run
            ClosedOn:
              type: string
              readOnly: true
              description: when is this test run closed
            DisplayClosedOn:
              type: string
              readOnly: true
              description: when is this test run closed in form of human readable
    File:
      type: object
      properties:
        content:
          type: string
          nullable: true
          description: Content of the file in base64 format.
        attachment_id:
          type: string
          description: Unique identifier for the attachment.
        internal_filename:
          type: string
          description: Internal storage filename for the attachment.
        original_filename:
          type: string
          description: Original name of the uploaded file.
        size:
          type: integer
          description: Size of the file in bytes.
        mime_type:
          type: string
          description: MIME type of the file.
    Attachment:
      type: object
      properties:
        FileName:
          type: string
          description: Name of the file attached.
        CreatedAt:
          type: string
          format: date-time
          description: Timestamp when the attachment was created.
        UploadOn:
          type: string
          format: date
          description: Date when the file was uploaded.
        OriginalFileName:
          type: string
          description: Original filename as provided during upload.
        UploadBy:
          type: string
          description: Username of the uploader.
        Referenced:
          type: boolean
          description: Indicates if the attachment is referenced elsewhere.
        CopyNumber:
          type: integer
          description: Number of times the attachment has been copied.
        ThumbnailId:
          type: string
          description: Identifier for the attachment’s thumbnail image.
        File:
          $ref: '#/components/schemas/File'
    Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/General'
        Metadata:
          $ref: '#/components/schemas/TestRunMetadata'
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    Meta:
      type: object
      readOnly: true
      description: >-
        \[**Read only**] Contain the meta data information of the document. **It
        will be ignored if included in the request of the update operations**
        (e.g MODIFY_DOCUMENT)
      properties:
        creator:
          type: string
          readOnly: true
          description: The user who created the document
        modifier:
          type: string
          readOnly: true
          description: The user who last modified the document
        docRef:
          type: string
          description: Reference to the document
        modelReference:
          type: string
          description: Reference to the model associated with the document
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the document was created
        modifiedAt:
          type: string
          format: date-time
          description: Timestamp when the document was last modified
        modelVersion:
          type: string
          nullable: true
          description: Version of the model associated with the document
    TestRunDocument:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/Root'
        __meta:
          $ref: '#/components/schemas/Meta'
    TestRunDocumentResult:
      allOf:
        - $ref: '#/components/schemas/DocumentResult'
        - type: object
        - properties:
            document:
              description: Test run document
              $ref: '#/components/schemas/TestRunDocument'
    FilterSpec:
      description: filter specification.
      type: object
      properties:
        fullText:
          type: string
          description: the full text search
        filters:
          type: Array<String>
          description: Array of filter
        lang:
          type: string
          description: requested language
    PageSpec:
      description: pagination specification
      type: object
      properties:
        offset:
          type: integer
        limit:
          type: integer
    SortSpec:
      description: type is a specification of the sorting to be applied on the server side.
      type: object
      properties:
        order:
          type: string
        lang:
          type: string
    SortSpecArray:
      description: type is a specification of the sorting to be applied on the server side.
      type: Array
      items:
        $ref: '#/components/schemas/SortSpec'
    TestRunDocumentResultWithId:
      allOf:
        - $ref: '#/components/schemas/DocumentResult'
        - type: object
        - properties:
            document:
              allOf:
                - $ref: '#/components/schemas/TestRunDocument'
                - type: object
                  properties:
                    id:
                      type: string
                      description: this is dummy value, and can be ignored
    ListDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: LIST_DOCUMENT
            params:
              properties:
                documentModelName:
                  type: string
                filter:
                  $ref: '#/components/schemas/FilterSpec'
                page:
                  $ref: '#/components/schemas/PageSpec'
                sort:
                  type: array
                  $ref: '#/components/schemas/SortSpecArray'
    ListDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              properties:
                fullSize:
                  type: integer
                  description: Total number of the found item
                page:
                  $ref: '#/components/schemas/PageSpec'
                entries:
                  type: array
    AddDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
            params:
              required:
                - docRef
              properties:
                documentModelName:
                  type: string
                locale:
                  type: string
                  description: locale of the request. 'en' or 'de'
                document:
                  type: object
                  description: added document content
    TestRunDocumentToAdd:
      type: object
      properties:
        Root:
          type: object
          properties:
            General:
              $ref: '#/components/schemas/GeneralToAdd'
            Attachments:
              type: array
              items:
                $ref: '#/components/schemas/Attachment'
    AddDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              properties:
                docRef:
                  type: string
                  description: document reference of the created document
      examples:
        - jsonrpc: '2.0'
          id: ADD_TEST_RUN
          result:
            docRef: TestRun-dm/3b53beea-a611-462c-9553-703c4df4d669
    ModifyDocumentRequest:
      allOf:
        - $ref: '#/components/schemas/RpcRequestWithIdAndJsonRpc'
        - type: object
          required:
            - method
            - params
          properties:
            method:
              type: string
              description: MODIFY_DOCUMENT
            params:
              required:
                - docRef
              properties:
                docRef:
                  type: string
                  description: document reference
                locale:
                  type: string
                  description: locale of the request. 'en' or 'de'
                document:
                  type: object
                  description: modified document content
    ModifyDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              description: null value
      examples:
        - jsonrpc: '2.0'
          id: MODIFY_TEST_RUN
          result: null
    BooleanDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: boolean
              description: true/false
      examples:
        - jsonrpc: '2.0'
          id: DELETE_TEST_RUN_TestRun-dm/11825df5-4460-479d-a282-e996d804b571
          result: true
    ListDocumentRequestParamWithoutModelName:
      type: object
      required:
        - page
        - sort
        - filter
      properties:
        filter:
          $ref: '#/components/schemas/FilterSpec'
        page:
          $ref: '#/components/schemas/PageSpec'
        sort:
          type: array
          $ref: '#/components/schemas/SortSpecArray'
    TestSuiteGeneral:
      type: object
      properties:
        ProjectId:
          type: string
          description: Project's Id that containing this test suite
        ProjectVersionNumber:
          type: string
          description: Sub Project's version number that containing this test suite
        SubprojectId:
          type: string
          description: Sub Project's Id that containing this test suite
        Title:
          type: string
          description: Title of the test suite
        Id:
          type: string
          description: Business id of the test suite. It is unique in a sub project
        TechnicalId:
          type: string
          format: uuid
          description: Technical id of the test suite. It is unique in the whole system
        TenantId:
          type: string
          description: Tenant Id
        Order:
          type: string
          description: Order of the test suite in the test suite overview
        Tags:
          type: string
          description: Tags of the test suite
        Description:
          type: string
          description: Description for the test suite
        SearchableTags:
          type: string
          deprecated: true
          description: Use SearchTags instead
        RecommendedPriority:
          type: object
          description: >-
            Priority of the test suite. Possible values are BLOCKER, HIGH,
            MEDIUM, LOW
          properties:
            Value:
              type: string
        SearchTags:
          type: array
          description: Used for searching tags in suites.
          items:
            type: object
            properties:
              Value:
                type: string
    LatestTestCaseExecutionData:
      type: object
      description: latest test case execution for this test suite.
      properties:
        TestedOn:
          type: string
          format: date-time
          description: The date and time when the test case was last executed.
        TestedBy:
          type: string
          description: The username of the person who executed the test case.
        TestRunId:
          type: string
          description: The test run's id in which this test case was executed.
        TestRunTitle:
          type: string
          description: The title of the test run in which this test case was executed.
        VersionId:
          type: string
          description: >-
            The project version identifier associated with the test case during
            execution.
        VersionTitle:
          type: string
          description: The title of the version associated with the test case.
        TestCaseId:
          type: string
          description: The id of the test case that has the latest execution.
        TestCaseTitle:
          type: string
          description: The name of the test case that has the latest execution
    TestSuiteMetadata:
      allOf:
        - $ref: '#/components/schemas/Metadata'
        - type: object
        - properties:
            LatestTestCaseExecutionData:
              $ref: '#/components/schemas/LatestTestCaseExecutionData'
    schemas-Root:
      type: object
      properties:
        General:
          $ref: '#/components/schemas/TestSuiteGeneral'
        Metadata:
          $ref: '#/components/schemas/TestSuiteMetadata'
        Attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
    TestSuiteDocument:
      type: object
      properties:
        Root:
          $ref: '#/components/schemas/schemas-Root'
        __meta:
          $ref: '#/components/schemas/Meta'
    EnrichTestSuiteDocument:
      allOf:
        - $ref: '#/components/schemas/TestSuiteDocument'
        - type: object
        - properties:
            Root:
              allOf:
                - $ref: '#/components/schemas/schemas-Root'
                - type: object
                  properties:
                    DisplayFields:
                      type: object
                      description: >-
                        additional information of the test suite, that used to
                        be displayed on run
                      properties:
                        TotalTestCases:
                          type: integer
                          description: number of test cases
    EnrichTestSuiteDocumentResult:
      allOf:
        - $ref: '#/components/schemas/DocumentResult'
        - type: object
        - properties:
            document:
              $ref: '#/components/schemas/EnrichTestSuiteDocument'
    Entity:
      type: object
      properties:
        role:
          type: string
          description: Role of the entity that participates into this relationship
        modelName:
          type: string
          description: Model name of the entity that participates into this relationship
        docRef:
          type: string
          description: Document reference of the entity
    LinkDescriptor:
      type: object
      description: Information of entities in the relationship
      properties:
        relationshipModel:
          type: string
          description: Name of the relationship model
        entities:
          type: array
          description: Contains 2 items which are the parent and child
          items:
            $ref: '#/components/schemas/Entity'
        predecessorLinkRef:
          type: string
          description: Link reference of the predecessor
          nullable: true
        position:
          type: number
          description: The position of the node to the predecessorLinkRef
    LinkRef:
      type: object
      description: Represent the link contains the documents
      properties:
        linkDescriptor:
          $ref: '#/components/schemas/LinkDescriptor'
        id:
          type: string
          description: id of the relationship link
    NullDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/RpcResult'
        - type: object
          properties:
            result:
              type: object
              description: null value
      examples:
        - jsonrpc: '2.0'
          id: DELETE_TEST_SUITES_FROM_RUN_1
          result: null
  parameters:
    ProjectIdHeader:
      name: Project-Id
      in: header
      required: true
      schema:
        type: string
      description: Project Id or the project document reference
    SubProjectIdHeader:
      name: Subproject-Id
      in: header
      required: false
      schema:
        type: string
      description: >-
        Sub Project Id or the project document reference. It might be required
        if you want to access the sub project's resource
