@dev-blinq/cucumber_client 1.0.1328-dev → 1.0.1329-dev
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.
|
@@ -197,9 +197,9 @@ export class BVTRecorder {
|
|
|
197
197
|
console.log("Sending cmdExecutionSuccess event for cmdId:", data);
|
|
198
198
|
this.sendEvent(this.events.cmdExecutionSuccess, data);
|
|
199
199
|
break;
|
|
200
|
-
case "
|
|
201
|
-
console.log("Sending
|
|
202
|
-
this.sendEvent(this.events.
|
|
200
|
+
case "cmdExecutionError":
|
|
201
|
+
console.log("Sending cmdExecutionError event for cmdId:", data);
|
|
202
|
+
this.sendEvent(this.events.cmdExecutionError, data);
|
|
203
203
|
break;
|
|
204
204
|
case "interceptResults":
|
|
205
205
|
console.log("Sending interceptResults event");
|
|
@@ -230,7 +230,7 @@ export class BVTRecorder {
|
|
|
230
230
|
onGoto: "BVTRecorder.onGoto",
|
|
231
231
|
cmdExecutionStart: "BVTRecorder.cmdExecutionStart",
|
|
232
232
|
cmdExecutionSuccess: "BVTRecorder.cmdExecutionSuccess",
|
|
233
|
-
|
|
233
|
+
cmdExecutionError: "BVTRecorder.cmdExecutionError",
|
|
234
234
|
interceptResults: "BVTRecorder.interceptResults",
|
|
235
235
|
};
|
|
236
236
|
bindings = {
|
|
@@ -157,35 +157,12 @@ export class BVTStepRunner {
|
|
|
157
157
|
this.sendExecutionStatus({
|
|
158
158
|
type: "cmdExecutionError",
|
|
159
159
|
cmdId: body.cmdId,
|
|
160
|
-
error:
|
|
160
|
+
error: {
|
|
161
|
+
message: result.message,
|
|
162
|
+
info,
|
|
163
|
+
},
|
|
161
164
|
});
|
|
162
165
|
}
|
|
163
|
-
// if (body && body.payload) {
|
|
164
|
-
// const payload = body.payload;
|
|
165
|
-
// const content = payload.content;
|
|
166
|
-
// const type = payload.type;
|
|
167
|
-
// if (type === "cmdReport") {
|
|
168
|
-
// if (content) {
|
|
169
|
-
// const report = JSON.parse(content);
|
|
170
|
-
// switch (report.status) {
|
|
171
|
-
// case "start":
|
|
172
|
-
// this.sendExecutionStatus({
|
|
173
|
-
// type: "cmdExecutionStart",
|
|
174
|
-
// cmdId: report.cmdId,
|
|
175
|
-
// });
|
|
176
|
-
// break;
|
|
177
|
-
// case "end":
|
|
178
|
-
// this.sendExecutionStatus({
|
|
179
|
-
// type: "cmdExecutionSuccess",
|
|
180
|
-
// cmdId: report.cmdId,
|
|
181
|
-
// });
|
|
182
|
-
// break;
|
|
183
|
-
// default:
|
|
184
|
-
// console.warn("Unknown command report status:", report.status);
|
|
185
|
-
// }
|
|
186
|
-
// }
|
|
187
|
-
// }
|
|
188
|
-
// }
|
|
189
166
|
} else if (attachment.mediaType === "application/json+intercept-results" && attachment.body) {
|
|
190
167
|
const body = JSON.parse(attachment.body);
|
|
191
168
|
if (body) {
|
|
@@ -71,7 +71,6 @@ function makeStepTextUnique(step, stepsDefinitions) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export async function saveRecording({ step, cucumberStep, codePage, projectDir, stepsDefinitions }) {
|
|
74
|
-
|
|
75
74
|
let routesPath = path.join(tmpdir(), "blinq_temp_routes");
|
|
76
75
|
|
|
77
76
|
if (process.env.TEMP_RUN) {
|
|
@@ -111,7 +110,7 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
|
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
|
|
113
|
+
|
|
115
114
|
if (process.env.TEMP_RUN === "true") {
|
|
116
115
|
console.log("Save routes in temp folder for running:", routesPath);
|
|
117
116
|
if (existsSync(routesPath)) {
|
|
@@ -388,6 +387,34 @@ export async function updateStepDefinitions({ scenario, featureName, projectDir
|
|
|
388
387
|
}
|
|
389
388
|
}
|
|
390
389
|
if ((step.isImplemented && !step.shouldOverride) || step.commands.length === 0) {
|
|
390
|
+
let routesPath = path.join(tmpdir(), `blinq_temp_routes`);
|
|
391
|
+
if (process.env.TEMP_RUN === "true") {
|
|
392
|
+
console.log("Save routes in temp folder for running:", routesPath);
|
|
393
|
+
if (existsSync(routesPath)) {
|
|
394
|
+
console.log("Removing existing temp_routes_folder:", routesPath);
|
|
395
|
+
rmSync(routesPath, { recursive: true });
|
|
396
|
+
}
|
|
397
|
+
mkdirSync(routesPath, { recursive: true });
|
|
398
|
+
console.log("Created temp_routes_folder:", routesPath);
|
|
399
|
+
saveRoutes({ step, folderPath: routesPath });
|
|
400
|
+
} else {
|
|
401
|
+
console.log("Saving routes in project directory:", projectDir);
|
|
402
|
+
if (existsSync(routesPath)) {
|
|
403
|
+
// remove the folder
|
|
404
|
+
try {
|
|
405
|
+
rmSync(routesPath, { recursive: true });
|
|
406
|
+
console.log("Removed temp_routes_folder:", routesPath);
|
|
407
|
+
} catch (error) {
|
|
408
|
+
console.error("Error removing temp_routes folder", error);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
routesPath = path.join(projectDir, "data", "routes");
|
|
412
|
+
console.log("Saving routes to:", routesPath);
|
|
413
|
+
if (!existsSync(routesPath)) {
|
|
414
|
+
mkdirSync(routesPath, { recursive: true });
|
|
415
|
+
}
|
|
416
|
+
saveRoutes({ step, folderPath: routesPath });
|
|
417
|
+
}
|
|
391
418
|
continue;
|
|
392
419
|
}
|
|
393
420
|
const cucumberStep = getCucumberStep({ step });
|