@dev-blinq/cucumber_client 1.0.1526-dev → 1.0.1528-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.
- package/bin/client/recorderv3/index.js +27 -29
- package/bin/index.js +1 -0
- package/package.json +1 -1
|
@@ -68,7 +68,7 @@ class PromisifiedSocketServer {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
async function init({ envName, projectDir, roomId, TOKEN }) {
|
|
72
72
|
console.log("Connecting to " + WS_URL);
|
|
73
73
|
const socket = io(WS_URL);
|
|
74
74
|
socketLogger.init(socket, { context: "BVTRecorder", eventName: "BVTRecorder.log" });
|
|
@@ -291,38 +291,36 @@ const init = ({ envName, projectDir, roomId, TOKEN }) => {
|
|
|
291
291
|
return recorder.stopRecordingNetwork(input);
|
|
292
292
|
},
|
|
293
293
|
});
|
|
294
|
+
|
|
294
295
|
socket.on("targetBrowser.command.event", async (input) => {
|
|
295
296
|
return recorder.onAction(input);
|
|
296
297
|
});
|
|
297
298
|
promisifiedSocketServer.init();
|
|
298
|
-
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const isMainModule = import.meta.url === `file://${process.argv[1]}`;
|
|
299
302
|
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
303
|
+
if (isMainModule) {
|
|
304
|
+
const usage = `Usage: node bvt_recorder.js <projectDir> <envName> <roomId>`;
|
|
305
|
+
const args = loadArgs();
|
|
306
|
+
const projectDir = args[0];
|
|
307
|
+
const envName = args[1].split("=")[1];
|
|
308
|
+
const roomId = args[2];
|
|
309
|
+
const shouldTakeScreenshot = args[3];
|
|
310
|
+
const TOKEN = process.env.TOKEN;
|
|
311
|
+
|
|
312
|
+
try {
|
|
313
|
+
validateCLIArg(projectDir, "projectDir");
|
|
314
|
+
validateCLIArg(envName, "envName");
|
|
315
|
+
validateCLIArg(roomId, "roomId");
|
|
316
|
+
validateCLIArg(shouldTakeScreenshot, "shouldTakeScreenshot");
|
|
317
|
+
if (!TOKEN) {
|
|
318
|
+
throw new Error("TOKEN env variable not set");
|
|
319
|
+
}
|
|
320
|
+
} catch (error) {
|
|
321
|
+
showUsage(error, usage);
|
|
314
322
|
}
|
|
315
|
-
|
|
316
|
-
showUsage(error, usage);
|
|
317
|
-
}
|
|
318
|
-
try {
|
|
319
|
-
init({
|
|
320
|
-
envName,
|
|
321
|
-
projectDir,
|
|
322
|
-
roomId,
|
|
323
|
-
TOKEN,
|
|
324
|
-
shouldTakeScreenshot: shouldTakeScreenshot ? shouldTakeScreenshot === "true" : false,
|
|
325
|
-
});
|
|
326
|
-
} catch (error) {
|
|
327
|
-
console.error(error);
|
|
323
|
+
init({ envName, projectDir, roomId, TOKEN });
|
|
328
324
|
}
|
|
325
|
+
|
|
326
|
+
export { init as BVTRecorderInit };
|
package/bin/index.js
CHANGED