Repository: saucelabs/node-saucelabs
Pull request #112 (2021-04-05 13:11:34)

Add AutonomIQ API
This patch adds the AutonomIQ API to the client that allows to call their rest API through Node.js.


Patch:
diff --git a/apis/autonomiq.json b/apis/autonomiq.json
new file mode 100644
index 0000000..da5540a
--- /dev/null
+++ b/apis/autonomiq.json
@@ -0,0 +1,1663 @@
+{
+  "openapi": "3.0.0",
+  "info": {
+    "version": "1.0",
+    "title": "AIQ API Documentation",
+    "description": "AIQ API Service swagger Documentation\n",
+    "contact": {
+      "name": "Open Source Program Office at Sauce",
+      "email": "opensource@saucelabs.com",
+      "url": "https://saucelabs.com"
+    }
+  },
+  "externalDocs": {
+    "description": "Sauce Labs Wiki",
+    "url": "https://autonomiq.io/guide.html"
+  },
+  "servers": [
+    {
+      "url": "https://customer.autonomiq.ai",
+      "variables": {}
+    }
+  ],
+  "basePath": "/platform",
+  "securityDefinitions": {
+    "auth": {
+      "type": "basic"
+    }
+  },
+  "schemes": [
+    "https"
+  ],
+  "consumes": [
+    "application/json"
+  ],
+  "produces": [
+    "application/json"
+  ],
+  "paths": {
+    "/v1/getprojects": {
+      "get": {
+        "summary": "Get all enabled projects for the user account",
+        "tags": [
+          "Projects"
+        ],
+        "operationId": "getProjects",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "consumes": [
+          "application/json"
+        ],
+        "parameters": [
+
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns list of projects for the user account.",
+            "schema": {
+              "$ref": "#/definitions/GetProjects"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/v1/projects/{projectId}/getproject": {
+      "get": {
+        "summary": "Get project information by projectId",
+        "operationId": "getProject",
+        "tags": [
+          "Projects"
+        ],
+        "produces": [
+          "application/json"
+        ],
+        "consumes": [
+          "multipart/form-data"
+        ],
+        "parameters": [
+          {
+            "name": "projectId",
+            "in": "path",
+            "type": "string",
+            "description": "Project Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns project object of the selected project which contains project inforamation.",
+            "schema": {
+              "$ref": "#/definitions/ProjectObject"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/v1/projects/{projectName}/getprojectbyname": {
+      "get": {
+        "summary": "Get project information by project name.",
+        "tags": [
+          "Projects"
+        ],
+        "operationId": "getProjectByName",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "consumes": [
+          "multipart/form-data"
+        ],
+        "parameters": [
+          {
+            "name": "projectName",
+            "in": "path",
+            "type": "string",
+            "description": "Project Name",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns the project information of the project having project name same as a query parameter.",
+            "schema": {
+              "$ref": "#/definitions/GetProjectByName"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/testSuites/{accountId}/{projectId}/getTestSuites": {
+      "get": {
+        "summary": "Get test suites and associated test case  info for the testsuite for the requested project.",
+        "tags": [
+          "Test Suite"
+        ],
+        "operationId": "getTestsuitesByProjects",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "projectId",
+            "in": "path",
+            "type": "string",
+            "description": "Project Id",
+            "required": true
+          },
+          {
+            "name": "accountId",
+            "in": "path",
+            "type": "string",
+            "description": "Account Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns test suites and associated test case  info for the testsuite for the requested project.",
+            "schema": {
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/GetTestsuitesByProject"
+              }
+            },
+            "examples": {
+              "application/json": [
+                {
+                  "projectId": 1074,
+                  "projectName": "new_Test_Demo_1",
+                  "testSuiteId": 937,
+                  "testSuiteName": "NewTestSuite",
+                  "creationTime": "2020-08-06T05:13:44Z",
+                  "lastRunTime": "0001-01-01T00:00:00Z",
+                  "testCases": [
+                    {
+                      "testCaseId": 6528,
+                      "testCaseName": "New Test Case",
+                      "createdTime": "2020-08-06T05:12:05Z",
+                      "executionStatus": 4,
+                      "lastRun": "0001-01-01T00:00:00Z",
+                      "lastExecutionId": 0,
+                      "ordinal": 1,
+                      "isGenerating": false,
+                      "isScriptAvailable": true,
+                      "isAiqExecution": false
+                    }
+                  ],
+                  "disabledStatus": false,
+                  "interval": 0,
+                  "latestJobId": 0,
+                  "executionStatus": "NA",
+                  "scheduleStartTime": "2020-08-06T05:15:38Z",
+                  "isAiqExecution": false,
+                  "schedulePlatform": "Linux",
+                  "scheduleBrowser": "Chrome",
+                  "recipientsEmails": [
+
+                  ],
+                  "peTriggers": [
+
+                  ]
+                },
+                {
+                  "projectId": 1074,
+                  "projectName": "new_Test_Demo_1",
+                  "testSuiteId": 938,
+                  "testSuiteName": "Test_Demo",
+                  "creationTime": "2020-08-06T06:08:52Z",
+                  "lastRunTime": "2020-08-06T06:48:48Z",
+                  "testCases": [
+                    {
+                      "testCaseId": 6528,
+                      "testCaseName": "New Test Case",
+                      "createdTime": "2020-08-06T05:12:05Z",
+                      "executionStatus": 1,
+                      "lastRun": "2020-08-06T06:49:40Z",
+                      "lastExecutionId": 35520,
+                      "ordinal": 1,
+                      "isGenerating": false,
+                      "isScriptAvailable": true,
+                      "isAiqExecution": false
+                    },
+                    {
+                      "testCaseId": 6532,
+                      "testCaseName": "New Test Case_1",
+                      "createdTime": "2020-08-06T06:09:15Z",
+                      "executionStatus": 1,
+                      "lastRun": "2020-08-06T06:49:57Z",
+                      "lastExecutionId": 35521,
+                      "ordinal": 2,
+                      "isGenerating": false,
+                      "isScriptAvailable": true,
+                      "isAiqExecution": false
+                    }
+                  ],
+                  "disabledStatus": false,
+                  "interval": 0,
+                  "latestJobId": 89029,
+                  "executionStatus": "SUCCESS",
+                  "scheduleStartTime": "2020-08-06T06:15:47Z",
+                  "isAiqExecution": false,
+                  "schedulePlatform": "Linux",
+                  "scheduleBrowser": "Chrome",
+                  "recipientsEmails": [
+
+                  ],
+                  "peTriggers": [
+
+                  ]
+                }
+              ]
+            }
+          }
+        }
+      }
+    },
+    "/v1/projects/{projectId}/execute": {
+      "post": {
+        "summary": "It Executes a single test script.",
+        "tags": [
+          "Execution And Report"
+        ],
+        "operationId": "executeTestsuiteTest",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "Body",
+            "in": "body",
+            "required": true,
+            "description": "",
+            "schema": {
+              "$ref": "#/definitions/ExecuteTestSuiteTestRequest"
+            }
+          },
+          {
+            "name": "projectId",
+            "in": "path",
+            "type": "string",
+            "description": "Project Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It Executes a single test script, though this end point accepts the array of scriptId but it will execute only the script with id at 0th index.",
+            "schema": {
+              "$ref": "#/definitions/ExecuteTestSuiteTestResponse"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/v1/testsuite/{testSuiteId}/execute": {
+      "post": {
+        "summary": "It executes a test suite",
+        "tags": [
+          "Test Suite"
+        ],
+        "operationId": "executeTestsuite",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "testSuiteId",
+            "in": "path",
+            "type": "string",
+            "description": "Testsuite Id",
+            "required": true
+          },
+          {
+            "name": "Body",
+            "in": "body",
+            "required": true,
+            "schema": {
+              "$ref": "#/definitions/TestSuiteExecRequest"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "",
+            "schema": {
+              "$ref": "#/definitions/TestSuiteExecResponse"
+            }
+          }
+        }
+      }
+    },
+    "/v1/auth": {
+      "post": {
+        "tags": [
+          "Authentication"
+        ],
+        "operationId": "getAuth",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "Body",
+            "in": "body",
+            "required": true,
+            "description": "Request body must contain username and password whith which user whis to authenticate the session",
+            "schema": {
+              "$ref": "#/definitions/Authrequest"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "This response consist of token and user information",
+            "schema": {
+              "$ref": "#/definitions/AuthResponse"
+            }
+          }
+        }
+      }
+    },
+    "/v1/jobs/{jobId}/get_status": {
+      "get": {
+        "summary": "It returns status of execution of test suite",
+        "tags": [
+          "Test Suite"
+        ],
+        "operationId": "getExecutionStatus",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "jobId",
+            "in": "path",
+            "type": "string",
+            "description": "Job Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns status of execution of test suite",
+            "schema": {
+              "$ref": "#/definitions/GetStatus"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/v1/projects/{projectId}/testcases": {
+      "get": {
+        "summary": "Get Test Cases For ProjectId",
+        "tags": [
+          "Test Cases"
+        ],
+        "operationId": "getTestcases",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "projectId",
+            "in": "path",
+            "type": "string",
+            "description": "Project Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns test case and their test script information for a project.",
+            "schema": {
+              "$ref": "#/definitions/GetTestCaseByProjectId"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/v1/downloadFile": {
+      "get": {
+        "summary": "It downloades the html report",
+        "tags": [
+          "Execution And Report"
+        ],
+        "operationId": "downloadReport",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "fileURL",
+            "in": "query",
+            "required": true,
+            "type": "string",
+            "description": ""
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "",
+            "headers": {
+            }
+          }
+        }
+      }
+    },
+    "/testScriptExecutions/{executionId}/executions": {
+      "get": {
+        "summary": "It returns execution details for the executing script.",
+        "tags": [
+          "Execution And Report"
+        ],
+        "operationId": "getExecutions",
+        "deprecated": false,
+        "produces": [
+          "application/json"
+        ],
+        "parameters": [
+          {
+            "name": "executionId",
+            "in": "path",
+            "type": "string",
+            "description": "Project Id",
+            "required": true
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "It returns execution details for the executing script.",
+            "schema": {
+              "$ref": "#/definitions/GetExecutions"
+            },
+            "headers": {
+            }
+          }
+        }
+      }
+    }
+  },
+  "definitions": {
+    "Authrequest": {
+      "title": "AuthRequest",
+      "example": {
+        "username": "appuser",
+        "password": "app123"
+      },
+      "type": "object",
+      "properties": {
+        "username": {
+          "type": "string"
+        },
+        "password": {
+          "type": "string"
+        }
+      },
+      "required": [
+        "username",
+        "password"
+      ]
+    },
+    "AuthResponse": {
+      "title": "AuthResponse",
+      "example": {
+        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhaXFVc2VyIjoiYXBwdXNlciIsImFpcVVzZXJJZCI6MSwiYWlxVXNlclJvbGUiOiJBRE1JTiIsImFpcUFjY291bnRJZCI6MSwiYWlxSXNQbGF0Zm9ybUFkbWluIjpmYWxzZSwiZXhwIjoxNjAyMjc0MDIzLCJpYXQiOjE2MDIyMzA4MjN9.8Rcdhz3J1L71NQpCqpCPfHudsO4TUBo51cSFSrEeS0k",
+        "role": "ADMIN",
+        "name": "appuser",
+        "email": "appuser@autonomiq.io",
+        "userId": 1,
+        "userAccount": 1,
+        "lastLogin": "2020-10-09T08:07:03.891583195Z",
+        "isRelativeDateFormat": false
+      },
+      "type": "object",
+      "properties": {
+        "token": {
+          "type": "string"
+        },
+        "role": {
+          "type": "string"
+        },
+        "name": {
+          "type": "string"
+        },
+        "email": {
+          "type": "string"
+        },
+        "userId": {
+          "type": "integer"
+        },
+        "userAccount": {
+          "type": "integer"
+        },
+        "lastLogin": {
+          "type": "string"
+        },
+        "isRelativeDateFormat": {
+          "type": "boolean"
+        }
+      }
+    },
+    "GetTestsuitesByProject": {
+      "title": "GetTestsuitesByProject",
+      "example": {
+        "projectId": 1074,
+        "projectName": "new_Test_Demo_1",
+        "testSuiteId": 937,
+        "testSuiteName": "NewTestSuite",
+        "creationTime": "2020-08-06T05:13:44Z",
+        "lastRunTime": "0001-01-01T00:00:00Z",
+        "testCases": [
+          {
+            "testCaseId": 6528,
+            "testCaseName": "New Test Case",
+            "createdTime": "2020-08-06T05:12:05Z",
+            "executionStatus": 4,
+            "lastRun": "0001-01-01T00:00:00Z",
+            "lastExecutionId": 0,
+            "ordinal": 1,
+            "isGenerating": false,
+            "isScriptAvailable": true,
+            "isAiqExecution": false
+          }
+        ],
+        "disabledStatus": false,
+        "interval": 0,
+        "latestJobId": 0,
+        "executionStatus": "NA",
+        "scheduleStartTime": "2020-08-06T05:15:38Z",
+        "isAiqExecution": false,
+        "schedulePlatform": "Linux",
+        "scheduleBrowser": "Chrome",
+        "recipientsEmails": [
+
+        ],
+        "peTriggers": [
+
+        ]
+      },
+      "type": "object",
+      "properties": {
+        "projectId": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "projectName": {
+          "type": "string"
+        },
+        "testSuiteId": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "testSuiteName": {
+          "type": "string"
+        },
+        "creationTime": {
+          "type": "string"
+        },
+        "lastRunTime": {
+          "type": "string"
+        },
+        "testCases": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/TestCase"
+          }
+        },
+        "disabledStatus": {
+          "type": "boolean"
+        },
+        "interval": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "latestJobId": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "executionStatus": {
+          "type": "string"
+        },
+        "scheduleStartTime": {
+          "type": "string"
+        },
+        "isAiqExecution": {
+          "type": "boolean"
+        },
+        "schedulePlatform": {
+          "type": "string"
+        },
+        "scheduleBrowser": {
+          "type": "string"
+        },
+        "recipientsEmails": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        },
+        "peTriggers": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        }
+      },
+      "required": [
+        "projectId",
+        "projectName",
+        "testSuiteId",
+        "testSuiteName",
+        "creationTime",
+        "lastRunTime",
+        "testCases",
+        "disabledStatus",
+        "interval",
+        "latestJobId",
+        "executionStatus",
+        "scheduleStartTime",
+        "isAiqExecution",
+        "schedulePlatform",
+        "scheduleBrowser",
+        "recipientsEmails",
+        "peTriggers"
+      ]
+    },
+    "TestCase": {
+      "title": "TestCase",
+      "example": {
+        "testCaseId": 6528,
+        "testCaseName": "New Test Case",
+        "createdTime": "2020-08-06T05:12:05Z",
+        "executionStatus": 4,
+        "lastRun": "0001-01-01T00:00:00Z",
+        "lastExecutionId": 0,
+        "ordinal": 1,
+        "isGenerating": false,
+        "isScriptAvailable": true,
+        "isAiqExecution": false
+      },
+      "type": "object",
+      "properties": {
+        "testCaseId": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "testCaseName": {
+          "type": "string"
+        },
+        "createdTime": {
+          "type": "string"
+        },
+        "executionStatus": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "lastRun": {
+          "type": "string"
+        },
+        "lastExecutionId": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "ordinal": {
+          "type": "integer",
+          "format": "int32"
+        },
+        "isGenerating": {
+          "type": "boolean"
+        },
+        "isScriptAvailable": {
+          "type": "boolean"
+        },
+        "isAiqExecution": {
+          "type": "boolean"
+        }
+      },
+      "required": [
+        "testCaseId",
+        "testCaseName",
+        "createdTime",
+        "executionStatus",
+        "lastRun",
+        "lastExecutionId",
+        "ordinal",
+        "isGenerating",
+        "isScriptAvailable",
+        "isAiqExecution"
+      ]
+    },
+    "GetProjects": {
+      "title": "GetProjects",
+      "example": [
+        {
+          "projectId": 38,
+          "projectName": "iceDQ"
+        }
+      ],
+      "type": "object",
+      "properties": {
+        "projectId": {
+          "type": "integer"
+        },
+        "projectName": {
+          "type": "integer"
+        }
+      }
+    },
+    "ProjectObject": {
+      "title": "ProjectObject",
+      "example": {
+        "id": 54,
+        "disabledStatus": false,
+        "name": "MarcTest",
+        "appUrl": "https://login.salesforce.com",
+        "accountId": 1,
+        "lastActivityDate": "2018-08-23T16:17:48Z",
+        "creationTime": "2018-08-23T16:17:48Z",
+        "lastUsedBy": "appuser",
+        "xpathAttributes": "null",
+        "stepsColNum": 0,
+        "dataColNum": 0,
+        "expectedResultsColNum": 0,
+        "parserLocation": "",
+        "customParserArgs": "",
+        "cacheXpaths": true,
+        "isFullScreenshot": false,
+        "isNoExecutionScreenshot": false,
+        "isAutoExecute": true,
+        "isInteractiveDebug": false,
+        "interval": 0,
+        "totalTestsCount": 2,
+        "totalTestsFailedCount": 0,
+        "totalTestsPassedCount": 2,
+        "totalTestsSkippedCount": 0,
+        "totalTestsInProgressCount": 0,
+        "noOfUsers": 49,
+        "noOfEnvironments": 2,
+        "emailToSend": "",
+        "caseCount": 2,
+        "dataCount": 2,
+        "variablesCount": 0,
+        "flowsCount": 0,
+        "scriptCount": 2,
+        "smartRetry": true,
+        "aiqExecution": false,
+        "showTimer": false,
+        "description": ""
+      },
+      "type": "object",
+      "properties": {
+        "id": {
+          "type": "integer"
+        },
+        "disabledStatus": {
+          "type": "boolean"
+        },
+        "name": {
+          "type": "string"
+        },
+        "appUrl": {
+          "type": "string"
+        },
+        "accountId": {
+          "type": "integer"
+        },
+        "lastActivityDate": {
+          "type": "string"
+        },
+        "creationTime": {
+          "type": "string"
+        },
+        "lastUsedBy": {
+          "type": "string"
+        },
+        "xpathAttributes": {
+          "type": "string"
+        },
+        "stepsColNum": {
+          "type": "integer"
+        },
+        "dataColNum": {
+          "type": "integer"
+        },
+        "expectedResultsColNum": {
+          "type": "integer"
+        },
+        "parserLocation": {
+          "type": "string"
+        },
+        "customParserArgs": {
+          "type": "string"
+        },
+        "cacheXpaths": {
+          "type": "boolean"
+        },
+        "isFullScreenshot": {
+          "type": "boolean"
+        },
+        "isNoExecutionScreenshot": {
+          "type": "boolean"
+        },
+        "isAutoExecute": {
+          "type": "boolean"
+        },
+        "isInteractiveDebug": {
+          "type": "boolean"
+        },
+        "interval": {
+          "type": "integer"
+        },
+        "totalTestsCount": {
+          "type": "integer"
+        },
+        "totalTestsFailedCount": {
+          "type": "integer"
+        },
+        "totalTestsPassedCount": {
+          "type": "integer"
+        },
+        "totalTestsSkippedCount": {
+          "type": "integer"
+        },
+        "totalTestsInProgressCount": {
+          "type": "integer"
+        },
+        "noOfUsers": {
+          "type": "integer"
+        },
+        "noOfEnvironments": {
+          "type": "integer"
+        },
+        "emailToSend": {
+          "type": "string"
+        },
+        "caseCount": {
+          "type": "integer"
+        },
+        "dataCount": {
+          "type": "integer"
+        },
+        "variablesCount": {
+          "type": "integer"
+        },
+        "flowsCount": {
+          "type": "integer"
+        },
+        "scriptCount": {
+          "type": "integer"
+        },
+        "smartRetry": {
+          "type": "boolean"
+        },
+        "aiqExecution": {
+          "type": "boolean"
+        },
+        "showTimer": {
+          "type": "boolean"
+        },
+        "description": {
+          "type": "string"
+        }
+      }
+    },
+    "GetProjectByName": {
+      "title": "GetProjectByName",
+      "example": {
+        "projectId": 54,
+        "projectName": "MarcTest",
+        "appUrl": "https://login.salesforce.com",
+        "lastActivityDate": "2018-08-23T16:17:48Z",
+        "noOfEnvironments": 2,
+        "numberOfCases": 2,
+        "totalTestsCount": 2,
+        "totalTestsFailedCount": 0,
+        "totalTestsPassedCount": 2,
+        "jobs": [
+          {
+            "jobId": 0,
+            "inProgress": 0,
+            "passed": 0,
+            "failed": 0
+          },
+          {
+            "jobId": 0,
+            "inProgress": 0,
+            "passed": 0,
+            "failed": 0
+          },
+          {
+            "jobId": 0,
+            "inProgress": 0,
+            "passed": 0,
+            "failed": 0
+          }
+        ],
+        "isFavourite": false
+      },
+      "type": "object",
+      "properties": {
+        "projectId": {
+          "type": "integer"
+        },
+        "projectName": {
+          "type": "string"
+        },
+        "appUrl": {
+          "type": "string"
+        },
+        "lastActivityDate": {
+          "type": "string"
+        },
+        "noOfEnvironments": {
+          "type": "integer"
+        },
+        "numberOfCases": {
+          "type": "integer"
+        },
+        "totalTestsCount": {
+          "type": "integer"
+        },
+        "totalTestsFailedCount": {
+          "type": "integer"
+        },
+        "totalTestsPassedCount": {
+          "type": "integer"
+        },
+        "jobs": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/JobObject"
+          }
+        }
+      }
+    },
+    "JobObject": {
+      "title": "JobObject",
+      "example": {
+        "jobId": 0,
+        "inProgress": 0,
+        "passed": 0,
+        "failed": 0
+      },
+      "type": "object",
+      "properties": {
+        "jobId": {
+          "type": "integer"
+        },
+        "inProgress": {
+          "type": "integer"
+        },
+        "passed": {
+          "type": "integer"
+        },
+        "failed": {
+          "type": "integer"
+        }
+      }
+    },
+    "ExecuteTestSuiteTestResponse": {
+      "title": "ExecuteTestSuiteTestResponse",
+      "example": {
+        "tasks": [
+          {
+            "executionId": 37919,
+            "executionName": "suitedemo",
+            "executionStatus": "INPROGRESS",
+            "initiatedOn": "2020-10-08T15:28:36.229634292Z",
+            "projectName": "demo_avishkar",
+            "projectId": 0,
+            "executionVideoUrl": "",
+            "reportUrl": "",
+            "testcaseIds": 0,
+            "testCaseName": "",
+            "tcErrors": 0,
+            "tcWarnings": 0,
+            "classes": null,
+            "aiqExecution": false,
+            "aiqReportData": "",
+            "browser": 0,
+            "errorsCount": 0,
+            "warningsCount": 0,
+            "statusMessage": ""
+          }
+        ],
+        "total_execs": 0
+      },
+      "type": "object",
+      "properties": {
+        "tasks": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/TaskObject"
+          }
+        },
+        "total_execs": {
+          "type": "integer"
+        }
+      }
+    },
+    "TaskObject": {
+      "title": "TaskObject",
+      "example": {
+        "executionId": 37919,
+        "executionName": "suitedemo",
+        "executionStatus": "INPROGRESS",
+        "initiatedOn": "2020-10-08T15:28:36.229634292Z",
+        "projectName": "demo_avishkar",
+        "projectId": 0,
+        "executionVideoUrl": "",
+        "reportUrl": "",
+        "testcaseIds": 0,
+        "testCaseName": "",
+        "tcErrors": 0,
+        "tcWarnings": 0,
+        "classes": null,
+        "aiqExecution": false,
+        "aiqReportData": "",
+        "browser": 0,
+        "errorsCount": 0,
+        "warningsCount": 0,
+        "statusMessage": ""
+      },
+      "type": "object",
+      "properties": {
+        "executionId": {
+          "type": "integer"
+        },
+        "executionName": {
+          "type": "string"
+        },
+        "executionStatus": {
+          "type": "string"
+        },
+        "initiatedOn": {
+          "type": "string"
+        },
+        "projectName": {
+          "type": "string"
+        },
+        "projectId": {
+          "type": "integer"
+        },
+        "executionVideoUrl": {
+          "type": "string"
+        },
+        "reportUrl": {
+          "type": "string"
+        },
+        "testcaseIds": {
+          "type": "integer"
+        },
+        "testCaseName": {
+          "type": "string"
+        },
+        "tcErrors": {
+          "type": "integer"
+        },
+        "tcWarnings": {
+          "type": "integer"
+        },
+        "classes": {
+          "type": "object"
+        },
+        "aiqExecution": {
+          "type": "boolean"
+        },
+        "aiqReportData": {
+          "type": "string"
+        },
+        "browser": {
+          "type": "integer"
+        },
+        "errorsCount": {
+          "type": "integer"
+        },
+        "warningsCount": {
+          "type": "integer"
+        },
+        "statusMessage": {
+          "type": "string"
+        }
+      }
+    },
+    "ExecuteTestSuiteTestRequest": {
+      "title": "ExecuteTestSuiteTestRequest",
+      "example": {
+        "executionType": "smoke",
+        "isRemoteDriver": false,
+        "platform": "Linux",
+        "remoteDriverUrl": "",
+        "scripts": [
+          3110
+        ],
+        "testExecutionName": "suitedemo",
+        "sessionId": "",
+        "testCaseId": 3331,
+        "extraData": {
+        },
+        "appiumVersion": "",
+        "deviceName": "",
+        "deviceOrientation": "",
+        "platformVersion": "",
+        "browserDetails": [
+          {
+            "browser": "chrome",
+            "browserVersion": "0.0"
+          }
+        ]
+      },
+      "type": "object",
+      "properties": {
+        "executionType": {
+          "type": "string"
+        },
+        "isRemoteDriver": {
+          "type": "boolean"
+        },
+        "remoteDriver": {
+          "type": "string"
+        },
+        "remoteDriverUrl": {
+          "type": "string"
+        },
+        "testExecutionName": {
+          "type": "string"
+        },
+        "sessionId": {
+          "type": "string"
+        },
+        "testCaseId": {
+          "type": "integer"
+        },
+        "extraData": {
+          "type": "object"
+        },
+        "appiumVersion": {
+          "type": "string"
+        },
+        "deviceName": {
+          "type": "string"
+        },
+        "deviceOrientation": {
+          "type": "string"
+        },
+        "platformVersion": {
+          "type": "string"
+        },
+        "platform": {
+          "type": "string"
+        },
+        "scripts": {
+          "type": "array",
+          "items": {
+            "type": "integer",
+            "format": "int32"
+          }
+        },
+        "browserDetails": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/BrowserDetail"
+          }
+        }
+      },
+      "required": [
+        "executionType",
+        "executionMode",
+        "isRemoteDriver",
+        "remoteDriver",
+        "platform",
+        "scripts",
+        "browserDetails"
+      ]
+    },
+    "GetTestCaseByProjectId": {
+      "title": "GetTestCaseByProjectId",
+      "example": [
+        {
+          "testCaseId": 3330,
+          "testCaseName": "New Test Case",
+          "createdTime": "2019-08-09T05:08:16Z",
+          "discoveryId": 720,
+          "testCaseLoc": "http://minio:9000/000001/appuser/1/demo_avishkar/720/3330/New Test Case",
+          "projectName": "",
+          "disabledStatus": false,
+          "status": 1,
+          "statusMessage": "Success",
+          "testScripts": [
+            {
+              "testScriptid": 3109,
+              "projectId": 720,
+              "testCaseId": 3330,
+              "discoveryId": 720,
+              "userId": 1,
+              "testScriptName": "New_Test_Case.java",
+              "testScriptDownloadLink": "http://minio:9000/000001/appuser/1/demo_avishkar/720/3330/New_Test_Case.java",
+              "testScriptGenerationStatus": "SUCCESS",
+              "errorMessage": "",
+              "stepsErrorMessages": "",
+              "initiatedBy": "appuser",
+              "initiatedTime": "2019-08-09T05:08:18Z",
+              "generationTime": "2019-08-09T05:08:25Z",
+              "lastExecutedTime": "2020-10-08T12:34:31Z",
+              "lastExecStatus": 1,
+              "executionId": 37911
+            }
+          ],
+          "tags": [
+
+          ],
+          "lastRun": "2019-08-09T05:08:25Z",
+          "totalTime": 4,
+          "isGenerating": false,
+          "desc": "",
+          "reportUrl": "",
+          "testDatas": [
+
+          ],
+          "ordinal": 0
+        }
+      ],
+      "type": "object",
+      "properties": {
+        "testCaseId": {
+          "type": "integer"
+        },
+        "testCaseName": {
+          "type": "string"
+        },
+        "createdTime": {
+          "type": "string"
+        },
+        "discoveryId": {
+          "type": "integer"
+        },
+        "testCaseLoc": {
+          "type": "string"
+        },
+        "projectName": {
+          "type": "string"
+        },
+        "disabledStatus": {
+          "type": "boolean"
+        },
+        "status": {
+          "type": "integer"
+        },
+        "statusMessage": {
+          "type": "string"
+        },
+        "testScripts": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/TestScriptObject"
+          }
+        }
+      }
+    },
+    "GetExecutions": {
+      "title": "GetExecutions",
+      "example": {
+        "executionId": 13202,
+        "executionName": "",
+        "executionStatus": "ERROR",
+        "initiatedOn": "2020-10-08T12:36:20Z",
+        "projectName": "new_Test_Demo6",
+        "projectId": 22,
+        "executionVideoUrl": "",
+        "reportUrl": "Iv5aXQ_Vz89VVbhwh4LUD-6myAwGJ6y-8il2CikQ1XSSjh6WDf0TdUcs27M06mzKoPZXQFZq4K5EKETDY-iCqWubmkbDJELveKuu88P7mpo11D56nVFgs7aVY6JO2RuJ9Rh51G9xLn3Z",
+        "testcaseIds": 62,
+        "testCaseName": "outlook_login",
+        "tcErrors": 0,
+        "tcWarnings": 0,
+        "classes": null,
+        "aiqExecution": true,
+        "aiqReportData": "",
+        "browser": 1,
+        "errorsCount": 0,
+        "warningsCount": 0,
+        "statusMessage": "Failed at step 11"
+      },
+      "type": "object",
+      "properties": {
+        "executionId": {
+          "type": "integer"
+        },
+        "executionName": {
+          "type": "string"
+        },
+        "executionStatus": {
+          "type": "string"
+        },
+        "initiatedOn": {
+          "type": "string"
+        },
+        "projectName": {
+          "type": "string"
+        },
+        "projectId": {
+          "type": "integer"
+        },
+        "executionVideoUrl": {
+          "type": "string"
+        },
+        "reportUrl": {
+          "type": "string"
+        },
+        "testcaseIds": {
+          "type": "integer"
+        },
+        "testCaseName": {
+          "type": "string"
+        },
+        "tcErrors": {
+          "type": "integer"
+        },
+        "tcWarnings": {
+          "type": "integer"
+        },
+        "classes": {
+          "type": "object"
+        },
+        "aiqExecution": {
+          "type": "boolean"
+        },
+        "aiqReportData": {
+          "type": "string"
+        },
+        "browser": {
+          "type": "integer"
+        },
+        "errorsCount": {
+          "type": "integer"
+        },
+        "warningsCount": {
+          "type": "integer"
+        },
+        "statusMessage": {
+          "type": "string"
+        }
+      }
+    },
+    "TestScriptObject": {
+      "title": "TestScriptObject",
+      "type": "object",
+      "properties": {
+        "testScriptid": {
+          "type": "integer"
+        },
+        "projectId": {
+          "type": "integer"
+        },
+        "testCaseId": {
+          "type": "integer"
+        },
+        "discoveryId": {
+          "type": "integer"
+        },
+        "userId": {
+          "type": "integer"
+        },
+        "testScriptName": {
+          "type": "integer"
+        },
+        "testScriptDownloadLink": {
+          "type": "string"
+        },
+        "testScriptGenerationStatus": {
+          "type": "string"
+        },
+        "errorMessage": {
+          "type": "string"
+        },
+        "stepsErrorMessages": {
+          "type": "string"
+        },
+        "initiatedBy": {
+          "type": "string"
+        },
+        "initiatedTime": {
+          "type": "string"
+        },
+        "generationTime": {
+          "type": "string"
+        },
+        "lastExecutedTime": {
+          "type": "string"
+        },
+        "lastExecStatus": {
+          "type": "integer"
+        },
+        "executionId": {
+          "type": "integer"
+        }
+      }
+    },
+    "GetStatus": {
+      "title": "GetStatus",
+      "example": {
+        "job_id": 9854,
+        "creation_time": "2020-09-15T15:49:01Z",
+        "job_execution_status": "PARTIAL",
+        "tcs": [
+          {
+            "tc_id": 61,
+            "tc_name": "New_Test_Case_1",
+            "execution_id": 11938,
+            "execution_name": "New_Test_Case_1_TestDemo3",
+            "execution_initiated_time": "2020-09-15T15:49:02Z",
+            "execution_cmpletion_tiem": "2020-09-15T16:03:17Z",
+            "execution_status": "ERROR",
+            "execution_error_meg": "",
+            "script_generation_status": "INPROGRESS",
+            "script_generation_error": "",
+            "project_id": 22,
+            "project_name": "",
+            "aiq_execution": false,
+            "aiq_report_data": "",
+            "browser": "chrome",
+            "tags": [
+
+            ]
+          }
+        ]
+      },
+      "type": "object",
+      "properties": {
+        "job_id": {
+          "type": "integer"
+        },
+        "creation_time": {
+          "type": "string"
+        },
+        "job_execution_status": {
+          "type": "string"
+        },
+        "tcs": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/TcsObject"
+          }
+        }
+      }
+    },
+    "TestSuiteExecRequest": {
+      "title": "TestSuiteExecRequest",
+      "example": {
+        "executionType": "smoke",
+        "executionMode": "parallel",
+        "isRemoteDriver": false,
+        "platform": "Linux",
+        "remoteDriverUrl": "",
+        "browserDetails": [
+          {
+            "browser": "Chrome",
+            "browserVersion": "0.0"
+          }
+        ],
+        "map": {
+        }
+      },
+      "type": "object",
+      "properties": {
+        "executionType": {
+          "type": "string"
+        },
+        "executionMode": {
+          "type": "string"
+        },
+        "isRemoteDriver": {
+          "type": "boolean"
+        },
+        "platform": {
+          "type": "string"
+        },
+        "remoteDriverUrl": {
+          "type": "string"
+        },
+        "browserDetails": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/BrowserDetail"
+          }
+        },
+        "map": {
+          "type": "object"
+        }
+      }
+    },
+    "TestSuiteExecResponse": {
+      "title": "TestSuiteExecResponse",
+      "example": {
+        "job_id": 118102
+      },
+      "type": "object",
+      "properties": {
+        "job_id": {
+          "type": "integer"
+        }
+      }
+    },
+    "TcsObject": {
+      "title": "TcsObject",
+      "type": "object",
+      "properties": {
+        "tc_id": {
+          "type": "integer"
+        },
+        "tc_name": {
+          "type": "string"
+        },
+        "execution_id": {
+          "type": "integer"
+        },
+        "execution_name": {
+          "type": "string"
+        },
+        "execution_initiated_time": {
+          "type": "string"
+        },
+        "execution_cmpletion_tiem": {
+          "type": "string"
+        },
+        "execution_status": {
+          "type": "string"
+        },
+        "execution_error_meg": {
+          "type": "string"
+        },
+        "script_generation_status": {
+          "type": "string"
+        },
+        "script_generation_error": {
+          "type": "string"
+        },
+        "project_id": {
+          "type": "integer"
+        },
+        "project_name": {
+          "type": "string"
+        },
+        "aiq_execution": {
+          "type": "boolean"
+        },
+        "aiq_report_data": {
+          "type": "string"
+        },
+        "browser": {
+          "type": "string"
+        },
+        "tags": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        }
+      }
+    },
+    "BrowserDetail": {
+      "title": "BrowserDetail",
+      "example": {
+        "browser": "Chrome",
+        "browserVersion": "0.0"
+      },
+      "type": "object",
+      "properties": {
+        "browser": {
+          "type": "string"
+        },
+        "browserVersion": {
+          "type": "string"
+        }
+      },
+      "required": [
+        "browser",
+        "browserVersion"
+      ]
+    }
+  },
+  "tags": [
+    {
+      "name": "Projects",
+      "description": "Project Operations"
+    },
+    {
+      "name": "Test Cases",
+      "description": "Test Cases Operations"
+    },
+    {
+      "name": "Test Suite",
+      "description": "Test Suites Operations"
+    },
+    {
+      "name": "Execution And Report",
+      "description": "Executions And Report Operations"
+    },
+    {
+      "name": "Authentication",
+      "description": "Authentication operations"
+    }
+  ]
+}
diff --git a/src/constants.js b/src/constants.js
index 7a18829..4766182 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -19,7 +19,8 @@ const protocols = [
     require('../apis/rdc.json'),
     require('../apis/performance.json'),
     require('../apis/testrunner.json'),
-    require('../apis/datastore.json')
+    require('../apis/datastore.json'),
+    require('../apis/autonomiq.json')
 ]
 
 const protocolFlattened = new Map()
diff --git a/src/index.js b/src/index.js
index 9265425..956d741 100644
--- a/src/index.js
+++ b/src/index.js
@@ -29,7 +29,10 @@ export default class SauceLabs {
             password: this._accessKey,
             https: { rejectUnauthorized: getStrictSsl() },
             followRedirect: true,
-            headers: this._options.headers
+            headers: {
+                ...this._options.headers,
+                Authorization: `Basic ${Buffer.from(`${this.username}:${this._accessKey}`).toString('base64')}`
+            }
         })
 
         if (typeof this._options.proxy === 'string') {


Test patch:
diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap
index d14fb24..282f84e 100644
--- a/tests/__snapshots__/index.test.js.snap
+++ b/tests/__snapshots__/index.test.js.snap
@@ -2,6 +2,7 @@
 
 exports[`should contain custom headers 1`] = `
 Object {
+  "Authorization": "Basic Zm9vOmJhcg==",
   "user-agent": "foo",
 }
 `;