@dev-blinq/cucumber_client 1.0.1450-dev → 1.0.1452-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.
@@ -15,6 +15,7 @@ import chokidar from "chokidar";
15
15
  import { unEscapeNonPrintables } from "../cucumber/utils.js";
16
16
  import { findAvailablePort } from "../utils/index.js";
17
17
  import socketLogger from "../utils/socket_logger.js";
18
+ import { tmpdir } from "os";
18
19
  const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
19
20
 
20
21
  const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
@@ -41,6 +42,7 @@ async function evaluate(frame, script) {
41
42
  }
42
43
 
43
44
  async function findNestedFrameSelector(frame, obj) {
45
+ console.log("Testing new version");
44
46
  try {
45
47
  const parent = frame.parentFrame();
46
48
  if (!parent) return { children: obj };
@@ -188,6 +190,10 @@ export class BVTRecorder {
188
190
  this.world = { attach: () => {} };
189
191
  this.shouldTakeScreenshot = true;
190
192
  this.watcher = null;
193
+ this.networkEventsFolder = path.join(tmpdir(), "blinq_network_events");
194
+ if (existsSync(this.networkEventsFolder)) {
195
+ rmSync(this.networkEventsFolder, { recursive: true, force: true });
196
+ }
191
197
  }
192
198
  events = {
193
199
  onFrameNavigate: "BVTRecorder.onFrameNavigate",
@@ -840,9 +846,9 @@ export class BVTRecorder {
840
846
  this.bvtContext.navigate = true;
841
847
  this.bvtContext.loadedRoutes = null;
842
848
  if (listenNetwork) {
843
- process.env.STORE_DETAILED_NETWORK_DATA = "true";
849
+ this.bvtContext.STORE_DETAILED_NETWORK_DATA = true;
844
850
  } else {
845
- process.env.STORE_DETAILED_NETWORK_DATA = "false";
851
+ this.bvtContext.STORE_DETAILED_NETWORK_DATA = false;
846
852
  }
847
853
  for (const [key, value] of Object.entries(_env)) {
848
854
  process.env[key] = value;
@@ -1223,4 +1229,10 @@ export class BVTRecorder {
1223
1229
  }
1224
1230
  return {};
1225
1231
  }
1232
+
1233
+ stopRecordingNetwork(input) {
1234
+ if (this.bvtContext) {
1235
+ this.bvtContext.STORE_DETAILED_NETWORK_DATA = false;
1236
+ }
1237
+ }
1226
1238
  }
@@ -265,6 +265,9 @@ const init = ({ envName, projectDir, roomId, TOKEN }) => {
265
265
  "recorderWindow.resetExecution": async (input) => {
266
266
  return await recorder.resetExecution(input);
267
267
  },
268
+ "recorderWindow.stopRecordingNetwork": async (input) => {
269
+ return recorder.stopRecordingNetwork(input);
270
+ },
268
271
  });
269
272
  socket.on("targetBrowser.command.event", async (input) => {
270
273
  return recorder.onAction(input);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1450-dev",
3
+ "version": "1.0.1452-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.184-dev",
41
41
  "@faker-js/faker": "^8.1.0",
42
- "automation_model": "1.0.839-dev",
42
+ "automation_model": "1.0.841-dev",
43
43
  "axios": "^1.7.4",
44
44
  "chokidar": "^3.6.0",
45
45
  "create-require": "^1.1.1",