@dev-blinq/cucumber_client 1.0.1599-dev → 1.0.1601-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.
|
@@ -204,10 +204,18 @@ export class BVTRecorder {
|
|
|
204
204
|
this.shouldTakeScreenshot = true;
|
|
205
205
|
this.watcher = null;
|
|
206
206
|
this.networkEventsFolder = path.join(tmpdir(), "blinq_network_events");
|
|
207
|
-
|
|
208
207
|
this.tempProjectFolder = `${tmpdir()}/bvt_temp_project_${Math.floor(Math.random() * 1000000)}`;
|
|
209
208
|
this.tempSnapshotsFolder = path.join(this.tempProjectFolder, "data/snapshots");
|
|
210
|
-
|
|
209
|
+
if (process.env.REMOTE_RECORDER === "true") {
|
|
210
|
+
this.browserEmitter = new RemoteBrowserService({
|
|
211
|
+
CDP_CONNECT_URL: `http://localhost:${this.#remoteDebuggerPort}`,
|
|
212
|
+
context: this.context,
|
|
213
|
+
});
|
|
214
|
+
this.browserEmitter.on(this.events.browserStateSync, (state) => {
|
|
215
|
+
// this.page = this.browserEmitter.getSelectedPage();
|
|
216
|
+
this.sendEvent(this.events.browserStateSync, state);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
211
219
|
if (existsSync(this.networkEventsFolder)) {
|
|
212
220
|
rmSync(this.networkEventsFolder, { recursive: true, force: true });
|
|
213
221
|
}
|
|
@@ -675,16 +683,6 @@ export class BVTRecorder {
|
|
|
675
683
|
await this._initBrowser({ url });
|
|
676
684
|
await this._openTab({ url });
|
|
677
685
|
process.env.TEMP_RUN = true;
|
|
678
|
-
if (process.env.REMOTE_RECORDER === "true") {
|
|
679
|
-
this.browserEmitter = new RemoteBrowserService({
|
|
680
|
-
CDP_CONNECT_URL: `http://localhost:${this.#remoteDebuggerPort}`,
|
|
681
|
-
context: this.context,
|
|
682
|
-
});
|
|
683
|
-
this.browserEmitter.on(this.events.browserStateSync, (state) => {
|
|
684
|
-
// this.page = this.browserEmitter.getSelectedPage();
|
|
685
|
-
this.sendEvent(this.events.browserStateSync, state);
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
686
|
}
|
|
689
687
|
overlayLocators(event) {
|
|
690
688
|
let locatorsResults = [...event.locators];
|
|
@@ -831,10 +829,6 @@ export class BVTRecorder {
|
|
|
831
829
|
this.previousHistoryLength = null;
|
|
832
830
|
this.previousUrl = null;
|
|
833
831
|
this.previousEntries = null;
|
|
834
|
-
if (this.browserEmitter) {
|
|
835
|
-
this.browserEmitter.destroy();
|
|
836
|
-
this.browserEmitter = null; // Clear the reference
|
|
837
|
-
}
|
|
838
832
|
await closeContext();
|
|
839
833
|
this.pageSet.clear();
|
|
840
834
|
}
|