File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/io/visual_regression_tracker/sdk_java Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 77import io .visual_regression_tracker .sdk_java .response .TestRunResponse ;
88import lombok .extern .slf4j .Slf4j ;
99
10+ import java .io .File ;
1011import java .io .IOException ;
1112import java .net .URI ;
1213import java .net .http .HttpClient ;
@@ -24,6 +25,7 @@ enum METHOD {
2425public class VisualRegressionTracker {
2526
2627 private static final String TRACKER_NOT_STARTED = "Visual Regression Tracker has not been started" ;
28+ private static final String CONFIG_FILE_NAME = "vrt.json" ;
2729 protected static final String API_KEY_HEADER = "apiKey" ;
2830 protected static final String PROJECT_HEADER = "project" ;
2931 protected Gson gson ;
@@ -32,6 +34,17 @@ public class VisualRegressionTracker {
3234 protected String buildId ;
3335 protected String projectId ;
3436
37+ public VisualRegressionTracker () {
38+ VisualRegressionTrackerConfig .VisualRegressionTrackerConfigBuilder configBuilder = VisualRegressionTrackerConfig .builder ();
39+ File configFile = new File (CONFIG_FILE_NAME );
40+ if (configFile .exists ()) {
41+ configBuilder .configFile (configFile );
42+ }
43+ configuration = configBuilder .build ();
44+ paths = new PathProvider (configuration .getApiUrl ());
45+ gson = new Gson ();
46+ }
47+
3548 public VisualRegressionTracker (VisualRegressionTrackerConfig trackerConfig ) {
3649 configuration = trackerConfig ;
3750 paths = new PathProvider (trackerConfig .getApiUrl ());
You can’t perform that action at this time.
0 commit comments