Appearance
Documentation / automate / GeneratedAutomateClient
Class: GeneratedAutomateClient
Defined in: openapi/generated/automate.client.ts:265
Internal
Extends
Extended by
Constructors
Constructor
new GeneratedAutomateClient(
options,baseUrl,cloudBaseUrl,pkgName,pkgVersion):GeneratedAutomateClient
Defined in: core/src/api-client.ts:68
Parameters
| Parameter | Type |
|---|---|
options | BrowserStackOptions |
baseUrl | string |
cloudBaseUrl | string |
pkgName | string |
pkgVersion | string |
Returns
GeneratedAutomateClient
Inherited from
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
authHeader? | string | HTTP Basic Auth header derived from username and access key. | APIClient.authHeader | core/src/api-client.ts:55 |
baseUrls | object | Base URLs used for API requests. | APIClient.baseUrls | core/src/api-client.ts:53 |
baseUrls.sdk | string | - | - | core/src/api-client.ts:53 |
baseUrls.sdkCloud | string | - | - | core/src/api-client.ts:53 |
clientTimeout? | number | - | APIClient.clientTimeout | core/src/api-client.ts:66 |
fetchFn | (input, init?) => Promise<Response> | Fetch implementation used to make HTTP requests. | APIClient.fetchFn | core/src/api-client.ts:59 |
registry | CodecRegistry | Registry of request and response codecs. | APIClient.registry | core/src/api-client.ts:61 |
userAgent | string | User-Agent string sent with every request. | APIClient.userAgent | core/src/api-client.ts:57 |
Methods
deleteBuild()
deleteBuild(
buildId,options?):Promise<{message?:string;status?:string; }>
Defined in: openapi/generated/automate.client.ts:556
Delete a build on the server. Please note that deleting a build will delete all the sessions contained within it. Builds once deleted cannot be recovered
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId | string | ID of your build |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ message?: string; status?: string; }>
deleteBuilds()
deleteBuilds(
buildId?,options?):Promise<{message?:string; }>
Defined in: openapi/generated/automate.client.ts:380
Delete multiple builds on the server. You can delete a maximum of 5 builds at a time. Builds once deleted cannot be recovered.
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId? | string[] | IDs of your builds |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ message?: string; }>
deleteMediaFile()
deleteMediaFile(
mediaId,options?):Promise<{success:boolean; }>
Defined in: openapi/generated/automate.client.ts:490
Delete a media file on the server. Media files once deleted cannot be recovered
Parameters
| Parameter | Type | Description |
|---|---|---|
mediaId | string | ID of your media file |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ success: boolean; }>
deleteProject()
deleteProject(
projectId,options?):Promise<{message?:string;status?:string; }>
Defined in: openapi/generated/automate.client.ts:711
Delete a project on the server using the DELETE method. Please note that to delete a project, it needs to be empty of builds and sessions, and projects once deleted cannot be recovered
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | ID of your project |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ message?: string; status?: string; }>
deleteSession()
deleteSession(
sessionId,options?):Promise<{message?:string;status?:string; }>
Defined in: openapi/generated/automate.client.ts:446
Delete a session on the server. Sessions once deleted cannot be recovered
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ message?: string; status?: string; }>
deleteSessions()
deleteSessions(
sessionId?,options?):Promise<{message?:string; }>
Defined in: openapi/generated/automate.client.ts:468
Delete multiple sessions on the server. Sessions once deleted cannot be recovered.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId? | string[] | IDs of your sessions |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ message?: string; }>
execute()
protectedexecute<T>(spec):Promise<T>
Defined in: core/src/api-client.ts:126
Internal
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
spec | {[key: string]: unknown; baseUrl?: "sdk" | "sdkCloud"; method: HttpMethod; operationId: string; params?: { path?: Record<string, unknown>; query?: Record<string, unknown>; }; path: string; requestCodec?: string; requestCodecConfig?: unknown; requestInput?: unknown; responseCodec: string; responseCodecConfig: unknown; signal?: AbortSignal; } |
spec.baseUrl? | "sdk" | "sdkCloud" |
spec.method | HttpMethod |
spec.operationId | string |
spec.params? | { path?: Record<string, unknown>; query?: Record<string, unknown>; } |
spec.params.path? | Record<string, unknown> |
spec.params.query? | Record<string, unknown> |
spec.path | string |
spec.requestCodec? | string |
spec.requestCodecConfig? | unknown |
spec.requestInput? | unknown |
spec.responseCodec | string |
spec.responseCodecConfig | unknown |
spec.signal? | AbortSignal |
Returns
Promise<T>
Inherited from
getBrowsers()
getBrowsers(
options?):Promise<object[]>
Defined in: openapi/generated/automate.client.ts:271
Fetches all automate browsers.
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<object[]>
getBuild()
getBuild(
buildId,options?):Promise<GetAutomateBuildResult>
Defined in: openapi/generated/automate.client.ts:512
Fetches a build
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId | string | ID of your build |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<GetAutomateBuildResult>
getBuilds()
getBuilds(
projectId?,limit?,offset?,status?,options?):Promise<GetAutomateBuildsResult>
Defined in: openapi/generated/automate.client.ts:888
Fetch the 10 recent test builds that have run on BrowserStack. You can also limit the number of builds and paginate through your data
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId? | string | ID of your project |
limit? | string | Specify the number of results to be displayed. The default value is 10, and the maximum value is 100 |
offset? | string | Retrieve builds from a specific point using the offset parameter |
status? | string | Status of the build |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<GetAutomateBuildsResult>
getMediaFiles()
getMediaFiles(
options?):Promise<object[]>
Defined in: openapi/generated/automate.client.ts:798
Fetches list of recently uploaded media files
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<object[]>
getPlan()
getPlan(
options?):Promise<{automatePlan:string;parallelSessionsMaxAllowed:number;parallelSessionsRunning:number;queuedSessions:number;queuedSessionsMaxAllowed:number;teamParallelSessionsMaxAllowed:number;terminalAccess?:string; }>
Defined in: openapi/generated/automate.client.ts:292
Fetches Automate plan details
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ automatePlan: string; parallelSessionsMaxAllowed: number; parallelSessionsRunning: number; queuedSessions: number; queuedSessionsMaxAllowed: number; teamParallelSessionsMaxAllowed: number; terminalAccess?: string; }>
getProject()
getProject(
projectId,options?):Promise<{builds:object[];createdAt:string;groupId:number;id:number;name:string;subGroupId:number;updatedAt:string;userId:number; }>
Defined in: openapi/generated/automate.client.ts:667
Specific information about a particular project can be queried using the project ID
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | ID of your project |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ builds: object[]; createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>
getProjectBadgeKey()
getProjectBadgeKey(
projectId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:336
Fetches the badge key for sharing a public link for the Automate dashboard to view the latest build and sessions for that project
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | ID of your project |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getProjects()
getProjects(
options?):Promise<object[]>
Defined in: openapi/generated/automate.client.ts:819
Fetches list of projects associated with your username and access key. You will need the id of the project for invoking any other Project API that follows in this document
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<object[]>
getSession()
getSession(
sessionId,options?):Promise<{appiumLogsUrl?:string;browser:string;browserConsoleLogsUrl?:string;browserProfilingUrl?:string;browserstackStatus:string;browserUrl:string;browserVersion:string;buildHashedId?:string;buildName:string;buildTerminalLogsUrl?:string;createdAt:string;device?:string;duration:number;harLogsUrl?:string;hashedId:string;insights?: {[key:string]:unknown; };logs:string;name:string;os:string;osVersion:string;playwrightLogsUrl?:string;projectName:string;publicUrl:string;realMobile?:boolean;reason:string;seleniumLogsUrl?:string;seleniumTelemetryLogsUrl?:string;sessionTerminalLogsUrl?:string;status:"done"|"running"|"timeout"|"failed"|"passed";testPriority?:string|null;videoUrl:string; }>
Defined in: openapi/generated/automate.client.ts:402
Fetches a session for a particular build
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ appiumLogsUrl?: string; browser: string; browserConsoleLogsUrl?: string; browserProfilingUrl?: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildHashedId?: string; buildName: string; buildTerminalLogsUrl?: string; createdAt: string; device?: string; duration: number; harLogsUrl?: string; hashedId: string; insights?: {[key: string]: unknown; }; logs: string; name: string; os: string; osVersion: string; playwrightLogsUrl?: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl?: string; seleniumTelemetryLogsUrl?: string; sessionTerminalLogsUrl?: string; status: "done" | "running" | "timeout" | "failed" | "passed"; testPriority?: string | null; videoUrl: string; }>
getSessionAppiumLogs()
getSessionAppiumLogs(
sessionId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:314
Fetches Appium logs for a session. Raw Appium Logs for each session are available to you in text format.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getSessionConsoleLogs()
getSessionConsoleLogs(
sessionId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:841
Fetches console logs for a session. Console logs are enabled by default and are set to errors. You can disable them or change verbosity options by using the browserstack.console capability to disabled, errors, warnings, info, verbose. Raw Console Logs for each session are available to you in text format.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getSessionLogs()
getSessionLogs(
sessionId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:578
Fetches session logs. Whenever you execute a session on BrowserStack, a session log is generated. These logs are available to you in text format.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getSessionNetworkLogs()
getSessionNetworkLogs(
sessionId,options?):Promise<{log?: {browser?: {comment?:string;name?:string;version?:string; };creator?: {comment?:string;name?:string;version?:string; };entries?:object[];pages?:object[];version?:string; }; }>
Defined in: openapi/generated/automate.client.ts:910
Fetches network logs for a session. Network Logs for each session are available to you in HAR (HTTP Archive) format.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ log?: { browser?: { comment?: string; name?: string; version?: string; }; creator?: { comment?: string; name?: string; version?: string; }; entries?: object[]; pages?: object[]; version?: string; }; }>
getSessionPlaywrightLogs()
getSessionPlaywrightLogs(
sessionId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:755
Fetches the Playwright protocol logs for a Playwright session, as text. Responds with 200 and no Content-Type header, and with an XML 404 body when the session has no Playwright logs (for example a Selenium session).
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getSessions()
getSessions(
buildId,limit?,offset?,status?,options?):Promise<GetAutomateSessionsResult>
Defined in: openapi/generated/automate.client.ts:645
Fetches list of sessions for a particular build
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId | string | ID of your build |
limit? | string | Specify the number of results to be displayed. The default value is 10, and the maximum value is 100 |
offset? | string | Retrieve sessions from a specific point using the offset parameter |
status? | string | Filter by session status. Verified live - passed and failed. done matches nothing, and an unknown value returns an empty list rather than an error. |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<GetAutomateSessionsResult>
getSessionSeleniumLogs()
getSessionSeleniumLogs(
sessionId,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:733
Fetches Selenium logs for a session. Raw Selenium logs for each session are available to you in text format.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
getSessionTelemetryLogs()
getSessionTelemetryLogs(
sessionId,options?):Promise<ArrayBuffer>
Defined in: openapi/generated/automate.client.ts:863
Fetches telemetry logs for a session. Telemetry logs for a session are available for tests run using Selenium 4. Telemetry logs are by default disabled for a session.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<ArrayBuffer>
recycleKey()
recycleKey(
body,options?):Promise<{newKey:string;oldKey:string; }>
Defined in: openapi/generated/automate.client.ts:620
Reset Automate access key
Parameters
| Parameter | Type | Description |
|---|---|---|
body | never | - |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ newKey: string; oldKey: string; }>
updateBuild()
updateBuild(
buildId,body,options?):Promise<DeepCamelCase<{automation_build: {automation_project_id?:number;build_tag:string|null;created_at?:string;delta?:boolean;duration:number;framework?:string;group_id?:number;hashed_id:string;name:string;public_url?:string;status:"done"|"running"|"timeout"|"failed";sub_group_id?:number;test_data?: {[key:string]:unknown; };updated_at?:string;user_id?:number; }; } | {error:string; }>>
Defined in: openapi/generated/automate.client.ts:534
Update the name or tag of your build after the build is complete. To delete a build tag, simply pass an empty string as value for build_tag.
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId | string | ID of your build |
body | { buildTag?: string; name?: string; } | - |
body.buildTag? | string | The new build tag that you want to set Example registration |
body.name? | string | The new build name that you want to set. Accepted characters are A-Z, a-z, 0-9, ., :, -, [], /, @, &, ', _. Character limit is 255. Example Selenium test |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<DeepCamelCase<{ automation_build: { automation_project_id?: number; build_tag: string | null; created_at?: string; delta?: boolean; duration: number; framework?: string; group_id?: number; hashed_id: string; name: string; public_url?: string; status: "done" | "running" | "timeout" | "failed"; sub_group_id?: number; test_data?: {[key: string]: unknown; }; updated_at?: string; user_id?: number; }; } | { error: string; }>>
updateProject()
updateProject(
projectId,body,options?):Promise<{createdAt:string;groupId:number;id:number;name:string;subGroupId:number;updatedAt:string;userId:number; }>
Defined in: openapi/generated/automate.client.ts:689
Update the name of your project after the project is complete
Parameters
| Parameter | Type | Description |
|---|---|---|
projectId | string | ID of your project |
body | { name: string; } | - |
body.name | string | Name of your project Example pricing_project |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ createdAt: string; groupId: number; id: number; name: string; subGroupId: number; updatedAt: string; userId: number; }>
updateSession()
updateSession(
sessionId,body,options?):Promise<{appiumLogsUrl?:string;browser:string;browserConsoleLogsUrl?:string;browserProfilingUrl?:string;browserstackStatus:string;browserUrl:string;browserVersion:string;buildHashedId?:string;buildName:string;buildTerminalLogsUrl?:string;createdAt:string;device?:string;duration:number;harLogsUrl?:string;hashedId:string;insights?: {[key:string]:unknown; };logs:string;name:string;os:string;osVersion:string;playwrightLogsUrl?:string;projectName:string;publicUrl:string;realMobile?:boolean;reason:string;seleniumLogsUrl?:string;seleniumTelemetryLogsUrl?:string;sessionTerminalLogsUrl?:string;status:"done"|"running"|"timeout"|"failed"|"passed";testPriority?:string|null;videoUrl:string; }>
Defined in: openapi/generated/automate.client.ts:424
Set the status for a session or update the name of the session. You can mark test status as passed or failed along with a reason.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
body | DeepCamelCase<{ reason: string; status: "failed" | "passed"; } | { name: string; }> | - |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ appiumLogsUrl?: string; browser: string; browserConsoleLogsUrl?: string; browserProfilingUrl?: string; browserstackStatus: string; browserUrl: string; browserVersion: string; buildHashedId?: string; buildName: string; buildTerminalLogsUrl?: string; createdAt: string; device?: string; duration: number; harLogsUrl?: string; hashedId: string; insights?: {[key: string]: unknown; }; logs: string; name: string; os: string; osVersion: string; playwrightLogsUrl?: string; projectName: string; publicUrl: string; realMobile?: boolean; reason: string; seleniumLogsUrl?: string; seleniumTelemetryLogsUrl?: string; sessionTerminalLogsUrl?: string; status: "done" | "running" | "timeout" | "failed" | "passed"; testPriority?: string | null; videoUrl: string; }>
uploadBuildTerminalLogs()
uploadBuildTerminalLogs(
buildId,body,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:777
Upload terminal logs for your build.
Parameters
| Parameter | Type | Description |
|---|---|---|
buildId | string | ID of your build |
body | { file: Blob; } | { url: string; } & object & Record<string, unknown> | - |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>
uploadMediaFile()
uploadMediaFile(
body,options?):Promise<{mediaUrl:string; }>
Defined in: openapi/generated/automate.client.ts:599
Upload a media file you want to use in your tests
Parameters
| Parameter | Type | Description |
|---|---|---|
body | { file: Blob; } | { url: string; } & object & Record<string, unknown> | - |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<{ mediaUrl: string; }>
uploadSessionTerminalLogs()
uploadSessionTerminalLogs(
sessionId,body,options?):Promise<string>
Defined in: openapi/generated/automate.client.ts:358
Upload terminal logs for your session.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionId | string | ID of your session |
body | { file: Blob; } | { url: string; } & object & Record<string, unknown> | - |
options? | ExecuteOptions | Optional abort signal and other request options |
Returns
Promise<string>