11![ LambdaTest Logo] ( https://www.lambdatest.com/static/images/logo.svg )
22
33# Node LambdaTest
4+
45[ ![ npm version] ( https://badge.fury.io/js/%40lambdatest%2Fnode-rest-client.svg )] ( https://badge.fury.io/js/%40lambdatest%2Fnode-rest-client )
56
67A Node.js JavaScript client for working with [ LambdaTest] ( https://www.lambdatest.com ) through [ Automation API] ( https://www.lambdatest.com/support/docs/api-doc ) .
@@ -16,19 +17,17 @@ npm i @lambdatest/node-rest-client
1617``` js
1718var lambdaRestClient = require (" @lambdatest/node-rest-client" );
1819var lambdaCredentials = {
19- username: process .env .LT_USERNAME || " <Your username>" ,
20- accessKey: process .env .LT_ACCESS_KEY || " <Your access key>"
20+ username: process .env .LT_USERNAME || " <Your username>" ,
21+ accessKey: process .env .LT_ACCESS_KEY || " <Your access key>" ,
2122};
2223
2324// Automation APIs
24- var lambdaAutomationClient = lambdaRestClient .AutomationClient (
25- lambdaCredentials
26- );
27-
28- lambdaAutomationClient .fetchBuilds (function (error , builds ) {
29- if (! error) {
30- console .log (builds);
31- }
25+ var lambdaAutomationClient = lambdaRestClient .AutomationClient (lambdaCredentials);
26+
27+ lambdaAutomationClient .fetchBuilds (function (error , builds ) {
28+ if (! error) {
29+ console .log (builds);
30+ }
3231});
3332```
3433
@@ -40,10 +39,10 @@ lambdaAutomationClient.fetchBuilds(function(error, builds) {
4039
4140Creates a new automation client instance.
4241
43- - ` lambdaCredentials ` : credentials for all requests.
44- - ` username ` : The username for the LambdaTest account.
45- - ` accessKey ` : The accessKey for the LambdaTest account.
46- - ` logFile ` : You can provide a specific path to log file.If you won't provide a path then the logs would be saved in your present working directory by the filename: lambda_api.log
42+ - ` lambdaCredentials ` : credentials for all requests.
43+ - ` username ` : The username for the LambdaTest account.
44+ - ` accessKey ` : The accessKey for the LambdaTest account.
45+ - ` logFile ` : You can provide a specific path to log file.If you won't provide a path then the logs would be saved in your present working directory by the filename: lambda_api.log
4746
4847Build Object
4948This object is dedicated to help you perform any operation on your test builds.
@@ -52,14 +51,14 @@ This object is dedicated to help you perform any operation on your test builds.
5251
5352Fetch all the details regarding test builds.
5453
55- - (optional) ` params ` : Parameters(offset, limit, status, fromdate, todate, sort)
56- - ` offset ` - used to limit the number of lists. For example: offset=10
57- - ` limit ` - used to limit the number of records. For example: limit=10
58- - ` status ` - used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"
59- - ` fromdate ` - to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.
60- - ` todate ` - to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.
61- - ` sort ` - to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
62- - ` callback ` (` function(error, builds) ` ): A callback to invoke when the API call is complete.
54+ - (optional) ` params ` : Parameters(offset, limit, status, fromdate, todate, sort)
55+ - ` offset ` - used to limit the number of lists. For example: offset=10
56+ - ` limit ` - used to limit the number of records. For example: limit=10
57+ - ` status ` - used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"
58+ - ` fromdate ` - to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.
59+ - ` todate ` - to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.
60+ - ` sort ` - to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
61+ - ` callback ` (` function(error, builds) ` ): A callback to invoke when the API call is complete.
6362
6463#### lambdaAutomationClient.fetchBuildById(buildId, callback)
6564
@@ -69,24 +68,24 @@ Fetch all the details of a particular test build by ID. Details would include:
69682 . Number of tests executed
70693 . User who executed the build
7170
72- - ` buildId ` - a unique ID for the build type you wish to fetch.
73- - ` callback ` (` function(error, build) ` ) - A callback to invoke when the API call is complete.
71+ - ` buildId ` - a unique ID for the build type you wish to fetch.
72+ - ` callback ` (` function(error, build) ` ) - A callback to invoke when the API call is complete.
7473
7574#### lambdaAutomationClient.deleteBuildById(buildId, callback)
7675
7776To delete a particular build from your automation dashboard.
7877
79- - ` buildId ` - ID of the particular build you wish to delete.
80- - ` callback ` (` function(error, build) ` ): A callback to invoke when the API call is complete.
78+ - ` buildId ` - ID of the particular build you wish to delete.
79+ - ` callback ` (` function(error, build) ` ): A callback to invoke when the API call is complete.
8180
8281#### lambdaAutomationClient.updateBuildById(buildId, requestBody, callback)
8382
8483To rename a test build.
8584
86- - ` buildId ` - ID of the particular build you wish to rename.
87- - ` requestBody ` - Object(name).
88- - ` name ` - Changed name
89- - ` callback ` (` function(error, build) ` ) - A callback to invoke when the API call is complete.
85+ - ` buildId ` - ID of the particular build you wish to rename.
86+ - ` requestBody ` - Object(name).
87+ - ` name ` - Changed name
88+ - ` callback ` (` function(error, build) ` ) - A callback to invoke when the API call is complete.
9089
9190Session Object
9291This object is dedicated to help you perform any operation related to your test sessions.
@@ -95,16 +94,16 @@ This object is dedicated to help you perform any operation related to your test
9594
9695Fetch all the details regarding test sessions.
9796
98- - (optional) ` params ` : Parameters(build_id, username, offset, limit, status, fromdate, todate, sort)
99- - ` build_id ` - to filter sessions executed in a particular build.
100- - ` username ` - to filter sessions executed by a particular user.
101- - ` offset ` - used to limit the number of lists. For example: offset=10
102- - ` limit ` - used to limit the number of records. For example: limit=10
103- - ` status ` - used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"
104- - ` fromdate ` - to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.
105- - ` todate ` - to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.
106- - ` sort ` - to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
107- - ` callback ` (` function(error, sessions) ` ): A callback to invoke when the API call is complete.
97+ - (optional) ` params ` : Parameters(build_id, username, offset, limit, status, fromdate, todate, sort)
98+ - ` build_id ` - to filter sessions executed in a particular build.
99+ - ` username ` - to filter sessions executed by a particular user.
100+ - ` offset ` - used to limit the number of lists. For example: offset=10
101+ - ` limit ` - used to limit the number of records. For example: limit=10
102+ - ` status ` - used to extract the status for list of builds in comma separated format. For example: "running,queued,completed,timeout and error"
103+ - ` fromdate ` - to fetch all the builds executed past a particular date in the (YYYY-MM-DD) date format.
104+ - ` todate ` - to fetch all the builds executed till a particular date in the (YYYY-MM-DD) date format.
105+ - ` sort ` - to sort the list in ascending or descending order using multiple keys. For example: "asc.user_id,desc.org_id"
106+ - ` callback ` (` function(error, sessions) ` ): A callback to invoke when the API call is complete.
108107
109108#### lambdaAutomationClient.fetchSessionById(sessionId, callback)
110109
@@ -117,61 +116,61 @@ Fetch all the details of a particular test session by ID. Details that are fetch
1171165 . Browser version
1181176 . All generated logs endpoint
119118
120- - ` sessionId ` - a unique ID for the build type you wish to fetch.
121- - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
119+ - ` sessionId ` - a unique ID for the build type you wish to fetch.
120+ - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
122121
123122#### lambdaAutomationClient.deleteSessionById(sessionId, callback)
124123
125124To delete a particular session from your automation dashboard.
126125
127- - ` sessionId ` - ID of the particular session you wish to delete.
128- - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
126+ - ` sessionId ` - ID of the particular session you wish to delete.
127+ - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
129128
130129#### lambdaAutomationClient.updateSessionById(sessionId, requestBody, callback)
131130
132131To rename a test session or to update a test session as "passed" or "failed".
133132
134- - ` sessionId ` - ID of the particular session you wish to rename.
135- - ` requestBody ` - Object(name, status_ind).
136- - ` name ` - Changed name
137- - ` status_ind ` - Updated status(passed/failed)
138- - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
133+ - ` sessionId ` - ID of the particular session you wish to rename.
134+ - ` requestBody ` - Object(name, status_ind).
135+ - ` name ` - Changed name
136+ - ` status_ind ` - Updated status(passed/failed)
137+ - ` callback ` (` function(error, session) ` ): A callback to invoke when the API call is complete.
139138
140139#### lambdaAutomationClient.fetchSessionScreenshot(sessionId, callback)
141140
142141To extract step-by-step screenshot of a particular test session. The screenshots would be fetched in the zip format.
143142
144- - ` sessionId ` - ID of the particular session for which you wish to fetch step-by-step screenshots.
145- - ` callback ` (` function(error, screenshots) ` ): A callback to invoke when the API call is complete.
143+ - ` sessionId ` - ID of the particular session for which you wish to fetch step-by-step screenshots.
144+ - ` callback ` (` function(error, screenshots) ` ): A callback to invoke when the API call is complete.
146145
147146#### lambdaAutomationClient.fetchSessionVideo(sessionId, callback)
148147
149148To fetch a recorded video of your test session.
150149
151- - ` sessionId ` - ID of the particular session for which you wish to fetch the recorded video.
152- - ` callback ` (` function(error, video) ` ): A callback to invoke when the API call is complete.
150+ - ` sessionId ` - ID of the particular session for which you wish to fetch the recorded video.
151+ - ` callback ` (` function(error, video) ` ): A callback to invoke when the API call is complete.
153152
154153#### lambdaAutomationClient.fetchSessionCommandLogs(sessionId, callback)
155154
156155To fetch the entire command logs of a test session in plain JSON text.
157156
158- - ` sessionId ` - ID of the particular session for which you wish to fetch the command logs.
159- - ` callback ` (` function(error, commandLogs) ` ): A callback to invoke when the API call is complete.
157+ - ` sessionId ` - ID of the particular session for which you wish to fetch the command logs.
158+ - ` callback ` (` function(error, commandLogs) ` ): A callback to invoke when the API call is complete.
160159
161160#### lambdaAutomationClient.fetchSessionNetworkLogs(sessionId, callback)
162161
163162To fetch every response and request recieved by the Selenium Grid for a particular test session in plain JSON text.
164163
165- - ` sessionId ` - ID of the particular session for which you wish to fetch the Selenium logs.
166- - ` callback ` (` function(error, networkLogs) ` ): A callback to invoke when the API call is complete.
164+ - ` sessionId ` - ID of the particular session for which you wish to fetch the Selenium logs.
165+ - ` callback ` (` function(error, networkLogs) ` ): A callback to invoke when the API call is complete.
167166
168167#### lambdaAutomationClient.fetchSessionConsoleLogs(sessionId, callback)
169168
170169To fetch all of the console errors thrown throughout interation between web-application and Selenium script for a particular test session in plain JSON text.
171170To fetch all of the console errors for a particular test session in plain JSON text.
172171
173- - ` sessionId ` - ID of the particular session for which you wish to fetch the console logs.
174- - ` callback ` (` function(error, consoleLogs) ` ): A callback to invoke when the API call is complete.
172+ - ` sessionId ` - ID of the particular session for which you wish to fetch the console logs.
173+ - ` callback ` (` function(error, consoleLogs) ` ): A callback to invoke when the API call is complete.
175174
176175Tunnel Object
177176This object is dedicated to represent information regarding the Lambda Tunnel for performing automated cross browser testing of your locally hosted web-apps.
@@ -180,22 +179,29 @@ This object is dedicated to represent information regarding the Lambda Tunnel fo
180179
181180To fetch the entire list of active tunnels in your account.
182181
183- - ` callback ` (` function(error, tunnels) ` ): A callback to invoke when the API call is complete.
182+ - ` callback ` (` function(error, tunnels) ` ): A callback to invoke when the API call is complete.
184183
185184#### lambdaAutomationClient.deleteTunnelById(tunnelId, callback)
186185
187186To delete a particular Lambda Tunnel running in your account.
188187
189- - ` tunnelId ` - ID of the particular Tunnel for which you wish to delete.
190- - ` callback ` (` function(error, tunnel) ` ): A callback to invoke when the API call is complete.
188+ - ` tunnelId ` - ID of the particular Tunnel for which you wish to delete.
189+ - ` callback ` (` function(error, tunnel) ` ): A callback to invoke when the API call is complete.
191190
192191Platform Object
193192
194193#### lambdaAutomationClient.fetchPlatforms(callback)
195194
196195To fetch syntax for every browser and browser version offered by LambdaTest.
197196
198- - ` callback ` (` function(error, platforms) ` ): A callback to invoke when the API call is complete.
197+ - ` callback ` (` function(error, platforms) ` ): A callback to invoke when the API call is complete.
198+
199+ #### lambdaAutomationClient.fetchCyEnhancedReport(testID, callback)
200+
201+ To fetch enhanced cypress report.
202+
203+ - ` testID ` - Test ID of the particular test whose detailed report is to be fetched.
204+ - ` callback ` (` function(error, report) ` ): A callback to invoke when the API call is complete.
199205
200206## About LambdaTest
201207
0 commit comments