diff --git a/openapi.yaml b/openapi.yaml index 2d145d0..0b520ba 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3,9 +3,30 @@ info: title: Octomind external API description: Octomind API that allows you to execute test cases, fetch reports and register private location workers by providing a URL and an ID. version: 1.0.0 + contact: + name: API Support + url: https://octomind.dev/docs + email: support@octomind.dev externalDocs: description: Find out more url: https://octomind.dev/docs/ +tags: + - name: Test targets + description: Operations for managing test targets + - name: Execute + description: Operations for executing tests + - name: Environments + description: Operations for managing test environments + - name: Reports + description: Operations for retrieving test reports + - name: Notifications + description: Operations for retrieving notifications + - name: Private locations + description: Operations for managing private locations + - name: Test Cases + description: Operations for retrieving test cases + - name: Discoveries + description: Operations for creating test discoveries servers: - url: https://app.octomind.dev/api description: Main API Endpoint @@ -16,6 +37,95 @@ components: in: header name: X-API-Key schemas: + TestCaseElement: + type: object + properties: + id: + type: string + format: uuid + index: + type: integer + interaction: + type: object + nullable: true + properties: + id: + type: string + format: uuid + action: + type: string + enum: + [ + EXTRACT, + ENTER_TEXT, + CLICK, + SELECT_OPTION, + TYPE_TEXT, + KEY_PRESS, + HOVER, + UPLOAD, + GO_TO, + DRAG_AND_DROP, + CLOSE_PAGE, + OPEN_EMAIL, + ] + calledWith: + type: string + nullable: true + testCaseElementId: + type: string + format: uuid + assertion: + type: object + nullable: true + properties: + id: + type: string + format: uuid + expectation: + type: string + enum: + [ + VISIBLE, + NOT_VISIBLE, + TO_BE_CHECKED, + NOT_TO_BE_CHECKED, + TO_HAVE_VALUE, + TO_CONTAIN_TEXT, + TO_HAVE_STYLE, + ] + calledWith: + type: string + nullable: true + testCaseElementId: + type: string + format: uuid + selectors: + type: array + items: + type: object + properties: + id: + type: string + format: uuid + index: + type: integer + selector: + type: string + selectorType: + type: string + enum: [TEXT, LABEL, PLACEHOLDER, ROLE] + options: + type: object + nullable: true + testCaseElementId: + type: string + format: uuid + testCaseId: + type: string + format: uuid + ignoreFailure: + type: boolean ExecutionContext: oneOf: - type: object @@ -239,24 +349,18 @@ components: - url - context - TestTargetExecutionResponse: - type: object - properties: - testReportUrl: - type: string - description: The URL the test target was executed. - example: "https://example.com" - testReport: - type: object - description: The test report from the run. - example: "some json" - TestReportContext: type: object properties: source: type: string - enum: ["manual"] + enum: + - "github" + - "azureDevOps" + - "discovery" + - "manual" + - "scheduled" + - "proposal" description: The source of the test trigger. example: "manual" description: @@ -381,7 +485,7 @@ components: - address - name - TestReportResponse: + TestExecutionResponse: type: object properties: testReportUrl: @@ -546,115 +650,25 @@ components: nullable: true discovery: type: object + nullable: true properties: - id: + updatedAt: type: string - format: uuid + format: date-time freePrompt: type: string traceUrl: type: string nullable: true - traceJsonManifestUrl: - type: string - nullable: true status: type: string - enum: [OUTDATED] + enum: [CREATED, IN_PROGRESS, ERROR, SUCCESS, FAILED, INCOMPLETE, QUEUED, STOPPED, OUTDATED, PAUSED] abortCause: type: string nullable: true message: type: string nullable: true - testCaseId: - type: string - format: uuid - lastJobExecutionName: - type: string - nullable: true - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - executedTestCaseElements: - type: array - items: - type: string - testCase: - type: object - properties: - id: - type: string - format: uuid - testTargetId: - type: string - format: uuid - description: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - entryPointUrlPath: - type: string - nullable: true - type: - type: string - nullable: true - status: - type: string - enum: [ENABLED] - runStatus: - type: string - enum: [ON] - interactionStatus: - type: string - enum: [NEW] - createdBy: - type: string - enum: [EDIT] - proposalRunId: - type: string - nullable: true - externalId: - type: string - nullable: true - folderId: - type: string - nullable: true - prerequisiteId: - type: string - nullable: true - predecessorId: - type: string - format: uuid - testTarget: - type: object - properties: - id: - type: string - format: uuid - app: - type: string - createdAt: - type: string - format: date-time - updatedAt: - type: string - format: date-time - orgId: - type: string - format: uuid - testIdAttribute: - type: string - nullable: true - timeoutPerStep: - type: integer required: - id - testTargetId @@ -697,6 +711,24 @@ components: items: $ref: "#/components/schemas/EnvironmentResponse" + EnvironmentSimpleResponse: + type: object + properties: + id: + type: string + format: uuid + type: + type: string + enum: ["DEFAULT", "ADDITIONAL"] + example: "DEFAULT" + discoveryUrl: + type: string + format: url + example: "https://example.com" + email: + type: string + example: "user@example.com" + description: The 2FA email of the environment to test email flows. EnvironmentResponse: type: object properties: @@ -705,6 +737,8 @@ components: format: uuid name: type: string + enum: ["DEFAULT", "ADDITIONAL"] + example: "DEFAULT" testTargetId: type: string format: uuid @@ -713,6 +747,8 @@ components: format: date-time type: type: string + enum: ["DEFAULT", "ADDITIONAL"] + example: "DEFAULT" discoveryUrl: type: string format: url @@ -763,7 +799,6 @@ components: - name - testTargetId - type - TestSuiteRequestCommons: type: object properties: @@ -845,6 +880,89 @@ components: items: $ref: "#/components/schemas/TestSuiteResponse" + CreateTestTargetBody: + type: object + properties: + testTarget: + type: object + properties: + app: + type: string + description: The app name or project name of the test target + discoveryUrl: + type: string + format: uri + description: The discovery URL of the test target. This is the URL that a discovery tool can use to discover the test target. + required: + - app + - discoveryUrl + TestTargetsResponse: + type: array + items: + $ref: "#/components/schemas/TestTargetResponse" + TestTargetResponse: + type: object + properties: + id: + type: string + format: uuid + app: + type: string + description: The app name or project name of the test target + tags: + type: array + items: + type: string + nullable: true + environments: + type: array + items: + $ref: "#/components/schemas/EnvironmentSimpleResponse" + description: The environments of the test target + TestTargetUpdateRequest: + type: object + properties: + app: + type: string + nullable: true + description: The app name or project name of the test target + discoveryUrl: + type: string + format: uri + nullable: true + description: The discovery URL of the test target + testIdAttribute: + type: string + nullable: true + description: The attribute name of the test ID + example: "test-automation-id" + testRailIntegration: + type: object + properties: + domain: + type: string + description: The domain of the TestRail instance + example: "https://mycompany.testrail.io" + username: + type: string + description: The username for the TestRail instance + example: "user" + projectId: + type: string + description: The project ID for the TestRail instance + example: "123" + apiKey: + type: string + description: The TestRail API key for the TestRail instance + example: "123123123" + nullable: true + timeoutPerStep: + type: number + format: int32 + minimum: 5000 + maximum: 30000 + description: The timeout per step in milliseconds + ZodResponse: type: array items: @@ -980,96 +1098,166 @@ components: format: uuid paths: - /apiKey/v2/test-suites: + /apiKey/v2/test-targets: get: - summary: Retrieve test suites - description: get a list of all defined test suites. + summary: Retrieve all test targets + description: "Gets a list of test targets." + operationId: getTestTargets + tags: + - Test targets security: - ApiKeyAuth: [] - tags: - - test-suites responses: "200": - description: test suites + description: OK content: application/json: schema: - $ref: "#/components/schemas/TestSuitesResponse" + $ref: "#/components/schemas/TestTargetsResponse" + "401": + description: Invalid or missing API key + "500": + description: Internal server error post: - summary: Create a test suite + summary: Create a new test target + description: "Creates a new test target." + operationId: createTestTarget + tags: + - Test targets security: - ApiKeyAuth: [] - tags: - - test-suites requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/TestSuiteCreateRequest" + $ref: "#/components/schemas/CreateTestTargetBody" + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TestTargetResponse" + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" + "401": + description: Invalid or missing API key + "500": + description: Internal server error + + /apiKey/v2/test-targets/{testTargetId}: + get: + summary: Retrieve a test target + description: "Gets a test target by ID." + operationId: getTestTarget + tags: + - Test targets + security: + - ApiKeyAuth: [] + parameters: + - in: path + name: testTargetId + required: true + schema: + type: string + format: uuid + description: ID of the test target to fetch responses: "200": - description: test suites + description: OK content: application/json: schema: - $ref: "#/components/schemas/TestSuiteResponse" + $ref: "#/components/schemas/TestTargetResponse" "400": description: Invalid request parameters content: application/json: schema: $ref: "#/components/schemas/ZodResponse" + "401": + description: Invalid or missing API key - /apiKey/v2/test-suites/{testSuiteId}: patch: - summary: Update a test suite + summary: Update a test target + description: "Updates a test target by ID." + operationId: updateTestTarget + tags: + - Test targets + parameters: + - in: path + name: testTargetId + required: true + schema: + type: string + format: uuid + description: ID of the test target to update security: - ApiKeyAuth: [] - tags: - - test-suites requestBody: required: true content: application/json: schema: - $ref: "#/components/schemas/TestSuitePatchRequest" + $ref: "#/components/schemas/TestTargetUpdateRequest" responses: "200": - description: test suites + description: OK content: application/json: schema: - $ref: "#/components/schemas/TestSuiteResponse" + $ref: "#/components/schemas/TestTargetResponse" "400": description: Invalid request parameters content: application/json: schema: $ref: "#/components/schemas/ZodResponse" + "401": + description: Invalid or missing API key + "500": + description: Internal server error delete: - summary: Delete a test suite + summary: Delete a test target + description: "Deletes a test target by ID." + operationId: deleteTestTarget + tags: + - Test targets security: - ApiKeyAuth: [] - tags: - - test-suites + parameters: + - in: path + name: testTargetId + required: true + schema: + type: string + format: uuid + description: ID of the test target to delete responses: "204": - description: test suites - content: - application/json: - schema: - $ref: "#/components/schemas/SuccessResponse" + description: OK + "401": + description: Invalid or missing API key "404": - description: test suite not found + description: Test target not found + "500": + description: Internal server error /apiKey/v2/execute: post: summary: Execute tests of the given test target description: | This endpoint triggers a test execution by sending an test target id, an URL and optionally tags, an environment and variables. + operationId: executeTests tags: - - execute + - Execute security: - ApiKeyAuth: [] requestBody: @@ -1084,47 +1272,91 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TestReportResponse" + $ref: "#/components/schemas/TestExecutionResponse" "400": description: Invalid request parameters content: application/json: schema: $ref: "#/components/schemas/ZodResponse" + "401": + description: Invalid or missing API key "500": description: Internal server error - /apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}: - delete: - summary: Delete an environment + /apiKey/v2/test-targets/{testTargetId}/config: + get: + summary: Retrieve test target configuration + description: Get the test target configuration for a specific environment + operationId: getTestTargetConfig security: - ApiKeyAuth: [] tags: - - environments - responses: - "200": - description: Environment deleted successfully + - Test targets parameters: - - in: path - name: testTargetId + - name: testTargetId + in: path required: true schema: type: string format: uuid - description: ID of the test target to which the test report belongs to - - in: path - name: environmentId + description: The ID of the test target + - name: url + in: query + required: true + schema: + type: string + format: uri + description: The execution URL for the test target + - name: outputDir + in: query required: true + schema: + type: string + description: The directory where test output will be stored + - name: headless + in: query + required: false + schema: + type: string + description: Whether to run tests in headless mode (true/false) + - name: environmentId + in: query + required: false schema: type: string format: uuid - description: ID of the environment to update - patch: - summary: Update an environment + description: Optional ID of the environment to use (defaults to the test target's default environment if not provided) + responses: + "200": + description: Test target configuration retrieved successfully + content: + text/plain: + schema: + type: string + description: The test target configuration as plain text + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" + "401": + description: Unauthorized - Invalid or missing API key + "404": + description: Environment not found + "405": + description: Method not allowed + + /apiKey/v2/test-targets/{testTargetId}/environments: + post: + summary: Create an environment + description: Create a custom environment. + operationId: createEnvironment security: - ApiKeyAuth: [] tags: - - environments + - Environments parameters: - in: path name: testTargetId @@ -1133,13 +1365,6 @@ paths: type: string format: uuid description: ID of the test target to which the environment belongs to - - in: path - name: environmentId - required: true - schema: - type: string - format: uuid - description: ID of the environment to update requestBody: required: true content: @@ -1149,11 +1374,9 @@ paths: properties: name: type: string - nullable: true discoveryUrl: type: string format: url - nullable: true testAccount: type: object properties: @@ -1175,29 +1398,61 @@ paths: nullable: true privateLocationName: type: string - nullable: true description: name of the private location additionalHeaderFields: type: object additionalProperties: type: string nullable: true + responses: - "200": - description: Environment updated successfully + "201": + description: environment created content: application/json: schema: $ref: "#/components/schemas/EnvironmentResponse" + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" + "401": + description: Invalid or missing API key + get: + summary: Retrieve environments + description: get a list of all defined environments. + operationId: getEnvironments + security: + - ApiKeyAuth: [] + tags: + - Environments + parameters: + - in: path + name: testTargetId + required: true + schema: + type: string + format: uuid + description: ID of the test target to which the test report belongs to + responses: + "200": + description: environments + content: + application/json: + schema: + $ref: "#/components/schemas/EnvironmentsResponse" - /apiKey/v2/test-targets/{testTargetId}/environments: - post: - summary: Create an environment - description: Create a custom environment. + /apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}: + patch: + summary: Update an environment + description: Updates an enviroment, all properties can be set separately + operationId: updateEnvironment security: - ApiKeyAuth: [] tags: - - environments + - Environments parameters: - in: path name: testTargetId @@ -1206,6 +1461,13 @@ paths: type: string format: uuid description: ID of the test target to which the environment belongs to + - in: path + name: environmentId + required: true + schema: + type: string + format: uuid + description: ID of the environment to update requestBody: required: true content: @@ -1215,9 +1477,11 @@ paths: properties: name: type: string + nullable: true discoveryUrl: type: string format: url + nullable: true testAccount: type: object properties: @@ -1239,28 +1503,31 @@ paths: nullable: true privateLocationName: type: string + nullable: true description: name of the private location additionalHeaderFields: type: object additionalProperties: type: string nullable: true - responses: - "201": - description: environment created + "200": + description: Environment updated successfully content: application/json: schema: $ref: "#/components/schemas/EnvironmentResponse" - - get: - summary: Retrieve environments - description: get a list of all defined environments. + delete: + summary: Delete an environment + operationId: deleteEnvironment + description: deletes an enviroment. this operation is not reversable. security: - ApiKeyAuth: [] tags: - - environments + - Environments + responses: + "200": + description: Environment deleted successfully parameters: - in: path name: testTargetId @@ -1269,20 +1536,21 @@ paths: type: string format: uuid description: ID of the test target to which the test report belongs to - responses: - "200": - description: environments - content: - application/json: - schema: - $ref: "#/components/schemas/EnvironmentsResponse" + - in: path + name: environmentId + required: true + schema: + type: string + format: uuid + description: ID of the environment to update /apiKey/v2/test-targets/{testTargetId}/test-reports/{testReportId}: get: summary: Retrieve information about a test report description: Poll from within a CI-pipeline to wait for the completion of a report. + operationId: getTestReport tags: - - reports + - Reports parameters: - in: path name: testTargetId @@ -1307,6 +1575,55 @@ paths: application/json: schema: $ref: "#/components/schemas/TestReport" + example: + id: "826c15af-644b-4b28-89b4-f50ff34e46b7" + testTargetId: "3435918b-3d29-4ebd-8c68-9a540532f45a" + createdAt: "2024-09-06T13:01:51.686Z" + updatedAt: "2024-09-06T13:05:23.412Z" + executionUrl: "https://en.wikipedia.org/" + status: "FAILED" + context: + source: "github" + issueNumber: 123 + ref: "refs/heads/main" + sha: "abc123def456" + repo: "my-repo" + owner: "repo-owner" + triggeredBy: + type: "USER" + userId: "3435918b-3d29-4ebd-8c68-9a540532f45a" + nodeId: "node-123" + testResults: + - id: "9876fedc-ba98-7654-3210-fedcba987654" + testCaseId: "9876fedc-ba98-7654-3210-fedcba987654" + testTargetId: "3435918b-3d29-4ebd-8c68-9a540532f45a" + testReportId: "826c15af-644b-4b28-89b4-f50ff34e46b7" + name: "User can search for information" + createdAt: "2024-09-06T13:01:51.686Z" + updatedAt: "2024-09-06T13:03:12.345Z" + status: "PASSED" + errorMessage: null + traceUrl: "https://storage.googleapis.com/automagically-traces/7a1b2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p-trace.zip" + - id: "3435918b-3d29-4ebd-8c68-9a540532f45a" + testCaseId: "5432fedc-ba98-7654-3210-fedcba543210" + testTargetId: "3435918b-3d29-4ebd-8c68-9a540532f45a" + testReportId: "826c15af-644b-4b28-89b4-f50ff34e46b7" + name: "User can navigate to article" + createdAt: "2024-09-06T13:01:51.686Z" + updatedAt: "2024-09-06T13:04:45.678Z" + status: "FAILED" + errorMessage: "TimeoutError: locator.click: Timeout 30000ms exceeded." + traceUrl: "https://storage.googleapis.com/automagically-traces/2a3b4c5d-6e7f-8g9h-0i1j-2k3l4m5n6o7p-trace.zip" + - id: "3435918b-3d29-4ebd-8c68-9a540532f45a" + testCaseId: "1234abcd-ef56-7890-abcd-ef1234567890" + testTargetId: "3435918b-3d29-4ebd-8c68-9a540532f45a" + testReportId: "826c15af-644b-4b28-89b4-f50ff34e46b7" + name: "User can create an account" + createdAt: "2024-09-06T13:01:51.686Z" + updatedAt: "2024-09-06T13:05:23.412Z" + status: "WAITING" + errorMessage: null + traceUrl: null "400": description: Invalid request parameters content: @@ -1322,8 +1639,9 @@ paths: get: summary: Retrieve paginated information about test reports description: Allow fetching the history of test reports for your test target. + operationId: getTestReports tags: - - reports + - Reports parameters: - in: path name: testTargetId @@ -1406,6 +1724,7 @@ paths: get: summary: Retrieve notifications description: Get a list of notifications for a specific test target. + operationId: getNotifications security: - ApiKeyAuth: [] tags: @@ -1474,8 +1793,9 @@ paths: - ApiKeyAuth: [] summary: Retrieve all private locations description: "gets a list of private location workers" + operationId: getPrivateLocations tags: - - private-location + - Private locations responses: "200": description: OK @@ -1490,8 +1810,9 @@ paths: - ApiKeyAuth: [] summary: Register a private location description: "registers a private location worker" + operationId: registerPrivateLocation tags: - - private-location + - Private locations requestBody: required: true content: @@ -1505,6 +1826,12 @@ paths: application/json: schema: $ref: "#/components/schemas/SuccessResponse" + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" "404": description: private location of that name not found "500": @@ -1516,8 +1843,9 @@ paths: - ApiKeyAuth: [] summary: Unregister a private location description: "Unregisters a private location worker." + operationId: unregisterPrivateLocation tags: - - private-location + - Private locations externalDocs: url: https://octomind.dev/docs/proxy/private-location requestBody: @@ -1533,15 +1861,22 @@ paths: application/json: schema: $ref: "#/components/schemas/SuccessResponse" + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" "404": description: private location of that name not found "500": description: Internal server error - /apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}/code: + /apiKey/v2/test-targets/{testTargetId}/test-cases: get: - summary: Retrieve code for a test case - description: Get the code representation of a specific test case + summary: List test cases + description: Get a list of test cases for a specific test target with optional filtering + operationId: getTestCases security: - ApiKeyAuth: [] tags: @@ -1554,71 +1889,47 @@ paths: type: string format: uuid description: The ID of the test target - - name: testCaseId - in: path - required: true - schema: - type: string - format: uuid - description: The ID of the test case - - name: environmentId + - name: filter in: query required: false schema: type: string - format: uuid - description: Optional ID of the environment to use for the test case code - - name: executionUrl - in: query - required: true - schema: - type: string - format: url - description: URL of the app to test + description: | + JSON string containing filter criteria for test cases. The filter supports the following fields: + - id: Filter by test case ID + - testTargetId: Filter by test target ID + - description: Filter by test case description + - status: Filter by test case status (ENABLED, DISABLED, DRAFT, OUTDATED, PROVISIONAL) + - runStatus: Filter by run status (ON, OFF) + - folderId: Filter by folder ID + - externalId: Filter by external ID + - AND: Logical AND operator for combining multiple conditions + - OR: Logical OR operator for combining multiple conditions + - NOT: Logical NOT operator for negating conditions + example: '{"status":"ENABLED","folderId":"some-folder-id","OR":[{"description":"Login Test"},{"externalId":"TEST-123"}]}' responses: "200": - description: Code for the test case + description: List of test cases content: application/json: schema: - type: object - properties: - testCode: - type: string - description: The code representation of the test case - required: - - testCode - "404": - description: Test case not found - - /apiKey/v2/test-targets/{testTargetId}/test-cases: - get: - summary: Retrieve test cases - description: Get a list of test cases for a specific test target - security: - - ApiKeyAuth: [] - tags: - - Test Cases - parameters: - - name: testTargetId - in: path - required: true - schema: - type: string - format: uuid - description: The ID of the test target - responses: - "200": - description: List of test cases + $ref: "#/components/schemas/TestCasesResponse" + "400": + description: Invalid request parameters content: application/json: schema: - $ref: "#/components/schemas/TestCasesResponse" + $ref: "#/components/schemas/ZodResponse" + "401": + description: Unauthorized - Invalid or missing API key + "404": + description: Test target not found /apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}: get: summary: Retrieve a test case description: Get detailed information about a specific test case + operationId: getTestCase security: - ApiKeyAuth: [] tags: @@ -1650,14 +1961,15 @@ paths: "404": description: Test target or test case not found - /apiKey/v2/test-targets/{testTargetId}/config: + /apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}/code: get: - summary: Retrieve test target configuration - description: Get the configuration of a specific test target + summary: Retrieve code for a test case + description: Get the code representation of a specific test case + operationId: getTestCaseCode security: - ApiKeyAuth: [] tags: - - Test Targets + - Test Cases parameters: - name: testTargetId in: path @@ -1666,45 +1978,172 @@ paths: type: string format: uuid description: The ID of the test target - - name: environmentId - in: query - required: false + - name: testCaseId + in: path + required: true schema: type: string format: uuid - description: Optional ID of the environment to use for the test target configuration - - name: url + description: The ID of the test case + - name: executionUrl in: query required: true schema: type: string format: url description: URL of the app to test - - name: outputDir + - name: environmentId in: query + required: false + schema: + type: string + format: uuid + description: Optional ID of the environment to use + responses: + "200": + description: Test case code retrieved successfully + content: + application/json: + schema: + type: object + properties: + testCode: + type: string + description: The code representation of the test case + required: + - testCode + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" + "401": + description: Unauthorized - Invalid or missing API key + "404": + description: Test target, test case, or test code not found + + patch: + summary: Update a test case + description: Update specific properties of a test case + operationId: patchTestCase + security: + - ApiKeyAuth: [] + tags: + - Test Cases + parameters: + - name: testTargetId + in: path required: true schema: type: string - description: Directory to write the playwright output to - - name: headless - in: query - required: false + format: uuid + description: The ID of the test target + - name: testCaseId + in: path + required: true schema: - type: boolean - description: Whether to run the test in headless mode + type: string + format: uuid + description: The ID of the test case to update + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + elements: + type: array + items: + $ref: "#/components/schemas/TestCaseElement" + description: + type: string + entryPointUrlPath: + type: string + nullable: true + status: + type: string + enum: [ENABLED, DISABLED, DRAFT, OUTDATED, PROVISIONAL] + runStatus: + type: string + enum: [ON, OFF] + folderName: + type: string + nullable: true + interactionStatus: + type: string + enum: [NEW, EDITED, APPROVED, REJECTED] + createBackendDiscoveryPrompt: + type: string + assignedTagNames: + type: array + items: + type: string + externalId: + type: string + nullable: true responses: "200": - description: Test target configuration + description: Updated test case content: - text/plain: + application/json: schema: - type: string - example: "Test target configuration details" + type: object + properties: + id: + type: string + format: uuid + testTargetId: + type: string + format: uuid + description: + type: string + status: + type: string + enum: [ENABLED, DISABLED, DRAFT, OUTDATED, PROVISIONAL] + runStatus: + type: string + enum: [ON, OFF] + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + entryPointUrlPath: + type: string + nullable: true + elements: + type: array + items: + type: object + folderId: + type: string + nullable: true + externalId: + type: string + nullable: true + tags: + type: array + items: + type: string + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" + "401": + description: Unauthorized - Invalid or missing API key + "404": + description: Test case, folder or tag not found /apiKey/v2/test-targets/{testTargetId}/discoveries: post: summary: Create a discovery description: Create a new test case discovery with a given name and prompt + operationId: createDiscovery security: - ApiKeyAuth: [] tags: @@ -1729,36 +2168,45 @@ paths: properties: name: type: string - description: Name of the discovery - example: "foo" + description: A descriptive name for the discovery that clearly identifies its purpose. This will be displayed in the UI and used for reference. + example: "Login Flow Validation" prompt: type: string - description: The prompt describing what to discover - example: "make sure current time is visible" + description: Detailed instructions for what should be discovered and validated. Be specific about the functionality, conditions, or behaviors to test. + example: "Verify that users can successfully log in with valid credentials and see their dashboard." entryPointUrlPath: type: string - description: Optional URL path for the entry point + description: The specific URL path where the test should begin execution. For example, '/login' for authentication tests or '/dashboard' for dashboard features. + example: "/login" nullable: true - prerequisiteId: + prerequisiteName: type: string - format: uuid - description: Optional ID of a prerequisite test case + description: Name of another test case that must be executed before this discovery. The system will resolve this to the appropriate test case within the same test target. + example: "Login Test" nullable: true externalId: type: string - description: Optional external identifier + description: Custom identifier to link this discovery with external systems or tracking tools. Can be used for integration with issue trackers or test management systems. + example: "JIRA-1234" nullable: true - assignedTagIds: + tagNames: type: array - description: Optional list of tag IDs to assign + description: List of tags to categorize and organize the discovery. Tags help in filtering and grouping related test cases (e.g., 'authentication', 'critical-path', 'regression'). items: type: string - format: uuid + example: "authentication" nullable: true - folderId: + example: ["authentication", "critical-path", "smoke-test"] + folderName: type: string - format: uuid - description: Optional ID of the folder to place the discovery in + description: Name of the organizational folder where this discovery should be stored. Helps in maintaining a structured test hierarchy (e.g., 'Authentication Tests', 'User Management'). + example: "Authentication Tests" + nullable: true + type: + type: string + enum: [LOGIN, COOKIE_BANNER] + description: Type of the test case to discover (e.g., 'LOGIN', 'COOKIE_BANNER'). + example: "LOGIN" nullable: true responses: "200": @@ -1779,9 +2227,15 @@ paths: type: string format: uuid description: The ID of the associated test case + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "#/components/schemas/ZodResponse" "401": description: Unauthorized - Invalid or missing API key "404": description: Test target not found - "400": - description: Invalid request body + "500": + description: Internal server error diff --git a/src/api.ts b/src/api.ts index c14c380..e3b59fa 100644 --- a/src/api.ts +++ b/src/api.ts @@ -4,1188 +4,482 @@ */ export interface paths { - "/apiKey/v2/test-suites": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve test suites - * @description get a list of all defined test suites. - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description test suites */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestSuitesResponse"]; - }; - }; - }; - }; - put?: never; - /** Create a test suite */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestSuiteCreateRequest"]; - }; - }; - responses: { - /** @description test suites */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestSuiteResponse"]; - }; - }; - /** @description Invalid request parameters */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ZodResponse"]; - }; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-suites/{testSuiteId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve all test targets + * @description Gets a list of test targets. + */ + get: operations["getTestTargets"]; + put?: never; + /** + * Create a new test target + * @description Creates a new test target. + */ + post: operations["createTestTarget"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - get?: never; - put?: never; - post?: never; - /** Delete a test suite */ - delete: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description test suites */ - 204: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SuccessResponse"]; - }; - }; - /** @description test suite not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve a test target + * @description Gets a test target by ID. + */ + get: operations["getTestTarget"]; + put?: never; + post?: never; + /** + * Delete a test target + * @description Deletes a test target by ID. + */ + delete: operations["deleteTestTarget"]; + options?: never; + head?: never; + /** + * Update a test target + * @description Updates a test target by ID. + */ + patch: operations["updateTestTarget"]; + trace?: never; }; - options?: never; - head?: never; - /** Update a test suite */ - patch: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestSuitePatchRequest"]; - }; - }; - responses: { - /** @description test suites */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestSuiteResponse"]; - }; - }; - /** @description Invalid request parameters */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ZodResponse"]; - }; - }; - }; + "/apiKey/v2/execute": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Execute tests of the given test target + * @description This endpoint triggers a test execution by sending an test target id, an URL and optionally tags, an environment and variables. + * + */ + post: operations["executeTests"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - trace?: never; - }; - "/apiKey/v2/execute": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets/{testTargetId}/config": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve test target configuration + * @description Get the test target configuration for a specific environment + */ + get: operations["getTestTargetConfig"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - get?: never; - put?: never; - /** - * Execute tests of the given test target - * @description This endpoint triggers a test execution by sending an test target id, an URL and optionally tags, an environment and variables. - * - */ - post: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TestTargetExecutionRequest"]; - }; - }; - responses: { - /** @description Test executed successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestReportResponse"]; - }; - }; - /** @description Invalid request parameters */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ZodResponse"]; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}/environments": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve environments + * @description get a list of all defined environments. + */ + get: operations["getEnvironments"]; + put?: never; + /** + * Create an environment + * @description Create a custom environment. + */ + post: operations["createEnvironment"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** + * Delete an environment + * @description deletes an enviroment. this operation is not reversable. + */ + delete: operations["deleteEnvironment"]; + options?: never; + head?: never; + /** + * Update an environment + * @description Updates an enviroment, all properties can be set separately + */ + patch: operations["updateEnvironment"]; + trace?: never; }; - get?: never; - put?: never; - post?: never; - /** Delete an environment */ - delete: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the test target to which the test report belongs to */ - testTargetId: string; - /** @description ID of the environment to update */ - environmentId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Environment deleted successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}/test-reports/{testReportId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve information about a test report + * @description Poll from within a CI-pipeline to wait for the completion of a report. + */ + get: operations["getTestReport"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - options?: never; - head?: never; - /** Update an environment */ - patch: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the test target to which the environment belongs to */ - testTargetId: string; - /** @description ID of the environment to update */ - environmentId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string | null; - /** Format: url */ - discoveryUrl?: string | null; - testAccount?: { - username?: string; - password?: string; - otpInitializerKey?: string | null; - } | null; - basicAuth?: { - username?: string; - password?: string; - } | null; - /** @description name of the private location */ - privateLocationName?: string | null; - additionalHeaderFields?: { - [key: string]: string; - } | null; - }; - }; - }; - responses: { - /** @description Environment updated successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EnvironmentResponse"]; - }; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}/test-reports": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve paginated information about test reports + * @description Allow fetching the history of test reports for your test target. + */ + get: operations["getTestReports"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/environments": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets/{testTargetId}/notifications": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve notifications + * @description Get a list of notifications for a specific test target. + */ + get: operations["getNotifications"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** - * Retrieve environments - * @description get a list of all defined environments. - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the test target to which the test report belongs to */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description environments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EnvironmentsResponse"]; - }; - }; - }; + "/apiKey/v1/private-location": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve all private locations + * @description gets a list of private location workers + */ + get: operations["getPrivateLocations"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - put?: never; - /** - * Create an environment - * @description Create a custom environment. - */ - post: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the test target to which the environment belongs to */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - name?: string; - /** Format: url */ - discoveryUrl?: string; - testAccount?: { - username?: string; - password?: string; - otpInitializerKey?: string | null; - } | null; - basicAuth?: { - username?: string; - password?: string; - } | null; - /** @description name of the private location */ - privateLocationName?: string; - additionalHeaderFields?: { - [key: string]: string; - } | null; - }; - }; - }; - responses: { - /** @description environment created */ - 201: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["EnvironmentResponse"]; - }; - }; - }; + "/apiKey/v1/private-location/register": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Register a private location + * @description registers a private location worker + */ + put: operations["registerPrivateLocation"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/test-reports/{testReportId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v1/private-location/unregister": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Unregister a private location + * @description Unregisters a private location worker. + */ + put: operations["unregisterPrivateLocation"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** - * Retrieve information about a test report - * @description Poll from within a CI-pipeline to wait for the completion of a report. - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - /** @description ID of the test target to which the test report belongs to */ - testTargetId: string; - /** @description ID of the test report to fetch */ - testReportId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Test Report information */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestReport"]; - }; - }; - /** @description Invalid request parameters */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ZodResponse"]; - }; - }; - /** @description Invalid or missing API key */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}/test-cases": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List test cases + * @description Get a list of test cases for a specific test target with optional filtering + */ + get: operations["getTestCases"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/test-reports": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve a test case + * @description Get detailed information about a specific test case + */ + get: operations["getTestCase"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** - * Retrieve paginated information about test reports - * @description Allow fetching the history of test reports for your test target. - */ - get: { - parameters: { - query?: { - key?: { - /** - * Format: date-time - * @description The timestamp of the key of the next page to fetch - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) - * @example 2024-09-06T13:01:51.686Z - */ - createdAt?: string; - }; - filter?: { - /** - * @description The name of the property to filter for, e.g. an environmentId - * @example environmentId - */ - key?: string; - /** - * @description How to compare the property in question, only EQUALS is supported so far. - * @enum {string} - */ - operator?: "EQUALS"; - /** - * Format: uuid - * @description The value to compare with to find matches. - * @example 3435918b-3d29-4ebd-8c68-9a540532f45a - */ - value?: string; - }[]; - }; - header?: never; - path: { - /** @description ID of the test target for which to fetch the history for */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Test Reports information */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - data?: components["schemas"]["TestReport"][]; - key?: { - /** - * Format: date-time - * @description The timestamp of the key of the next page to fetch - use this in the query when fetching the next page of reports - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) - * @example 2024-09-06T13:01:51.686Z - */ - createdAt?: string; - }; - /** @description If the query in question has another page to retrieve */ - hasNextPage?: boolean; - }; - }; - }; - /** @description Invalid request parameters */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["ZodResponse"]; - }; - }; - /** @description Invalid or missing API key */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; + "/apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}/code": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Retrieve code for a test case + * @description Get the code representation of a specific test case + */ + get: operations["getTestCaseCode"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + /** + * Update a test case + * @description Update specific properties of a test case + */ + patch: operations["patchTestCase"]; + trace?: never; }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/notifications": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; + "/apiKey/v2/test-targets/{testTargetId}/discoveries": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Create a discovery + * @description Create a new test case discovery with a given name and prompt + */ + post: operations["createDiscovery"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; }; - /** - * Retrieve notifications - * @description Get a list of notifications for a specific test target. - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description List of notifications */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** Format: uuid */ - id?: string; - /** Format: uuid */ - testTargetId?: string; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - payload?: { - failed?: boolean; - context?: components["schemas"]["ExecutionContext"]; +} +export type webhooks = Record; +export interface components { + schemas: { + TestCaseElement: { + /** Format: uuid */ + id?: string; + index?: number; + interaction?: { /** Format: uuid */ - testReportId?: string; + id?: string; + /** @enum {string} */ + action?: "EXTRACT" | "ENTER_TEXT" | "CLICK" | "SELECT_OPTION" | "TYPE_TEXT" | "KEY_PRESS" | "HOVER" | "UPLOAD" | "GO_TO" | "DRAG_AND_DROP" | "CLOSE_PAGE" | "OPEN_EMAIL"; + calledWith?: string | null; /** Format: uuid */ - testCaseId?: string; - }; - /** @enum {string} */ - type?: "REPORT_EXECUTION_FINISHED" | "VALIDATION_PASSED"; - /** @enum {string|null} */ - ack?: "IN_WEB_APP" | null; + testCaseElementId?: string; + } | null; + assertion?: { + /** Format: uuid */ + id?: string; + /** @enum {string} */ + expectation?: "VISIBLE" | "NOT_VISIBLE" | "TO_BE_CHECKED" | "NOT_TO_BE_CHECKED" | "TO_HAVE_VALUE" | "TO_CONTAIN_TEXT" | "TO_HAVE_STYLE"; + calledWith?: string | null; + /** Format: uuid */ + testCaseElementId?: string; + } | null; + selectors?: { + /** Format: uuid */ + id?: string; + index?: number; + selector?: string; + /** @enum {string} */ + selectorType?: "TEXT" | "LABEL" | "PLACEHOLDER" | "ROLE"; + options?: Record | null; + /** Format: uuid */ + testCaseElementId?: string; }[]; - }; - }; - /** @description Unauthorized - Invalid or missing API key */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Test target not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v1/private-location": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve all private locations - * @description gets a list of private location workers - */ - get: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["PrivateLocationInfo"]; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v1/private-location/register": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Register a private location - * @description registers a private location worker - */ - put: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["RegisterRequest"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SuccessResponse"]; - }; - }; - /** @description private location of that name not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v1/private-location/unregister": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - /** - * Unregister a private location - * @description Unregisters a private location worker. - */ - put: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UnregisterRequest"]; - }; - }; - responses: { - /** @description OK */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["SuccessResponse"]; - }; - }; - /** @description private location of that name not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}/code": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve code for a test case - * @description Get the code representation of a specific test case - */ - get: { - parameters: { - query: { - /** @description Optional ID of the environment to use for the test case code */ - environmentId?: string; - /** @description URL of the app to test */ - executionUrl: string; - }; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - /** @description The ID of the test case */ - testCaseId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Code for the test case */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** @description The code representation of the test case */ - testCode?: string; - }; - }; - }; - /** @description Test case not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/test-cases": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve test cases - * @description Get a list of test cases for a specific test target - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description List of test cases */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestCasesResponse"]; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/test-cases/{testCaseId}": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve a test case - * @description Get detailed information about a specific test case - */ - get: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - /** @description The ID of the test case */ - testCaseId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Test case details */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": components["schemas"]["TestCaseResponse"]; - }; - }; - /** @description Unauthorized - Invalid or missing API key */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Test target or test case not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/config": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** - * Retrieve test target configuration - * @description Get the configuration of a specific test target - */ - get: { - parameters: { - query: { - /** @description Optional ID of the environment to use for the test target configuration */ - environmentId?: string; - /** @description URL of the app to test */ - url: string; - /** @description Directory to write the playwright output to */ - outputDir: string; - /** @description Whether to run the test in headless mode */ - headless?: boolean; - }; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Test target configuration */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "text/plain": string; - }; - }; - }; - }; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - "/apiKey/v2/test-targets/{testTargetId}/discoveries": { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** - * Create a discovery - * @description Create a new test case discovery with a given name and prompt - */ - post: { - parameters: { - query?: never; - header?: never; - path: { - /** @description The ID of the test target */ - testTargetId: string; - }; - cookie?: never; - }; - requestBody: { - content: { - "application/json": { - /** - * @description Name of the discovery - * @example foo - */ - name: string; - /** - * @description The prompt describing what to discover - * @example make sure current time is visible - */ - prompt: string; - /** @description Optional URL path for the entry point */ - entryPointUrlPath?: string | null; + /** Format: uuid */ + testCaseId?: string; + ignoreFailure?: boolean; + }; + ExecutionContext: { /** - * Format: uuid - * @description Optional ID of a prerequisite test case + * @example github + * @enum {string} */ - prerequisiteId?: string | null; - /** @description Optional external identifier */ - externalId?: string | null; - /** @description Optional list of tag IDs to assign */ - assignedTagIds?: string[] | null; + source?: "github"; + /** @example 123 */ + issueNumber?: number | null; + /** @example refs/heads/main */ + ref?: string | null; + /** @example abc123def456 */ + sha?: string | null; + /** @example my-repo */ + repo?: string; + /** @example repo-owner */ + owner?: string; + triggeredBy?: { + /** + * @example USER + * @enum {string} + */ + type?: "USER"; + /** @example user123 */ + userId?: string; + } | null; + /** @example node-123 */ + nodeId?: string | null; + } | { /** - * Format: uuid - * @description Optional ID of the folder to place the discovery in - */ - folderId?: string | null; - }; - }; - }; - responses: { - /** @description Discovery created successfully */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - "application/json": { - /** - * Format: uuid - * @description The ID of the created discovery - */ - discoveryId: string; - /** - * Format: uuid - * @description The ID of the associated test case - */ - testCaseId: string; - }; - }; - }; - /** @description Invalid request body */ - 400: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Unauthorized - Invalid or missing API key */ - 401: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Test target not found */ - 404: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - }; - }; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; -} -export type webhooks = Record; -export interface components { - schemas: { - ExecutionContext: - | { - /** - * @example github - * @enum {string} - */ - source?: "github"; - /** @example 123 */ - issueNumber?: number | null; - /** @example refs/heads/main */ - ref?: string | null; - /** @example abc123def456 */ - sha?: string | null; - /** @example my-repo */ - repo?: string; - /** @example repo-owner */ - owner?: string; - triggeredBy?: { - /** - * @example USER + * @example azureDevOps * @enum {string} */ - type?: "USER"; - /** @example user123 */ - userId?: string; - } | null; - /** @example node-123 */ - nodeId?: string | null; - } - | { - /** - * @example azureDevOps - * @enum {string} - */ - source?: "azureDevOps"; - /** @example token123 */ - accessToken?: string; - /** @example my-org */ - organization?: string; - /** @example my-project */ - project?: string; - /** @example repo-123 */ - repositoryId?: string; - /** @example abc123def456 */ - sha?: string | null; - /** @example refs/heads/main */ - ref?: string | null; - /** @example 101 */ - pullRequestId?: number | null; - triggeredBy?: { - /** - * @example USER + source?: "azureDevOps"; + /** @example token123 */ + accessToken?: string; + /** @example my-org */ + organization?: string; + /** @example my-project */ + project?: string; + /** @example repo-123 */ + repositoryId?: string; + /** @example abc123def456 */ + sha?: string | null; + /** @example refs/heads/main */ + ref?: string | null; + /** @example 101 */ + pullRequestId?: number | null; + triggeredBy?: { + /** + * @example USER + * @enum {string} + */ + type?: "USER"; + /** @example user123 */ + userId?: string; + } | null; + /** @example thread-123 */ + threadId?: string | null; + } | { + /** + * @example discovery * @enum {string} */ - type?: "USER"; - /** @example user123 */ - userId?: string; - } | null; - /** @example thread-123 */ - threadId?: string | null; - } - | { - /** - * @example discovery - * @enum {string} - */ - source?: "discovery"; - /** @example A discovery test */ - description?: string; - triggeredBy?: - | { + source?: "discovery"; + /** @example A discovery test */ + description?: string; + triggeredBy?: { /** * @example INITIAL * @enum {string} */ type?: "INITIAL"; - } - | { + } | { + /** + * @example USER + * @enum {string} + */ + type?: "USER"; + /** @example user123 */ + userId?: string; + }; + } | { + /** + * @example manual + * @enum {string} + */ + source?: "manual"; + /** @example A manual trigger */ + description?: string; + triggeredBy?: { /** * @example USER * @enum {string} @@ -1193,59 +487,37 @@ export interface components { type?: "USER"; /** @example user123 */ userId?: string; - }; - } - | { - /** - * @example manual - * @enum {string} - */ - source?: "manual"; - /** @example A manual trigger */ - description?: string; - triggeredBy?: { - /** - * @example USER + }; + } | { + /** + * @example scheduled * @enum {string} */ - type?: "USER"; - /** @example user123 */ - userId?: string; - }; - } - | { - /** - * @example scheduled - * @enum {string} - */ - source?: "scheduled"; - triggeredBy?: { - /** - * @example USER + source?: "scheduled"; + triggeredBy?: { + /** + * @example USER + * @enum {string} + */ + type?: "USER"; + /** @example user123 */ + userId?: string; + } | null; + } | { + /** + * @example proposal * @enum {string} */ - type?: "USER"; - /** @example user123 */ - userId?: string; - } | null; - } - | { - /** - * @example proposal - * @enum {string} - */ - source?: "proposal"; - /** @example A proposal trigger */ - description?: string; - triggeredBy?: - | { + source?: "proposal"; + /** @example A proposal trigger */ + description?: string; + triggeredBy?: { /** * @example INITIAL * @enum {string} */ type?: "INITIAL"; - } - | { + } | { /** * @example USER * @enum {string} @@ -1253,596 +525,1796 @@ export interface components { type?: "USER"; /** @example user123 */ userId?: string; - }; - }; - /** - * @description The variables to overwrite exclusively for this test run. - * @example { - * "SPACE_ID": [ - * "64ee32b4-7365-47a6-b5b0-2903b6ad849d" - * ] - * } - */ - Variables: { - [key: string]: string[]; - }; - TestTargetExecutionRequest: { - /** - * Format: uuid - * @description Unique identifier for the testTarget. - * @example 2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc - */ - testTargetId: string; - /** - * Format: uri - * @description The URL of the test target for this run. - * @example https://example.com - */ - url: string; - context: components["schemas"]["ExecutionContext"]; - /** - * Format: environment name - * @description the environment name you want to run your test against - * @default default - */ - environmentName: string; - variablesToOverwrite?: components["schemas"]["Variables"]; - /** - * @default [] - * @example [ - * "tag1", - * "tag2" - * ] - */ - tags: string[]; - }; - TestTargetExecutionResponse: { - /** - * @description The URL the test target was executed. - * @example https://example.com - */ - testReportUrl?: string; - /** - * @description The test report from the run. - * @example some json - */ - testReport?: Record; - }; - TestReportContext: { - /** - * @description The source of the test trigger. - * @example manual - * @enum {string} - */ - source?: "manual"; - /** - * @description The description of the test context. - * @example manual trigger - */ - description?: string; - triggeredBy?: { - /** - * @description The type of entity triggering the test. - * @example USER - * @enum {string} - */ - type?: "USER"; + }; + }; /** - * Format: uuid - * @description The unique identifier of the user who triggered the test. - * @example 2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc + * @description The variables to overwrite exclusively for this test run. + * @example { + * "SPACE_ID": [ + * "64ee32b4-7365-47a6-b5b0-2903b6ad849d" + * ] + * } */ - userId?: string; - }; - }; - TestResult: { - /** - * Format: uuid - * @description Unique identifier for the test result. - * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 - */ - id?: string; - /** - * Format: uuid - * @description Unique identifier of the test report this result belongs to. - * @example 3435918b-3d29-4ebd-8c68-9a540532f45a - */ - testTargetId?: string; - /** - * Format: uuid - * @description Unique identifier of the test case this result belongs to. - * @example 5b844cf1-d597-4048-9e74-7c0f9ce3e2ee - */ - testCaseId?: string; - /** - * Format: date-time - * @description The timestamp when the test result was created. - * @example 2024-09-06T13:01:51.686Z - */ - createdAt?: string; - /** - * Format: date-time - * @description The timestamp when the test result was last updated. - * @example 2024-09-06T13:01:51.686Z - */ - updatedAt?: string; - /** - * @description The status of the specific test result, will be WAITING as long as the result is running, FAILED if the execution failed, PASSED if it succeeded, and ERROR if an internal error occurred. - * @enum {string} - */ - status?: "WAITING" | "PASSED" | "FAILED" | "ERROR"; - /** - * @description The error that has occurred during execution - only set if the status is FAILED or ERROR. - * @example TimeoutError: locator.click: Timeout 30000ms exceeded. - */ - errorMessage?: string | null; - /** - * @description Link to the playwright trace of the test execution - only set once the test result is finished (PASSED or FAILED). - * @example https://storage.googleapis.com/automagically-traces/826c15af-644b-4b28-89b4-f50ff34e46b7-trace.zip - */ - traceUrl?: string | null; - }; - TestReport: { - /** - * Format: uuid - * @description Unique identifier for the test report. - * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 - */ - id?: string; - /** - * Format: uuid - * @description The unique identifier of the test target. - * @example 3435918b-3d29-4ebd-8c68-9a540532f45a - */ - testTargetId?: string; - /** - * Format: date-time - * @description The timestamp when the test report was created. - * @example 2024-09-06T13:01:51.686Z - */ - createdAt?: string; - /** - * Format: date-time - * @description The timestamp when the test report was last updated. - * @example 2024-09-06T13:01:51.686Z - */ - updatedAt?: string; - /** - * Format: uri - * @description The URL where the test execution was performed. - * @example https://en.wikipedia.org/ - */ - executionUrl?: string; - /** - * @description The status of the test report, will be WAITING as long as any result is running, FAILED if the report is done but has any failed result and PASSED if all test results are done and successful - * @enum {string} - */ - status?: "WAITING" | "PASSED" | "FAILED"; - context?: components["schemas"]["TestReportContext"]; - testResults?: components["schemas"]["TestResult"][]; - }; - PrivateLocationInfo: { - /** @enum {string} */ - status: "OFFLINE" | "ONLINE"; - /** - * Format: uri - * @example https://example.com:3128 - */ - address: string; - /** @example my-private-location */ - name: string; - }[]; - TestReportResponse: { - /** - * Format: uri - * @description The URL where the test report can be accessed. - * @example https://app.octomind.dev/testreports/826c15af-644b-4b28-89b4-f50ff34e46b7 - */ - testReportUrl?: string; - testReport?: components["schemas"]["TestReport"]; - }; - TestCasesResponse: components["schemas"]["TestCaseResponse"][]; - TestCaseResponse: { - /** Format: uuid */ - id: string; - /** Format: uuid */ - testTargetId: string; - type?: string | null; - elements?: { - /** Format: uuid */ - id?: string; - index?: number; - interaction?: { - /** Format: uuid */ - id?: string; - /** @enum {string} */ - action?: - | "EXTRACT" - | "ENTER_TEXT" - | "CLICK" - | "SELECT_OPTION" - | "TYPE_TEXT" - | "KEY_PRESS" - | "HOVER" - | "UPLOAD" - | "GO_TO" - | "DRAG_AND_DROP" - | "CLOSE_PAGE" - | "OPEN_EMAIL"; - calledWith?: string | null; - /** Format: uuid */ - testCaseElementId?: string; - } | null; - assertion?: { - /** Format: uuid */ - id?: string; - /** @enum {string} */ - expectation?: - | "VISIBLE" - | "NOT_VISIBLE" - | "TO_BE_CHECKED" - | "NOT_TO_BE_CHECKED" - | "TO_HAVE_VALUE" - | "TO_CONTAIN_TEXT" - | "TO_HAVE_STYLE"; - calledWith?: string | null; - /** Format: uuid */ - testCaseElementId?: string; - } | null; - scrollState?: Record | null; - selectors?: { - /** Format: uuid */ - id?: string; - index?: number; - selector?: string; - /** @enum {string} */ - selectorType?: "TEXT" | "LABEL" | "PLACEHOLDER" | "ROLE"; - options?: { - name?: string; - } | null; - /** Format: uuid */ - testCaseElementId?: string; - scrollStateId?: string | null; - }[]; - /** Format: uuid */ - testCaseId?: string; - ignoreFailure?: boolean; - }[]; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - description?: string; - /** @enum {string} */ - status?: "ENABLED" | "DRAFT"; - externalId?: string | null; - entryPointUrlPath?: string | null; - tags?: string[]; - /** @enum {string} */ - createdBy?: "EDIT"; - /** @enum {string} */ - runStatus?: "ON" | "OFF"; - prerequisiteId?: string | null; - proposalRunId?: string | null; - folderId?: string | null; - discovery?: { - /** Format: uuid */ - id?: string; - freePrompt?: string; - traceUrl?: string | null; - traceJsonManifestUrl?: string | null; - /** @enum {string} */ - status?: "OUTDATED"; - abortCause?: string | null; - message?: string | null; - /** Format: uuid */ - testCaseId?: string; - lastJobExecutionName?: string | null; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - executedTestCaseElements?: string[]; - testCase?: { - /** Format: uuid */ - id?: string; - /** Format: uuid */ - testTargetId?: string; - description?: string; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - entryPointUrlPath?: string | null; - type?: string | null; - /** @enum {string} */ - status?: "ENABLED"; - /** @enum {string} */ - runStatus?: "ON"; - /** @enum {string} */ - interactionStatus?: "NEW"; - /** @enum {string} */ - createdBy?: "EDIT"; - proposalRunId?: string | null; - externalId?: string | null; - folderId?: string | null; - prerequisiteId?: string | null; - /** Format: uuid */ - predecessorId?: string; - testTarget?: { - /** Format: uuid */ + Variables: { + [key: string]: string[]; + }; + TestTargetExecutionRequest: { + /** + * Format: uuid + * @description Unique identifier for the testTarget. + * @example 2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc + */ + testTargetId: string; + /** + * Format: uri + * @description The URL of the test target for this run. + * @example https://example.com + */ + url: string; + context: components["schemas"]["ExecutionContext"]; + /** + * Format: environment name + * @description the environment name you want to run your test against + * @default default + */ + environmentName: string; + variablesToOverwrite?: components["schemas"]["Variables"]; + /** + * @default [] + * @example [ + * "tag1", + * "tag2" + * ] + */ + tags: string[]; + }; + TestReportContext: { + /** + * @description The source of the test trigger. + * @example manual + * @enum {string} + */ + source?: "github" | "azureDevOps" | "discovery" | "manual" | "scheduled" | "proposal"; + /** + * @description The description of the test context. + * @example manual trigger + */ + description?: string; + triggeredBy?: { + /** + * @description The type of entity triggering the test. + * @example USER + * @enum {string} + */ + type?: "USER"; + /** + * Format: uuid + * @description The unique identifier of the user who triggered the test. + * @example 2e2bb27b-a19c-47ce-a9b6-cd1bd31622dc + */ + userId?: string; + }; + }; + TestResult: { + /** + * Format: uuid + * @description Unique identifier for the test result. + * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 + */ id?: string; - app?: string; - /** Format: date-time */ + /** + * Format: uuid + * @description Unique identifier of the test report this result belongs to. + * @example 3435918b-3d29-4ebd-8c68-9a540532f45a + */ + testTargetId?: string; + /** + * Format: uuid + * @description Unique identifier of the test case this result belongs to. + * @example 5b844cf1-d597-4048-9e74-7c0f9ce3e2ee + */ + testCaseId?: string; + /** + * Format: date-time + * @description The timestamp when the test result was created. + * @example 2024-09-06T13:01:51.686Z + */ createdAt?: string; - /** Format: date-time */ + /** + * Format: date-time + * @description The timestamp when the test result was last updated. + * @example 2024-09-06T13:01:51.686Z + */ updatedAt?: string; - /** Format: uuid */ - orgId?: string; - testIdAttribute?: string | null; - timeoutPerStep?: number; - }; + /** + * @description The status of the specific test result, will be WAITING as long as the result is running, FAILED if the execution failed, PASSED if it succeeded, and ERROR if an internal error occurred. + * @enum {string} + */ + status?: "WAITING" | "PASSED" | "FAILED" | "ERROR"; + /** + * @description The error that has occurred during execution - only set if the status is FAILED or ERROR. + * @example TimeoutError: locator.click: Timeout 30000ms exceeded. + */ + errorMessage?: string | null; + /** + * @description Link to the playwright trace of the test execution - only set once the test result is finished (PASSED or FAILED). + * @example https://storage.googleapis.com/automagically-traces/826c15af-644b-4b28-89b4-f50ff34e46b7-trace.zip + */ + traceUrl?: string | null; + }; + TestReport: { + /** + * Format: uuid + * @description Unique identifier for the test report. + * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 + */ + id?: string; + /** + * Format: uuid + * @description The unique identifier of the test target. + * @example 3435918b-3d29-4ebd-8c68-9a540532f45a + */ + testTargetId?: string; + /** + * Format: date-time + * @description The timestamp when the test report was created. + * @example 2024-09-06T13:01:51.686Z + */ + createdAt?: string; + /** + * Format: date-time + * @description The timestamp when the test report was last updated. + * @example 2024-09-06T13:01:51.686Z + */ + updatedAt?: string; + /** + * Format: uri + * @description The URL where the test execution was performed. + * @example https://en.wikipedia.org/ + */ + executionUrl?: string; + /** + * @description The status of the test report, will be WAITING as long as any result is running, FAILED if the report is done but has any failed result and PASSED if all test results are done and successful + * @enum {string} + */ + status?: "WAITING" | "PASSED" | "FAILED"; + context?: components["schemas"]["TestReportContext"]; + testResults?: components["schemas"]["TestResult"][]; + }; + PrivateLocationInfo: { + /** @enum {string} */ + status: "OFFLINE" | "ONLINE"; + /** + * Format: uri + * @example https://example.com:3128 + */ + address: string; + /** @example my-private-location */ + name: string; + }[]; + TestExecutionResponse: { + /** + * Format: uri + * @description The URL where the test report can be accessed. + * @example https://app.octomind.dev/testreports/826c15af-644b-4b28-89b4-f50ff34e46b7 + */ + testReportUrl?: string; + testReport?: components["schemas"]["TestReport"]; + }; + TestCasesResponse: components["schemas"]["TestCaseResponse"][]; + TestCaseResponse: { + /** Format: uuid */ + id: string; + /** Format: uuid */ + testTargetId: string; + type?: string | null; + elements?: { + /** Format: uuid */ + id?: string; + index?: number; + interaction?: { + /** Format: uuid */ + id?: string; + /** @enum {string} */ + action?: "EXTRACT" | "ENTER_TEXT" | "CLICK" | "SELECT_OPTION" | "TYPE_TEXT" | "KEY_PRESS" | "HOVER" | "UPLOAD" | "GO_TO" | "DRAG_AND_DROP" | "CLOSE_PAGE" | "OPEN_EMAIL"; + calledWith?: string | null; + /** Format: uuid */ + testCaseElementId?: string; + } | null; + assertion?: { + /** Format: uuid */ + id?: string; + /** @enum {string} */ + expectation?: "VISIBLE" | "NOT_VISIBLE" | "TO_BE_CHECKED" | "NOT_TO_BE_CHECKED" | "TO_HAVE_VALUE" | "TO_CONTAIN_TEXT" | "TO_HAVE_STYLE"; + calledWith?: string | null; + /** Format: uuid */ + testCaseElementId?: string; + } | null; + scrollState?: Record | null; + selectors?: { + /** Format: uuid */ + id?: string; + index?: number; + selector?: string; + /** @enum {string} */ + selectorType?: "TEXT" | "LABEL" | "PLACEHOLDER" | "ROLE"; + options?: { + name?: string; + } | null; + /** Format: uuid */ + testCaseElementId?: string; + scrollStateId?: string | null; + }[]; + /** Format: uuid */ + testCaseId?: string; + ignoreFailure?: boolean; + }[]; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + description?: string; + /** @enum {string} */ + status?: "ENABLED" | "DRAFT"; + externalId?: string | null; + entryPointUrlPath?: string | null; + tags?: string[]; + /** @enum {string} */ + createdBy?: "EDIT"; + /** @enum {string} */ + runStatus?: "ON" | "OFF"; + prerequisiteId?: string | null; + proposalRunId?: string | null; + folderId?: string | null; + discovery?: { + /** Format: date-time */ + updatedAt?: string; + freePrompt?: string; + traceUrl?: string | null; + /** @enum {string} */ + status?: "CREATED" | "IN_PROGRESS" | "ERROR" | "SUCCESS" | "FAILED" | "INCOMPLETE" | "QUEUED" | "STOPPED" | "OUTDATED" | "PAUSED"; + abortCause?: string | null; + message?: string | null; + } | null; + }; + SuccessResponse: { + /** + * @description Indicates whether the operation was successful. + * @example true + */ + success?: boolean; + }; + UnregisterRequest: { + name?: string; + }; + RegisterRequest: { + name?: string; + registrationData?: { + /** @example secret22 */ + proxypass?: string; + /** @example user */ + proxyuser?: string; + /** + * @description the address of the remote endpoint. IP and port + * @example 34.45.23.22:23455 + */ + address?: string; + }; + }; + EnvironmentsResponse: components["schemas"]["EnvironmentResponse"][]; + EnvironmentSimpleResponse: { + /** Format: uuid */ + id?: string; + /** + * @example DEFAULT + * @enum {string} + */ + type?: "DEFAULT" | "ADDITIONAL"; + /** + * Format: url + * @example https://example.com + */ + discoveryUrl?: string; + /** + * @description The 2FA email of the environment to test email flows. + * @example user@example.com + */ + email?: string; + }; + EnvironmentResponse: { + /** Format: uuid */ + id: string; + /** + * @example DEFAULT + * @enum {string} + */ + name: "DEFAULT" | "ADDITIONAL"; + /** Format: uuid */ + testTargetId: string; + /** Format: date-time */ + updatedAt?: string; + /** + * @example DEFAULT + * @enum {string} + */ + type: "DEFAULT" | "ADDITIONAL"; + /** Format: url */ + discoveryUrl?: string; + additionalHeaderFields?: { + [key: string]: string; + } | null; + testAccount?: { + username?: string; + password?: string; + otpInitializerKey?: string | null; + /** Format: date-time */ + updatedAt?: string; + } | null; + basicAuth?: { + username?: string; + password?: string; + /** Format: date-time */ + updatedAt?: string; + } | null; + privateLocation?: { + /** Format: uuid */ + id?: string; + name?: string; + status?: string; + type?: string; + }; + }; + TestSuiteRequestCommons: { + /** + * Format: uuid + * @description The test case to run before all test cases + */ + beforeAll?: string | null; + /** + * Format: uuid + * @description The test case to run after all test cases + */ + afterAll?: string | null; + /** + * Format: uuid + * @description The test case to run before each test case in the suite + */ + beforeEach?: string | null; + /** + * Format: uuid + * @description The test case to run after each test case in the suite + */ + afterEach?: string | null; + }; + TestSuitePatchRequest: { + /** + * @description The name of the test suite + * @example regression for chat + */ + name?: string | null; + /** + * @description The test cases to include in the suite + * @example [ + * "5b844cf1-d597-4048-9e74-7c0f9ce3e2ee" + * ] + */ + testCases?: string[] | null; + /** + * @description the environment name you want to run your test suite against + * @example default + */ + environmentName?: string | null; + } & components["schemas"]["TestSuiteRequestCommons"]; + TestSuiteCreateRequest: { + /** + * @description The name of the test suite + * @example regression for chat + */ + name?: string; + /** + * @description The test cases to include in the suite + * @example [ + * "5b844cf1-d597-4048-9e74-7c0f9ce3e2ee" + * ] + */ + testCases?: string[]; + /** + * @description the environment name you want to run your test suite against + * @example default + */ + environmentName?: string; + } & components["schemas"]["TestSuiteRequestCommons"]; + TestSuiteResponse: { + /** Format: uuid */ + id?: string; + } & components["schemas"]["TestSuiteCreateRequest"]; + TestSuitesResponse: components["schemas"]["TestSuiteResponse"][]; + CreateTestTargetBody: { + testTarget?: { + /** @description The app name or project name of the test target */ + app: string; + /** + * Format: uri + * @description The discovery URL of the test target. This is the URL that a discovery tool can use to discover the test target. + */ + discoveryUrl: string; + }; + }; + TestTargetsResponse: components["schemas"]["TestTargetResponse"][]; + TestTargetResponse: { + /** Format: uuid */ + id?: string; + /** @description The app name or project name of the test target */ + app?: string; + tags?: (string | null)[]; + /** @description The environments of the test target */ + environments?: components["schemas"]["EnvironmentSimpleResponse"][]; + }; + TestTargetUpdateRequest: { + /** @description The app name or project name of the test target */ + app?: string | null; + /** + * Format: uri + * @description The discovery URL of the test target + */ + discoveryUrl?: string | null; + /** + * @description The attribute name of the test ID + * @example test-automation-id + */ + testIdAttribute?: string | null; + testRailIntegration?: { + /** + * @description The domain of the TestRail instance + * @example https://mycompany.testrail.io + */ + domain?: string; + /** + * @description The username for the TestRail instance + * @example user + */ + username?: string; + /** + * @description The project ID for the TestRail instance + * @example 123 + */ + projectId?: string; + /** + * @description The TestRail API key for the TestRail instance + * @example 123123123 + */ + apiKey?: string; + } | null; + /** + * Format: int32 + * @description The timeout per step in milliseconds + */ + timeoutPerStep?: number; + }; + ZodResponse: { + /** + * @description What error code happened while parsing the request + * @example invalid_type + */ + code?: string; + /** + * @description What the expected type was + * @example object + */ + expected?: string; + /** + * @description What the actual passed type was + * @example string + */ + received?: string; + path?: string[]; + /** + * @description Human-readable message of the error that occurred while parsing. + * @example Expected object, received string + */ + message?: string; + }[]; + Notification: { + /** + * Format: uuid + * @description Unique identifier for the event. + * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 + */ + id: string; + /** + * Format: uuid + * @description The unique identifier of the test target this event belongs to. + * @example 3435918b-3d29-4ebd-8c68-9a540532f45a + */ + testTargetId: string; + /** + * Format: date-time + * @description The timestamp when the event was created. + * @example 2024-09-06T13:01:51.686Z + */ + createdAt: string; + /** + * Format: date-time + * @description The timestamp when the event was last updated. + * @example 2024-09-06T13:01:51.686Z + */ + updatedAt: string; + /** + * @description JSON payload containing event-specific data. + * @example { + * "testCaseId": "5deeef76-f37a-418b-8101-7d69529fa561" + * } + */ + payload: Record; + /** + * @description The type of event that occurred. + * @example VALIDATION_PASSED + * @enum {string} + */ + type: "VALIDATION_PASSED" | "VALIDATION_FAILED" | "DISCOVERY_FINISHED" | "PROPOSAL_SUCCESS" | "PROPOSAL_FAILED" | "REPORT_EXECUTION_FINISHED"; + /** + * @description Optional acknowledgment status of the event. + * @example IN_WEB_APP + * @enum {string|null} + */ + ack?: "IN_WEB_APP" | null; + }; + ExternalDiscoveryBody: { + /** + * @description Name of the discovered test case + * @example Login Form Validation Test + */ + name: string; + /** + * @description Entry point URL path of the discovered test case + * @example /login + */ + entryPointUrlPath?: string; + /** + * @description Prerequisite test case name + * @example Cookie Banner Acceptance + */ + prerequisiteName?: string; + /** + * @description External ID of the discovered test case + * @example ext-test-001 + */ + externalId?: string; + /** + * @description Tags to assign to the discovered test case + * @example [ + * "authentication", + * "forms", + * "validation" + * ] + */ + tagNames?: string[]; + /** + * @description Prompt to generate the discovered test case + * @example Test the login form with valid and invalid credentials + */ + prompt: string; + /** + * @description Folder name of the discovered test case + * @example Authentication Tests + */ + folderName?: string; + /** + * @description Type of the discovered test case + * @example LOGIN + * @enum {string} + */ + type?: "LOGIN" | "COOKIE_BANNER"; + }; + DiscoveryResponse: { + /** Format: uuid */ + discoveryId?: string; + /** Format: uuid */ + testCaseId?: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} +export type $defs = Record; +export interface operations { + getTestTargets: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestTargetsResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + createTestTarget: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CreateTestTargetBody"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestTargetResponse"][]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getTestTarget: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to fetch */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestTargetResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + deleteTestTarget: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to delete */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; }; - }; - }; - SuccessResponse: { - /** - * @description Indicates whether the operation was successful. - * @example true - */ - success?: boolean; - }; - UnregisterRequest: { - name?: string; - }; - RegisterRequest: { - name?: string; - registrationData?: { - /** @example secret22 */ - proxypass?: string; - /** @example user */ - proxyuser?: string; - /** - * @description the address of the remote endpoint. IP and port - * @example 34.45.23.22:23455 - */ - address?: string; - }; - }; - EnvironmentsResponse: components["schemas"]["EnvironmentResponse"][]; - EnvironmentResponse: { - /** Format: uuid */ - id: string; - name: string; - /** Format: uuid */ - testTargetId: string; - /** Format: date-time */ - updatedAt?: string; - type: string; - /** Format: url */ - discoveryUrl?: string; - additionalHeaderFields?: { - [key: string]: string; - } | null; - testAccount?: { - username?: string; - password?: string; - otpInitializerKey?: string | null; - /** Format: date-time */ - updatedAt?: string; - } | null; - basicAuth?: { - username?: string; - password?: string; - /** Format: date-time */ - updatedAt?: string; - } | null; - privateLocation?: { - /** Format: uuid */ - id?: string; - name?: string; - status?: string; - type?: string; - }; - }; - TestSuiteRequestCommons: { - /** - * Format: uuid - * @description The test case to run before all test cases - */ - beforeAll?: string | null; - /** - * Format: uuid - * @description The test case to run after all test cases - */ - afterAll?: string | null; - /** - * Format: uuid - * @description The test case to run before each test case in the suite - */ - beforeEach?: string | null; - /** - * Format: uuid - * @description The test case to run after each test case in the suite - */ - afterEach?: string | null; }; - TestSuitePatchRequest: { - /** - * @description The name of the test suite - * @example regression for chat - */ - name?: string | null; - /** - * @description The test cases to include in the suite - * @example [ - * "5b844cf1-d597-4048-9e74-7c0f9ce3e2ee" - * ] - */ - testCases?: string[] | null; - /** - * @description the environment name you want to run your test suite against - * @example default - */ - environmentName?: string | null; - } & components["schemas"]["TestSuiteRequestCommons"]; - TestSuiteCreateRequest: { - /** - * @description The name of the test suite - * @example regression for chat - */ - name?: string; - /** - * @description The test cases to include in the suite - * @example [ - * "5b844cf1-d597-4048-9e74-7c0f9ce3e2ee" - * ] - */ - testCases?: string[]; - /** - * @description the environment name you want to run your test suite against - * @example default - */ - environmentName?: string; - } & components["schemas"]["TestSuiteRequestCommons"]; - TestSuiteResponse: { - /** Format: uuid */ - id?: string; - } & components["schemas"]["TestSuiteCreateRequest"]; - TestSuitesResponse: components["schemas"]["TestSuiteResponse"][]; - ZodResponse: { - /** - * @description What error code happened while parsing the request - * @example invalid_type - */ - code?: string; - /** - * @description What the expected type was - * @example object - */ - expected?: string; - /** - * @description What the actual passed type was - * @example string - */ - received?: string; - path?: string[]; - /** - * @description Human-readable message of the error that occurred while parsing. - * @example Expected object, received string - */ - message?: string; - }[]; - Notification: { - /** - * Format: uuid - * @description Unique identifier for the event. - * @example 826c15af-644b-4b28-89b4-f50ff34e46b7 - */ - id: string; - /** - * Format: uuid - * @description The unique identifier of the test target this event belongs to. - * @example 3435918b-3d29-4ebd-8c68-9a540532f45a - */ - testTargetId: string; - /** - * Format: date-time - * @description The timestamp when the event was created. - * @example 2024-09-06T13:01:51.686Z - */ - createdAt: string; - /** - * Format: date-time - * @description The timestamp when the event was last updated. - * @example 2024-09-06T13:01:51.686Z - */ - updatedAt: string; - /** - * @description JSON payload containing event-specific data. - * @example { - * "testCaseId": "5deeef76-f37a-418b-8101-7d69529fa561" - * } - */ - payload: Record; - /** - * @description The type of event that occurred. - * @example VALIDATION_PASSED - * @enum {string} - */ - type: - | "VALIDATION_PASSED" - | "VALIDATION_FAILED" - | "DISCOVERY_FINISHED" - | "PROPOSAL_SUCCESS" - | "PROPOSAL_FAILED" - | "REPORT_EXECUTION_FINISHED"; - /** - * @description Optional acknowledgment status of the event. - * @example IN_WEB_APP - * @enum {string|null} - */ - ack?: "IN_WEB_APP" | null; + updateTestTarget: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to update */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TestTargetUpdateRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestTargetResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; }; - ExternalDiscoveryBody: { - /** - * @description Name of the discovered test case - * @example Login Form Validation Test - */ - name: string; - /** - * @description Entry point URL path of the discovered test case - * @example /login - */ - entryPointUrlPath?: string; - /** - * @description Prerequisite test case name - * @example Cookie Banner Acceptance - */ - prerequisiteName?: string; - /** - * @description External ID of the discovered test case - * @example ext-test-001 - */ - externalId?: string; - /** - * @description Tags to assign to the discovered test case - * @example [ - * "authentication", - * "forms", - * "validation" - * ] - */ - tagNames?: string[]; - /** - * @description Prompt to generate the discovered test case - * @example Test the login form with valid and invalid credentials - */ - prompt: string; - /** - * @description Folder name of the discovered test case - * @example Authentication Tests - */ - folderName?: string; - /** - * @description Type of the discovered test case - * @example LOGIN - * @enum {string} - */ - type?: "LOGIN" | "COOKIE_BANNER"; + executeTests: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TestTargetExecutionRequest"]; + }; + }; + responses: { + /** @description Test executed successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestExecutionResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; }; - DiscoveryResponse: { - /** Format: uuid */ - discoveryId?: string; - /** Format: uuid */ - testCaseId?: string; + getTestTargetConfig: { + parameters: { + query: { + /** @description The execution URL for the test target */ + url: string; + /** @description The directory where test output will be stored */ + outputDir: string; + /** @description Whether to run tests in headless mode (true/false) */ + headless?: string; + /** @description Optional ID of the environment to use (defaults to the test target's default environment if not provided) */ + environmentId?: string; + }; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test target configuration retrieved successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Environment not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Method not allowed */ + 405: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getEnvironments: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to which the test report belongs to */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description environments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["EnvironmentsResponse"]; + }; + }; + }; + }; + createEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to which the environment belongs to */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string; + /** Format: url */ + discoveryUrl?: string; + testAccount?: { + username?: string; + password?: string; + otpInitializerKey?: string | null; + } | null; + basicAuth?: { + username?: string; + password?: string; + } | null; + /** @description name of the private location */ + privateLocationName?: string; + additionalHeaderFields?: { + [key: string]: string; + } | null; + }; + }; + }; + responses: { + /** @description environment created */ + 201: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["EnvironmentResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + deleteEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to which the test report belongs to */ + testTargetId: string; + /** @description ID of the environment to update */ + environmentId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Environment deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + updateEnvironment: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to which the environment belongs to */ + testTargetId: string; + /** @description ID of the environment to update */ + environmentId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + name?: string | null; + /** Format: url */ + discoveryUrl?: string | null; + testAccount?: { + username?: string; + password?: string; + otpInitializerKey?: string | null; + } | null; + basicAuth?: { + username?: string; + password?: string; + } | null; + /** @description name of the private location */ + privateLocationName?: string | null; + additionalHeaderFields?: { + [key: string]: string; + } | null; + }; + }; + }; + responses: { + /** @description Environment updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["EnvironmentResponse"]; + }; + }; + }; + }; + getTestReport: { + parameters: { + query?: never; + header?: never; + path: { + /** @description ID of the test target to which the test report belongs to */ + testTargetId: string; + /** @description ID of the test report to fetch */ + testReportId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test Report information */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + /** @example { + * "id": "826c15af-644b-4b28-89b4-f50ff34e46b7", + * "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "createdAt": "2024-09-06T13:01:51.686Z", + * "updatedAt": "2024-09-06T13:05:23.412Z", + * "executionUrl": "https://en.wikipedia.org/", + * "status": "FAILED", + * "context": { + * "source": "github", + * "issueNumber": 123, + * "ref": "refs/heads/main", + * "sha": "abc123def456", + * "repo": "my-repo", + * "owner": "repo-owner", + * "triggeredBy": { + * "type": "USER", + * "userId": "3435918b-3d29-4ebd-8c68-9a540532f45a" + * }, + * "nodeId": "node-123" + * }, + * "testResults": [ + * { + * "id": "9876fedc-ba98-7654-3210-fedcba987654", + * "testCaseId": "9876fedc-ba98-7654-3210-fedcba987654", + * "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "testReportId": "826c15af-644b-4b28-89b4-f50ff34e46b7", + * "name": "User can search for information", + * "createdAt": "2024-09-06T13:01:51.686Z", + * "updatedAt": "2024-09-06T13:03:12.345Z", + * "status": "PASSED", + * "errorMessage": null, + * "traceUrl": "https://storage.googleapis.com/automagically-traces/7a1b2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p-trace.zip" + * }, + * { + * "id": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "testCaseId": "5432fedc-ba98-7654-3210-fedcba543210", + * "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "testReportId": "826c15af-644b-4b28-89b4-f50ff34e46b7", + * "name": "User can navigate to article", + * "createdAt": "2024-09-06T13:01:51.686Z", + * "updatedAt": "2024-09-06T13:04:45.678Z", + * "status": "FAILED", + * "errorMessage": "TimeoutError: locator.click: Timeout 30000ms exceeded.", + * "traceUrl": "https://storage.googleapis.com/automagically-traces/2a3b4c5d-6e7f-8g9h-0i1j-2k3l4m5n6o7p-trace.zip" + * }, + * { + * "id": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "testCaseId": "1234abcd-ef56-7890-abcd-ef1234567890", + * "testTargetId": "3435918b-3d29-4ebd-8c68-9a540532f45a", + * "testReportId": "826c15af-644b-4b28-89b4-f50ff34e46b7", + * "name": "User can create an account", + * "createdAt": "2024-09-06T13:01:51.686Z", + * "updatedAt": "2024-09-06T13:05:23.412Z", + * "status": "WAITING", + * "errorMessage": null, + * "traceUrl": null + * } + * ] + * } */ + "application/json": components["schemas"]["TestReport"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getTestReports: { + parameters: { + query?: { + key?: { + /** + * Format: date-time + * @description The timestamp of the key of the next page to fetch - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) + * @example 2024-09-06T13:01:51.686Z + */ + createdAt?: string; + }; + filter?: { + /** + * @description The name of the property to filter for, e.g. an environmentId + * @example environmentId + */ + key?: string; + /** + * @description How to compare the property in question, only EQUALS is supported so far. + * @enum {string} + */ + operator?: "EQUALS"; + /** + * Format: uuid + * @description The value to compare with to find matches. + * @example 3435918b-3d29-4ebd-8c68-9a540532f45a + */ + value?: string; + }[]; + }; + header?: never; + path: { + /** @description ID of the test target for which to fetch the history for */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test Reports information */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + data?: components["schemas"]["TestReport"][]; + key?: { + /** + * Format: date-time + * @description The timestamp of the key of the next page to fetch - use this in the query when fetching the next page of reports - See [Keyset Pagination](https://use-the-index-luke.com/no-offset) + * @example 2024-09-06T13:01:51.686Z + */ + createdAt?: string; + }; + /** @description If the query in question has another page to retrieve */ + hasNextPage?: boolean; + }; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getNotifications: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description List of notifications */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + /** Format: uuid */ + testTargetId?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + payload?: { + failed?: boolean; + context?: components["schemas"]["ExecutionContext"]; + /** Format: uuid */ + testReportId?: string; + /** Format: uuid */ + testCaseId?: string; + }; + /** @enum {string} */ + type?: "REPORT_EXECUTION_FINISHED" | "VALIDATION_PASSED"; + /** @enum {string|null} */ + ack?: "IN_WEB_APP" | null; + }[]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getPrivateLocations: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["PrivateLocationInfo"]; + }; + }; + }; + }; + registerPrivateLocation: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["RegisterRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SuccessResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description private location of that name not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + unregisterPrivateLocation: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["UnregisterRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["SuccessResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description private location of that name not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getTestCases: { + parameters: { + query?: { + /** + * @description JSON string containing filter criteria for test cases. The filter supports the following fields: + * - id: Filter by test case ID + * - testTargetId: Filter by test target ID + * - description: Filter by test case description + * - status: Filter by test case status (ENABLED, DISABLED, DRAFT, OUTDATED, PROVISIONAL) + * - runStatus: Filter by run status (ON, OFF) + * - folderId: Filter by folder ID + * - externalId: Filter by external ID + * - AND: Logical AND operator for combining multiple conditions + * - OR: Logical OR operator for combining multiple conditions + * - NOT: Logical NOT operator for negating conditions + * + * @example {"status":"ENABLED","folderId":"some-folder-id","OR":[{"description":"Login Test"},{"externalId":"TEST-123"}]} + */ + filter?: string; + }; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description List of test cases */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestCasesResponse"]; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getTestCase: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + /** @description The ID of the test case */ + testCaseId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test case details */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["TestCaseResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target or test case not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + getTestCaseCode: { + parameters: { + query: { + /** @description URL of the app to test */ + executionUrl: string; + /** @description Optional ID of the environment to use */ + environmentId?: string; + }; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + /** @description The ID of the test case */ + testCaseId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Test case code retrieved successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** @description The code representation of the test case */ + testCode: string; + }; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target, test case, or test code not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + patchTestCase: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + /** @description The ID of the test case to update */ + testCaseId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + elements?: components["schemas"]["TestCaseElement"][]; + description?: string; + entryPointUrlPath?: string | null; + /** @enum {string} */ + status?: "ENABLED" | "DISABLED" | "DRAFT" | "OUTDATED" | "PROVISIONAL"; + /** @enum {string} */ + runStatus?: "ON" | "OFF"; + folderName?: string | null; + /** @enum {string} */ + interactionStatus?: "NEW" | "EDITED" | "APPROVED" | "REJECTED"; + createBackendDiscoveryPrompt?: string; + assignedTagNames?: string[]; + externalId?: string | null; + }; + }; + }; + responses: { + /** @description Updated test case */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: uuid */ + id?: string; + /** Format: uuid */ + testTargetId?: string; + description?: string; + /** @enum {string} */ + status?: "ENABLED" | "DISABLED" | "DRAFT" | "OUTDATED" | "PROVISIONAL"; + /** @enum {string} */ + runStatus?: "ON" | "OFF"; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + entryPointUrlPath?: string | null; + elements?: Record[]; + folderId?: string | null; + externalId?: string | null; + tags?: string[]; + }; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test case, folder or tag not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + createDiscovery: { + parameters: { + query?: never; + header?: never; + path: { + /** @description The ID of the test target */ + testTargetId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * @description A descriptive name for the discovery that clearly identifies its purpose. This will be displayed in the UI and used for reference. + * @example Login Flow Validation + */ + name: string; + /** + * @description Detailed instructions for what should be discovered and validated. Be specific about the functionality, conditions, or behaviors to test. + * @example Verify that users can successfully log in with valid credentials and see their dashboard. + */ + prompt: string; + /** + * @description The specific URL path where the test should begin execution. For example, '/login' for authentication tests or '/dashboard' for dashboard features. + * @example /login + */ + entryPointUrlPath?: string | null; + /** + * @description Name of another test case that must be executed before this discovery. The system will resolve this to the appropriate test case within the same test target. + * @example Login Test + */ + prerequisiteName?: string | null; + /** + * @description Custom identifier to link this discovery with external systems or tracking tools. Can be used for integration with issue trackers or test management systems. + * @example JIRA-1234 + */ + externalId?: string | null; + /** + * @description List of tags to categorize and organize the discovery. Tags help in filtering and grouping related test cases (e.g., 'authentication', 'critical-path', 'regression'). + * @example [ + * "authentication", + * "critical-path", + * "smoke-test" + * ] + */ + tagNames?: string[] | null; + /** + * @description Name of the organizational folder where this discovery should be stored. Helps in maintaining a structured test hierarchy (e.g., 'Authentication Tests', 'User Management'). + * @example Authentication Tests + */ + folderName?: string | null; + /** + * @description Type of the test case to discover (e.g., 'LOGIN', 'COOKIE_BANNER'). + * @example LOGIN + * @enum {string|null} + */ + type?: "LOGIN" | "COOKIE_BANNER" | null; + }; + }; + }; + responses: { + /** @description Discovery created successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** + * Format: uuid + * @description The ID of the created discovery + */ + discoveryId: string; + /** + * Format: uuid + * @description The ID of the associated test case + */ + testCaseId: string; + }; + }; + }; + /** @description Invalid request parameters */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["ZodResponse"]; + }; + }; + /** @description Unauthorized - Invalid or missing API key */ + 401: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Test target not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; } -export type $defs = Record; -export type operations = Record; diff --git a/src/tools.ts b/src/tools.ts index 2115e89..18fce82 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -46,7 +46,7 @@ const authMiddleware: Middleware = { const { apiKey } = await loadConfig(); if (!apiKey) { throw new Error( - "API key is required. Please configure it first by running 'octomind init'" + "API key is required. Please configure it first by running 'octomind init'", ); } request.headers.set("x-api-key", apiKey); @@ -59,7 +59,7 @@ const authMiddleware: Middleware = { const errorBody = await res.json(); return new Response( `${response.status}, ${response.statusText}: ${errorBody ? JSON.stringify(errorBody, null, 2) : ""}`, - { ...resOptions, status: response.status } + { ...resOptions, status: response.status }, ); } return response; @@ -79,7 +79,7 @@ const handleError = (error: ErrorResponse) => { }; export const listEnvironments = async ( - options: listEnvironmentsOptions & { json?: boolean } + options: listEnvironmentsOptions & { json?: boolean }, ): Promise => { const { data, error } = await client.GET( "/apiKey/v2/test-targets/{testTargetId}/environments", @@ -87,7 +87,7 @@ export const listEnvironments = async ( params: { path: { testTargetId: options.testTargetId }, }, - } + }, ); handleError(error); @@ -109,7 +109,7 @@ export const listEnvironments = async ( }; export const getEnvironments = async ( - options: listEnvironmentsOptions & { json?: boolean } + options: listEnvironmentsOptions & { json?: boolean }, ): Promise => { const { data, error } = await client.GET( "/apiKey/v2/test-targets/{testTargetId}/environments", @@ -117,7 +117,7 @@ export const getEnvironments = async ( params: { path: { testTargetId: options.testTargetId }, }, - } + }, ); handleError(error); @@ -138,7 +138,7 @@ const outputResult = (result: unknown): void => { }; export const executeTests = async ( - options: executeTestsBody & { json?: boolean; description?: string } + options: executeTestsBody & { json?: boolean; description?: string }, ): Promise => { const { data, error } = await client.POST("/apiKey/v2/execute", { body: { @@ -186,7 +186,7 @@ export const executeTests = async ( }; export const getTestReport = async ( - options: getTestReportParams & { json?: boolean } + options: getTestReportParams & { json?: boolean }, ): Promise => { const { data, error } = await client.GET( "/apiKey/v2/test-targets/{testTargetId}/test-reports/{testReportId}", @@ -197,7 +197,7 @@ export const getTestReport = async ( testReportId: options.testReportId, }, }, - } + }, ); handleError(error); @@ -244,7 +244,7 @@ export const registerLocation = async (options: { password: options.password, }, }, - } + }, ); handleError(error); @@ -269,7 +269,7 @@ export const unregisterLocation = async (options: { body: { name: options.name, }, - } + }, ); handleError(error); @@ -282,7 +282,7 @@ export const unregisterLocation = async (options: { console.log( "Unregistration result:", - response.success ? "Success" : "Failed" + response.success ? "Success" : "Failed", ); }; @@ -316,7 +316,7 @@ export const createEnvironment = async ( basicAuthPassword?: string; privateLocationName?: string; testAccountOtpInitializerKey?: string; - } + }, ): Promise => { const { data, error } = await client.POST( "/apiKey/v2/test-targets/{testTargetId}/environments", @@ -339,7 +339,7 @@ export const createEnvironment = async ( privateLocationName: options.privateLocationName, additionalHeaderFields: options.additionalHeaderFields, }, - } + }, ); handleError(error); @@ -369,7 +369,7 @@ export const updateEnvironment = async ( basicAuthPassword?: string; privateLocationName?: string; testAccountOtpInitializerKey?: string; - } + }, ): Promise => { const { data, error } = await client.PATCH( "/apiKey/v2/test-targets/{testTargetId}/environments/{environmentId}", @@ -394,7 +394,7 @@ export const updateEnvironment = async ( }, privateLocationName: options.privateLocationName, }, - } + }, ); handleError(error); @@ -427,7 +427,7 @@ export const deleteEnvironment = async (options: { environmentId: options.environmentId, }, }, - } + }, ); handleError(error); @@ -441,7 +441,7 @@ export const deleteEnvironment = async (options: { }; export const getNotifications = async ( - options: getNotificationsParams & { json?: boolean } + options: getNotificationsParams & { json?: boolean }, ): Promise => { const { data, error } = await client.GET( "/apiKey/v2/test-targets/{testTargetId}/notifications", @@ -451,7 +451,7 @@ export const getNotifications = async ( testTargetId: options.testTargetId, }, }, - } + }, ); handleError(error); @@ -482,7 +482,7 @@ export const getNotifications = async ( }; export const getTestCase = async ( - options: getTestCaseParams & { json?: boolean } + options: getTestCaseParams & { json?: boolean }, ): Promise => { console.log(options); const { data, error } = await client.GET( @@ -494,7 +494,7 @@ export const getTestCase = async ( testCaseId: options.testCaseId, }, }, - } + }, ); handleError(error); @@ -542,7 +542,7 @@ export const getTestCase = async ( }; export const createDiscovery = async ( - options: createDiscoveryBody & { json?: boolean; testTargetId: string } + options: createDiscoveryBody & { json?: boolean; testTargetId: string }, ): Promise => { const requestBody = { name: options.name, @@ -568,7 +568,7 @@ export const createDiscovery = async ( }, }, body: requestBody, - } + }, ); handleError(error); @@ -603,11 +603,11 @@ export const getPlaywrightConfig = async (options: { environmentId: options.environmentId, url: options.url, outputDir: options.outputDir, - headless: options.headless, + headless: options.headless ? "true" : "false", }, }, parseAs: "text", - } + }, ); handleError(error); @@ -643,7 +643,7 @@ export const getPlaywrightCode = async (options: { executionUrl: options.executionUrl, }, }, - } + }, ); handleError(error); @@ -672,7 +672,7 @@ export const getTestCases = async (options: { testTargetId: options.testTargetId, }, }, - } + }, ); handleError(error);