A Node.js JavaScript client for working with LambdaTest through Automation API.
npm i @kanhaiyalalsingh/lambdatest
var lambdaRestClient = require("@kanhaiyalalsingh/lambdatest");
var lambdaCredentials = {
username: "kanha",
accessKey: "@%3464vc432#%jdsfdsnjgfdg"
};
// Automation APIs
var lambdaAutomationClient = lambdaRestClient.AutomationClient(
lambdaCredentials
);
lambdaAutomationClient.fetchBuilds(function(error, builds) {
if (error) {
console.log(error);
}
console.log("Builds : " + builds);
});
Creates a new automation client instance.
lambdaCredentials
: credentials for all requests. _username
: The username for the LambdaTest account. _accessKey
: The accessKey for the LambdaTest account.
Build Object This object is dedicated to help you perform any operation on your test builds.
Fetch all the details regarding test builds.
params
: Parameters(offset, limit, status, fromdate, todate, sort)offset
- used to limit the number of lists. For example: offset=10limit
- used to limit the number of records. For example: limit=10status
- used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"fromdate
- to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.todate
- to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.sort
- to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
callback
(function(error, builds)
): A callback to invoke when the API call is complete.
Fetch all the details of a particular test build by ID. Details would include:
- Status of the build
- Number of tests executed
- User who executed the build
buildId
- a unique ID for the build type you wish to fetch.callback
(function(error, build)
) - A callback to invoke when the API call is complete.
To delete a particular build from your automation dashboard.
buildId
- ID of the particular build you wish to delete.callback
(function(error, build)
): A callback to invoke when the API call is complete.
To rename a test build.
buildId
- ID of the particular build you wish to rename.requestBody
- Object(name).name
- Changed namecallback
(function(error, build)
) - A callback to invoke when the API call is complete.
Session Object This object is dedicated to help you perform any operation related to your test sessions.
Fetch all the details regarding test sessions.
params
: Parameters(build_id, username, offset, limit, status, fromdate, todate, sort)callback
(function(error, builds)
): A callback to invoke when the API call is complete.build_id
- to filter sessions executed in a particular build.username
- to filter sessions executed by a particular user.offset
- used to limit the number of lists. For example: offset=10limit
- used to limit the number of records. For example: limit=10status
- used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"fromdate
- to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.todate
- to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.sort
- to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
callback
(function(error, sessions)
): A callback to invoke when the API call is complete.
Fetch all the details of a particular test session by ID. Details that are fetched would include:
- Name of the session
- Status of the session
- Operating system
- Browser name
- Browser version
- All generated logs endpoint
sessionId
- a unique ID for the build type you wish to fetch.callback
(function(error, session)
): A callback to invoke when the API call is complete.
To delete a particular session from your automation dashboard.
sessionId
- ID of the particular session you wish to delete.callback
(function(error, session)
): A callback to invoke when the API call is complete.
To rename a test session or to update a test session as "passed" or "failed".
sessionId
- ID of the particular session you wish to rename.requestBody
- Object(name, status_ind).name
- Changed namestatus_ind
- Updated status(passed/failed)callback
(function(error, session)
): A callback to invoke when the API call is complete.
To extract step-by-step screenshot of a particular test session. The screenshots would be fetched in the zip format.
sessionId
- ID of the particular session for which you wish to fetch step-by-step screenshots.callback
(function(error, screenshots)
): A callback to invoke when the API call is complete.
To fetch a recorded video of your test session.
sessionId
- ID of the particular session for which you wish to fetch the recorded video.callback
(function(error, video)
): A callback to invoke when the API call is complete.
To fetch the entire command logs of a test session in plain JSON text.
sessionId
- ID of the particular session for which you wish to fetch the command logs.callback
(function(error, commandLogs)
): A callback to invoke when the API call is complete.
To fetch every response and request recieved by the Selenium Grid for a particular test session in plain JSON text.
sessionId
- ID of the particular session for which you wish to fetch the Selenium logs.callback
(function(error, networkLogs)
): A callback to invoke when the API call is complete.
To fetch all of the console errors thrown throughout interation between web-application and Selenium script for a particular test session in plain JSON text. To fetch all of the console errors for a particular test session in plain JSON text.
sessionId
- ID of the particular session for which you wish to fetch the console logs.callback
(function(error, consoleLogs)
): A callback to invoke when the API call is complete.
Tunnel Object This object is dedicated to represent information regarding the Lambda Tunnel for performing automated cross browser testing of your locally hosted web-apps.
To fetch the entire list of active tunnels in your account.
callback
(function(error, tunnels)
): A callback to invoke when the API call is complete.
To delete a particular Lambda Tunnel running in your account.
tunnelId
- ID of the particular Tunnel for which you wish to delete.callback
(function(error, tunnel)
): A callback to invoke when the API call is complete.
Platform Object
To fetch syntax for every browser and browser version offered by LambdaTest.
callback
(function(error, platforms)
): A callback to invoke when the API call is complete.