@aspiresys/visor 1.1.3 → 1.1.4

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.
package/dist/config.d.ts CHANGED
@@ -2,4 +2,5 @@ export declare const visorConfig: {
2
2
  scaleFactor: number;
3
3
  debug: boolean;
4
4
  imagePath: string;
5
+ outputPath: string;
5
6
  };
package/dist/config.js CHANGED
@@ -4,5 +4,6 @@ exports.visorConfig = void 0;
4
4
  exports.visorConfig = {
5
5
  scaleFactor: 1,
6
6
  debug: true,
7
- imagePath: ""
7
+ imagePath: "",
8
+ outputPath: ""
8
9
  };
package/dist/index.d.ts CHANGED
@@ -671,6 +671,27 @@ export declare class Visor {
671
671
  */
672
672
  getImagePath(): string;
673
673
  /**
674
+ * Sets the default output path
675
+ * used for visual automation APIs.
676
+ *
677
+ * @param path Output directory path.
678
+ *
679
+ * @example
680
+ * visor.setOutputPath("./images");
681
+ */
682
+ setOutputPath(path: string): void;
683
+ /**
684
+ * Returns the current default
685
+ * Output path.
686
+ *
687
+ * @returns Output path.
688
+ *
689
+ * @example
690
+ * const path =
691
+ * visor.getOutputPath();
692
+ */
693
+ getOutputPath(): string;
694
+ /**
674
695
  * Closes a desktop application
675
696
  * using Windows taskkill.
676
697
  *
@@ -707,6 +728,7 @@ export declare class Visor {
707
728
  loadConfig(config: {
708
729
  scaleFactor?: number;
709
730
  imagePath?: string;
731
+ ssOutputPath?: string;
710
732
  debug?: boolean;
711
733
  }): void;
712
734
  /**
package/dist/index.js CHANGED
@@ -532,6 +532,7 @@ CONF:${m.confidence.toFixed(3)}
532
532
  * );
533
533
  */
534
534
  async captureScreenshot(path) {
535
+ path = config_1.visorConfig.outputPath + "/" + path;
535
536
  console.log(`[VISOR] Saving screenshot: ${path}`);
536
537
  await (0, screen_1.saveScreenshot)(path);
537
538
  console.log("[VISOR] Screenshot saved");
@@ -837,6 +838,31 @@ CONF:${m.confidence.toFixed(3)}
837
838
  return config_1.visorConfig.imagePath;
838
839
  }
839
840
  /**
841
+ * Sets the default output path
842
+ * used for visual automation APIs.
843
+ *
844
+ * @param path Output directory path.
845
+ *
846
+ * @example
847
+ * visor.setOutputPath("./images");
848
+ */
849
+ setOutputPath(path) {
850
+ config_1.visorConfig.outputPath = path;
851
+ }
852
+ /**
853
+ * Returns the current default
854
+ * Output path.
855
+ *
856
+ * @returns Output path.
857
+ *
858
+ * @example
859
+ * const path =
860
+ * visor.getOutputPath();
861
+ */
862
+ getOutputPath() {
863
+ return config_1.visorConfig.outputPath;
864
+ }
865
+ /**
840
866
  * Closes a desktop application
841
867
  * using Windows taskkill.
842
868
  *
@@ -879,6 +905,9 @@ CONF:${m.confidence.toFixed(3)}
879
905
  if (config.imagePath) {
880
906
  this.setImagePath(config.imagePath);
881
907
  }
908
+ if (config.ssOutputPath) {
909
+ this.setOutputPath(config.ssOutputPath);
910
+ }
882
911
  if (config.debug !== undefined) {
883
912
  this.setDebug(config.debug);
884
913
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aspiresys/visor",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {