artes 1.0.55 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artes",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.56",
|
|
4
4
|
"description": "The package provide step definitions and user writes feature files, and the package handles automation, with optional POM files and custom step definitions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -39,7 +39,8 @@ function createProject(createYes) {
|
|
|
39
39
|
headless: false, // Set to true for headless browser mode
|
|
40
40
|
|
|
41
41
|
// Configuration options:
|
|
42
|
-
//
|
|
42
|
+
// env: "", // string - Environment name for tests
|
|
43
|
+
// baseURL: "", // string - Base URL for API tests
|
|
43
44
|
// paths: [], // string[] - Paths to feature files
|
|
44
45
|
// steps: "", // string - Step definitions files
|
|
45
46
|
// pomPath: "", // string - Path to POM files
|
|
@@ -80,33 +80,43 @@ const api = {
|
|
|
80
80
|
const res = await context.request.get(resolvedURL, {
|
|
81
81
|
headers: payloadJSON ? payloadJSON.headers : {},
|
|
82
82
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
response
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
|
|
84
|
+
try{
|
|
85
|
+
const header = await res.headers();
|
|
86
|
+
const body = await res.json();
|
|
87
|
+
|
|
88
|
+
const response = {
|
|
89
|
+
url: res.url(),
|
|
90
|
+
response: res,
|
|
91
|
+
responseHeaders: header,
|
|
92
|
+
responseBody: body,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
context.response = response;
|
|
96
|
+
}catch(error) {
|
|
97
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
98
|
+
}
|
|
94
99
|
},
|
|
95
100
|
head: async (url) => {
|
|
96
101
|
const URL = await selector(url);
|
|
97
102
|
const resolvedURL = await resolveVariable(URL);
|
|
98
103
|
|
|
99
104
|
const res = await context.request.head(resolvedURL);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
response
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
|
|
106
|
+
try{
|
|
107
|
+
const header = await res.headers();
|
|
108
|
+
|
|
109
|
+
const response = {
|
|
110
|
+
url: res.url(),
|
|
111
|
+
response: res,
|
|
112
|
+
responseHeaders: header,
|
|
113
|
+
responseBody: body,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
context.response = response;
|
|
117
|
+
}catch(error) {
|
|
118
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
119
|
+
}
|
|
110
120
|
},
|
|
111
121
|
post: async (url, payload, bodyType) => {
|
|
112
122
|
const URL = await selector(url);
|
|
@@ -136,19 +146,24 @@ const api = {
|
|
|
136
146
|
|
|
137
147
|
const res = await context.request.post(resolvedURL, requestBody);
|
|
138
148
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
try{
|
|
150
|
+
const header = await res.headers();
|
|
151
|
+
const body = await res.json();
|
|
152
|
+
|
|
153
|
+
const response = {
|
|
154
|
+
url: res.url(),
|
|
155
|
+
requestHeaders: payloadJSON.headers,
|
|
156
|
+
requestBody: payloadJSON.body,
|
|
157
|
+
response: res,
|
|
158
|
+
responseHeaders: header,
|
|
159
|
+
responseBody: body,
|
|
160
|
+
};
|
|
161
|
+
context.response = response;
|
|
162
|
+
}catch(error) {
|
|
163
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
164
|
+
}
|
|
165
|
+
|
|
150
166
|
|
|
151
|
-
context.response = response;
|
|
152
167
|
},
|
|
153
168
|
put: async (url, payload, bodyType) => {
|
|
154
169
|
const URL = await selector(url);
|
|
@@ -178,19 +193,22 @@ const api = {
|
|
|
178
193
|
|
|
179
194
|
const res = await context.request.put(resolvedURL, requestBody);
|
|
180
195
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
196
|
+
try{
|
|
197
|
+
const header = await res.headers();
|
|
198
|
+
const body = await res.json();
|
|
199
|
+
|
|
200
|
+
const response = {
|
|
201
|
+
url: res.url(),
|
|
202
|
+
requestHeaders: payloadJSON.headers,
|
|
203
|
+
requestBody: payloadJSON.body,
|
|
204
|
+
response: res,
|
|
205
|
+
responseHeaders: header,
|
|
206
|
+
responseBody: body,
|
|
207
|
+
};
|
|
208
|
+
context.response = response;
|
|
209
|
+
}catch(error) {
|
|
210
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
211
|
+
}
|
|
194
212
|
},
|
|
195
213
|
patch: async (url, payload, bodyType) => {
|
|
196
214
|
const URL = await selector(url);
|
|
@@ -220,19 +238,22 @@ const api = {
|
|
|
220
238
|
|
|
221
239
|
const res = await context.request.patch(resolvedURL, requestBody);
|
|
222
240
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
241
|
+
try{
|
|
242
|
+
const header = await res.headers();
|
|
243
|
+
const body = await res.json();
|
|
244
|
+
|
|
245
|
+
const response = {
|
|
246
|
+
url: res.url(),
|
|
247
|
+
requestHeaders: payloadJSON.headers,
|
|
248
|
+
requestBody: payloadJSON.body,
|
|
249
|
+
response: res,
|
|
250
|
+
responseHeaders: header,
|
|
251
|
+
responseBody: body,
|
|
252
|
+
};
|
|
253
|
+
context.response = response;
|
|
254
|
+
}catch(error) {
|
|
255
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
256
|
+
}
|
|
236
257
|
},
|
|
237
258
|
delete: async (url, payload) => {
|
|
238
259
|
const URL = await selector(url);
|
|
@@ -245,17 +266,23 @@ const api = {
|
|
|
245
266
|
headers: payloadJSON.headers,
|
|
246
267
|
});
|
|
247
268
|
|
|
248
|
-
const header = await res.headers();
|
|
249
|
-
const body = await res.json();
|
|
250
269
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
270
|
+
try{
|
|
271
|
+
const header = await res.headers();
|
|
272
|
+
const body = await res.json();
|
|
273
|
+
|
|
274
|
+
const response = {
|
|
275
|
+
url: res.url(),
|
|
276
|
+
response: res,
|
|
277
|
+
responseHeaders: header,
|
|
278
|
+
responseBody: body,
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
context.response = response;
|
|
282
|
+
}catch(error) {
|
|
283
|
+
throw new Error(`Error processing response: ${error.message}`);
|
|
284
|
+
}
|
|
257
285
|
|
|
258
|
-
context.response = response;
|
|
259
286
|
},
|
|
260
287
|
vars: () => {
|
|
261
288
|
return context.vars;
|