1
1
![ LambdaTest Logo] ( https://www.lambdatest.com/static/images/logo.svg )
2
2
3
3
# Node LambdaTest
4
+
4
5
[ ![ npm version] ( https://badge.fury.io/js/%40lambdatest%2Fnode-rest-client.svg )] ( https://badge.fury.io/js/%40lambdatest%2Fnode-rest-client )
5
6
6
7
A 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
16
17
``` js
17
18
var lambdaRestClient = require (" @lambdatest/node-rest-client" );
18
19
var 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>" ,
21
22
};
22
23
23
24
// 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
+ }
32
31
});
33
32
```
34
33
@@ -40,10 +39,10 @@ lambdaAutomationClient.fetchBuilds(function(error, builds) {
40
39
41
40
Creates a new automation client instance.
42
41
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
47
46
48
47
Build Object
49
48
This 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.
52
51
53
52
Fetch all the details regarding test builds.
54
53
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.
63
62
64
63
#### lambdaAutomationClient.fetchBuildById(buildId, callback)
65
64
@@ -69,24 +68,24 @@ Fetch all the details of a particular test build by ID. Details would include:
69
68
2 . Number of tests executed
70
69
3 . User who executed the build
71
70
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.
74
73
75
74
#### lambdaAutomationClient.deleteBuildById(buildId, callback)
76
75
77
76
To delete a particular build from your automation dashboard.
78
77
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.
81
80
82
81
#### lambdaAutomationClient.updateBuildById(buildId, requestBody, callback)
83
82
84
83
To rename a test build.
85
84
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.
90
89
91
90
Session Object
92
91
This 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
95
94
96
95
Fetch all the details regarding test sessions.
97
96
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.
108
107
109
108
#### lambdaAutomationClient.fetchSessionById(sessionId, callback)
110
109
@@ -117,61 +116,61 @@ Fetch all the details of a particular test session by ID. Details that are fetch
117
116
5 . Browser version
118
117
6 . All generated logs endpoint
119
118
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.
122
121
123
122
#### lambdaAutomationClient.deleteSessionById(sessionId, callback)
124
123
125
124
To delete a particular session from your automation dashboard.
126
125
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.
129
128
130
129
#### lambdaAutomationClient.updateSessionById(sessionId, requestBody, callback)
131
130
132
131
To rename a test session or to update a test session as "passed" or "failed".
133
132
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.
139
138
140
139
#### lambdaAutomationClient.fetchSessionScreenshot(sessionId, callback)
141
140
142
141
To extract step-by-step screenshot of a particular test session. The screenshots would be fetched in the zip format.
143
142
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.
146
145
147
146
#### lambdaAutomationClient.fetchSessionVideo(sessionId, callback)
148
147
149
148
To fetch a recorded video of your test session.
150
149
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.
153
152
154
153
#### lambdaAutomationClient.fetchSessionCommandLogs(sessionId, callback)
155
154
156
155
To fetch the entire command logs of a test session in plain JSON text.
157
156
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.
160
159
161
160
#### lambdaAutomationClient.fetchSessionNetworkLogs(sessionId, callback)
162
161
163
162
To fetch every response and request recieved by the Selenium Grid for a particular test session in plain JSON text.
164
163
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.
167
166
168
167
#### lambdaAutomationClient.fetchSessionConsoleLogs(sessionId, callback)
169
168
170
169
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.
171
170
To fetch all of the console errors for a particular test session in plain JSON text.
172
171
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.
175
174
176
175
Tunnel Object
177
176
This 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
180
179
181
180
To fetch the entire list of active tunnels in your account.
182
181
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.
184
183
185
184
#### lambdaAutomationClient.deleteTunnelById(tunnelId, callback)
186
185
187
186
To delete a particular Lambda Tunnel running in your account.
188
187
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.
191
190
192
191
Platform Object
193
192
194
193
#### lambdaAutomationClient.fetchPlatforms(callback)
195
194
196
195
To fetch syntax for every browser and browser version offered by LambdaTest.
197
196
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.
199
205
200
206
## About LambdaTest
201
207
0 commit comments