@dev-blinq/cucumber_client 1.0.1570-dev → 1.0.1572-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.
@@ -354,16 +354,7 @@ export class BVTRecorder {
354
354
  this.web.tryAllStrategies = true;
355
355
  this.page = bvtContext.page;
356
356
  this.pageSet.add(this.page);
357
- if (process.env.REMOTE_RECORDER === "true") {
358
- this.browserEmitter = new RemoteBrowserService({
359
- CDP_CONNECT_URL: `http://localhost:${this.#remoteDebuggerPort}`,
360
- context: this.context,
361
- });
362
- this.browserEmitter.on(this.events.browserStateSync, (state) => {
363
- this.page = this.browserEmitter.getSelectedPage();
364
- this.sendEvent(this.events.browserStateSync, state);
365
- });
366
- }
357
+
367
358
  this.lastKnownUrlPath = this._updateUrlPath();
368
359
  const browser = await this.context.browser();
369
360
  this.browser = browser;
@@ -664,6 +655,16 @@ export class BVTRecorder {
664
655
  await this._initBrowser({ url });
665
656
  await this._openTab({ url });
666
657
  process.env.TEMP_RUN = true;
658
+ if (process.env.REMOTE_RECORDER === "true") {
659
+ this.browserEmitter = new RemoteBrowserService({
660
+ CDP_CONNECT_URL: `http://localhost:${this.#remoteDebuggerPort}`,
661
+ context: this.context,
662
+ });
663
+ this.browserEmitter.on(this.events.browserStateSync, (state) => {
664
+ this.page = this.browserEmitter.getSelectedPage();
665
+ this.sendEvent(this.events.browserStateSync, state);
666
+ });
667
+ }
667
668
  }
668
669
  overlayLocators(event) {
669
670
  let locatorsResults = [...event.locators];
@@ -721,7 +722,7 @@ export class BVTRecorder {
721
722
  const { id, contextId, doc } = snapshotDetails;
722
723
  // const selector = `[data-blinq-id="${id}"]`;
723
724
  const newPage = await this.backgroundContext.newPage();
724
- await newPage.setContent(doc);
725
+ await newPage.setContent(doc, { waitUntil: "domcontentloaded" });
725
726
  const locatorsObj = await newPage.evaluate(
726
727
  ([id, contextId, mode]) => {
727
728
  const recorder = window.__bvt_Recorder;
@@ -22,13 +22,6 @@ export class NamesService {
22
22
  }
23
23
  const url = `${getRunsServiceBaseURL()}/generate-step-information/generate`;
24
24
  const TIMEOUT = 120; // 2 minutes
25
- //!REMOVE LOG AFTER TESTING
26
- console.log("Generating step name with data:", {
27
- commands,
28
- stepsNames,
29
- parameters,
30
- map,
31
- }, "and TOKEN:", this.TOKEN);
32
25
  const { data } = await axiosClient({
33
26
  url,
34
27
  method: "POST",
@@ -168,20 +161,16 @@ export class RemoteBrowserService extends EventEmitter {
168
161
  async initializeListeners() {
169
162
  // Listen for new pages
170
163
  this.context.on("page", async (page) => {
171
- console.log("New page detected");
172
164
  const id = await this.getPageId(page);
173
165
  if (id) {
174
166
  this.pages.set(id, page);
175
- console.log(`Page added: ${id}`);
176
167
  await this.syncState();
177
168
  }
178
169
  // Listen for page updates
179
170
  page.on("load", async () => {
180
- console.log("Page loaded");
181
171
  await this.syncState();
182
172
  });
183
173
  page.on("close", async () => {
184
- console.log(`Page closed: ${id}`);
185
174
  if (id) {
186
175
  this.pages.delete(id);
187
176
  if (this._selectedPageId === id) {
@@ -195,13 +184,14 @@ export class RemoteBrowserService extends EventEmitter {
195
184
  });
196
185
  // Initialize with existing pages
197
186
  const existingPages = this.context.pages();
198
- console.log(`Initializing with ${existingPages.length} existing pages`);
199
187
  for (const page of existingPages) {
200
188
  const id = await this.getPageId(page);
201
189
  if (id) {
202
190
  this.pages.set(id, page);
203
- console.log(`Existing page registered: ${id}`);
204
191
  }
192
+ page.on("framenavigated", async () => {
193
+ await this.syncState();
194
+ });
205
195
  }
206
196
  // Set initial selected page
207
197
  if (this.pages.size > 0 && !this._selectedPageId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1570-dev",
3
+ "version": "1.0.1572-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",