@dev-blinq/cucumber_client 1.0.1366-stage → 1.0.1367-stage
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/bin/client/recorderv3/bvt_init.js +325 -0
- package/bin/client/recorderv3/bvt_recorder.js +62 -4
- package/bin/client/recorderv3/index.js +4 -308
- package/bin/client/recorderv3/services.js +426 -204
- package/bin/client/recorderv3/step_utils.js +3 -9
- package/bin/client/recorderv3/wbr_entry.js +29 -0
- package/bin/index.js +1 -1
- package/package.json +1 -1
|
@@ -509,9 +509,9 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
|
|
|
509
509
|
// remove the folder
|
|
510
510
|
try {
|
|
511
511
|
rmSync(routesPath, { recursive: true });
|
|
512
|
-
|
|
512
|
+
//
|
|
513
513
|
} catch (error) {
|
|
514
|
-
|
|
514
|
+
//
|
|
515
515
|
}
|
|
516
516
|
routesPath = path.join(projectDir, "data", "routes");
|
|
517
517
|
if (!existsSync(routesPath)) {
|
|
@@ -538,27 +538,21 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
|
|
|
538
538
|
|
|
539
539
|
routesPath = path.join(tmpdir(), "blinq_temp_routes");
|
|
540
540
|
if (process.env.TEMP_RUN === "true") {
|
|
541
|
-
console.log("Save routes in temp folder for running:", routesPath);
|
|
542
541
|
if (existsSync(routesPath)) {
|
|
543
|
-
console.log("Removing existing temp_routes_folder:", routesPath);
|
|
544
542
|
rmSync(routesPath, { recursive: true });
|
|
545
543
|
}
|
|
546
544
|
mkdirSync(routesPath, { recursive: true });
|
|
547
|
-
console.log("Created temp_routes_folder:", routesPath);
|
|
548
545
|
saveRoutes({ step, folderPath: routesPath });
|
|
549
546
|
} else {
|
|
550
|
-
console.log("Saving routes in project directory:", projectDir);
|
|
551
547
|
if (existsSync(routesPath)) {
|
|
552
548
|
// remove the folder
|
|
553
549
|
try {
|
|
554
550
|
rmSync(routesPath, { recursive: true });
|
|
555
|
-
console.log("Removed temp_routes_folder:", routesPath);
|
|
556
551
|
} catch (error) {
|
|
557
|
-
|
|
552
|
+
//
|
|
558
553
|
}
|
|
559
554
|
}
|
|
560
555
|
routesPath = path.join(projectDir, "data", "routes");
|
|
561
|
-
console.log("Saving routes to:", routesPath);
|
|
562
556
|
if (!existsSync(routesPath)) {
|
|
563
557
|
mkdirSync(routesPath, { recursive: true });
|
|
564
558
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { io } from "socket.io-client";
|
|
2
|
+
import { BVTRecorderInit } from "./bvt_init";
|
|
3
|
+
const requiredEnvVars = ["PROJECT_ID", "BLINQ_TOKEN", "SESSION_ID", "WORKER_WS_SERVER_URL"];
|
|
4
|
+
function validateEnvVariables() {
|
|
5
|
+
const missingVars = requiredEnvVars.filter((varName) => !process.env[varName]);
|
|
6
|
+
if (missingVars.length > 0) {
|
|
7
|
+
throw new Error(`Missing required environment variables: ${missingVars.join(", ")}`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const socket = io(process.env.WORKER_WS_SERVER_URL, {
|
|
11
|
+
path: "/ws",
|
|
12
|
+
transports: ["websocket", "polling"],
|
|
13
|
+
reconnection: true,
|
|
14
|
+
});
|
|
15
|
+
function initWebBVTRecorder(socket) {
|
|
16
|
+
validateEnvVariables();
|
|
17
|
+
const WORKER_WS_SERVER_URL = process.env.WORKER_WS_SERVER_URL;
|
|
18
|
+
const PROJECT_ID = process.env.PROJECT_ID;
|
|
19
|
+
const TOKEN = process.env.BLINQ_TOKEN;
|
|
20
|
+
const ROOM_ID = process.env.SESSION_ID;
|
|
21
|
+
BVTRecorderInit({
|
|
22
|
+
envName: WORKER_WS_SERVER_URL,
|
|
23
|
+
projectDir: PROJECT_ID,
|
|
24
|
+
roomId: ROOM_ID,
|
|
25
|
+
TOKEN: TOKEN,
|
|
26
|
+
socket: socket,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
initWebBVTRecorder(socket);
|
package/bin/index.js
CHANGED
|
@@ -18,4 +18,4 @@ export * from "./client/code_cleanup/utils.js";
|
|
|
18
18
|
export * from "./client/code_cleanup/find_step_definition_references.js";
|
|
19
19
|
|
|
20
20
|
export * from "./client/recorderv3/step_utils.js";
|
|
21
|
-
export * from "./client/recorderv3/update_feature.js";
|
|
21
|
+
export * from "./client/recorderv3/update_feature.js/bvt_init.js";
|