@dev-blinq/cucumber_client 1.0.1534-dev → 1.0.1536-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.
|
@@ -67,6 +67,19 @@ class PromisifiedSocketServer {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
const timeOutForFunction = async (promise, timeout = 5000) => {
|
|
71
|
+
const timeoutPromise = new Promise((resolve) => setTimeout(() => resolve(), timeout));
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const res = await Promise.race([promise, timeoutPromise]);
|
|
75
|
+
return res;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error(error);
|
|
78
|
+
socketLogger.error(error);
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
70
83
|
async function BVTRecorderInit({ envName, projectDir, roomId, TOKEN }) {
|
|
71
84
|
console.log("Connecting to " + WS_URL);
|
|
72
85
|
const socket = io(WS_URL);
|
|
@@ -90,28 +103,20 @@ async function BVTRecorderInit({ envName, projectDir, roomId, TOKEN }) {
|
|
|
90
103
|
},
|
|
91
104
|
logger: socketLogger,
|
|
92
105
|
});
|
|
93
|
-
|
|
94
|
-
.openBrowser()
|
|
95
|
-
.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.catch((e) => {
|
|
106
|
+
try {
|
|
107
|
+
await recorder.openBrowser();
|
|
108
|
+
socketLogger.info("BVTRecorder.browserOpened");
|
|
109
|
+
socket.emit("BVTRecorder.browserOpened", null, roomId);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
if (e instanceof Error) {
|
|
100
112
|
socketLogger.error("BVTRecorder.browserLaunchFailed", e);
|
|
101
113
|
socket.emit("BVTRecorder.browserLaunchFailed", e, roomId);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
try {
|
|
107
|
-
const res = await Promise.race([promise, timeoutPromise]);
|
|
108
|
-
return res;
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.error(error);
|
|
111
|
-
socketLogger.error(error);
|
|
112
|
-
throw error;
|
|
114
|
+
} else {
|
|
115
|
+
socketLogger.error("BVTRecorder.browserLaunchFailed", JSON.stringify(e));
|
|
116
|
+
socket.emit("BVTRecorder.browserLaunchFailed", JSON.stringify(e), roomId);
|
|
113
117
|
}
|
|
114
|
-
|
|
118
|
+
console.error("Browser launch failed", e);
|
|
119
|
+
}
|
|
115
120
|
|
|
116
121
|
const promisifiedSocketServer = new PromisifiedSocketServer(socket, {
|
|
117
122
|
"recorderWindow.openBrowser": async (input) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-blinq/cucumber_client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1536-dev",
|
|
4
4
|
"description": " ",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@cucumber/tag-expressions": "^6.1.1",
|
|
40
40
|
"@dev-blinq/cucumber-js": "1.0.195-dev",
|
|
41
41
|
"@faker-js/faker": "^8.4.1",
|
|
42
|
-
"automation_model": "1.0.
|
|
42
|
+
"automation_model": "1.0.878-dev",
|
|
43
43
|
"axios": "^1.7.4",
|
|
44
44
|
"chokidar": "^3.6.0",
|
|
45
45
|
"create-require": "^1.1.1",
|