@dev-blinq/cucumber_client 1.0.1227-dev → 1.0.1228-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.
@@ -16,6 +16,7 @@ import chokidar from "chokidar";
16
16
  import logger from "../../logger.js";
17
17
  import { unEscapeNonPrintables } from "../cucumber/utils.js";
18
18
  import { findAvailablePort } from "../utils/index.js";
19
+ import { getAiConfig } from "../code_gen/page_reflection.js";
19
20
  const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
20
21
  const { source: injectedScriptSource } = pkg;
21
22
  const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
@@ -491,8 +492,14 @@ export class BVTRecorder {
491
492
  if (!transition) return;
492
493
  // console.log("transitionType", transition.transitionType);
493
494
  if (this.userInitiatedTranistionTypes.includes(transition.transitionType)) {
495
+ const env = JSON.parse(readFileSync(this.envName), "utf8");
496
+ const baseUrl = env.baseUrl;
497
+ let url = transition.userTypedURL;
498
+ if (baseUrl && url.startsWith(baseUrl)) {
499
+ url = url.replace(baseUrl, "{{env.baseUrl}}");
500
+ }
494
501
  // console.log("User initiated transition");
495
- this.sendEvent(this.events.onGoto, { url: transition.userTypedURL });
502
+ this.sendEvent(this.events.onGoto, { url });
496
503
  }
497
504
  }
498
505
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1227-dev",
3
+ "version": "1.0.1228-dev",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",