{"id":21406319,"url":"https://github.com/visual-regression-tracker/sdk-java","last_synced_at":"2025-07-14T00:32:25.220Z","repository":{"id":38189608,"uuid":"262654392","full_name":"Visual-Regression-Tracker/sdk-java","owner":"Visual-Regression-Tracker","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-15T17:13:39.000Z","size":248,"stargazers_count":8,"open_issues_count":9,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-20T13:16:00.704Z","etag":null,"topics":["java","sdk"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Visual-Regression-Tracker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-05-09T20:35:27.000Z","updated_at":"2023-09-29T08:12:45.000Z","dependencies_parsed_at":"2023-01-29T22:15:28.437Z","dependency_job_id":null,"html_url":"https://github.com/Visual-Regression-Tracker/sdk-java","commit_stats":{"total_commits":95,"total_committers":8,"mean_commits":11.875,"dds":"0.27368421052631575","last_synced_commit":"31f52b7651ddc23a411f0d9ed73bc747f234c17b"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Visual-Regression-Tracker%2Fsdk-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Visual-Regression-Tracker%2Fsdk-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Visual-Regression-Tracker%2Fsdk-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Visual-Regression-Tracker%2Fsdk-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Visual-Regression-Tracker","download_url":"https://codeload.github.com/Visual-Regression-Tracker/sdk-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225933057,"owners_count":17547706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","sdk"],"created_at":"2024-11-22T16:38:38.841Z","updated_at":"2025-07-14T00:32:25.186Z","avatar_url":"https://github.com/Visual-Regression-Tracker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java SDK for [Visual Regression Tracker](https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/79dcd96f2be04992bc1059cad60e2e04)](https://www.codacy.com/gh/Visual-Regression-Tracker/sdk-java?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Visual-Regression-Tracker/sdk-java\u0026amp;utm_campaign=Badge_Grade)\n\n## Gradle\n\n```yml\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n\n```yml\ndependencies {\n    implementation group: 'com.github.visual-regression-tracker', name: 'sdk-java', version: '${REPLACE_THIS_VALUE}'\n}\n```\n\n## Maven\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Visual-Regression-Tracker\u003c/groupId\u003e\n    \u003cartifactId\u003esdk-java\u003c/artifactId\u003e\n    \u003cversion\u003e${REPLACE_THIS_VALUE}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n[Available versions](https://github.com/Visual-Regression-Tracker/sdk-java/releases)\n\nMore info about https://jitpack.io/\n\n## Usage\n\n### Configuration\nIn order to initialize VisualRegressionTracker, following options should be defined:\n\n* `apiUrl` (**Required**) - URL where backend is running. _Example_: \"http://localhost:4200\"\n* `project` (**Required**) - Project name or ID. _Example_: \"003f5fcf-6c5f-4f1f-a99f-82a697711382\"\n* `apiKey` (**Required**) - User apiKey. _Example_: \"F5Z2H0H2SNMXZVHX0EA4YQM1MGDD\"\n* `branch` (Optional) - Current git branch. _Example_: \"develop\"\n* `enableSoftAssert` (Optional) - Log errors instead of exceptions. Default value is false\n* `ciBuildId` (Optional) - id of the build in CI system\n* `httpTimeoutInSeconds` (Optional) - define http socket timeout in seconds. Default value is 10 seconds\n\n There are a few ways to provide those options\n\n\u003cdetails\u003e\n\n\u003csummary\u003eCreate config with builder\u003c/summary\u003e\n\n```java\nVisualRegressionTrackerConfig config = VisualRegressionTrackerConfig.builder()\n                .apiUrl(\"http://localhost:4200\")\n                .apiKey(\"F5Z2H0H2SNMXZVHX0EA4YQM1MGDD\")\n                .project(\"003f5fcf-6c5f-4f1f-a99f-82a697711382\")\n                .enableSoftAssert(true)\n                .branchName(\"develop\")\n                .build();\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSet environment variables\u003c/summary\u003e\n\n```\nexport VRT_APIURL=http://localhost:4200\nexport VRT_APIKEY=F5Z2H0H2SNMXZVHX0EA4YQM1MGDD\nexport VRT_PROJECT=003f5fcf-6c5f-4f1f-a99f-82a697711382\nexport VRT_BRANCHNAME=develop\nexport VRT_ENABLESOFTASSERT=true\nexport VRT_CIBUILDID=40bdba4\nexport VRT_HTTPTIMEOUTINSECONDS=15\n\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eCreate vrt.json file in the root of the project\u003c/summary\u003e\n\n```json\n{\n  \"apiUrl\": \"[http://162.243.161.172:4200](http://localhost:4200)\",\n  \"project\": \"003f5fcf-6c5f-4f1f-a99f-82a697711382\",\n  \"apiKey\": \"F5Z2H0H2SNMXZVHX0EA4YQM1MGDD\",\n  \"branchName\": \"develop\",\n  \"enableSoftAssert\": false,\n  \"ciBuildId\": \"40bdba4\"\n}\n\n```\n\n\u003c/details\u003e\n\n\u003e [!NOTE]\n\u003e Final values, that will be used by VisualRegressionTracker, will be resolved as following:\n\u003e 1. If explicitly set while creating `VisualRegressionTrackerConfig` - use this value\n\u003e 2. Use value from environment variable if it exists\n\u003e 3. Try to get it from the configuration file\n\n\u003cbr /\u003e\n\n\n### Create an instance of `VisualRegressionTracker`\n\n```java\nVisualRegressionTracker visualRegressionTracker = new VisualRegressionTracker(config);\n```\n\nor\n\n```java\nVisualRegressionTracker visualRegressionTracker = new VisualRegressionTracker();\n```\n\n\u003e [!TIP]\n\u003e If config is not provided explicitly, it will be created based on the environment variables or configuration file. Please see [Configuration](README.md#configuration) section\n\n\u003cbr /\u003e\n\n### Start `VisualRegressionTracker`\n\n```java\nvisualRegressionTracker.start();\n```\n\nAt that point VisualRegressionTracker will try to create a new build for provided project. All of the subsequent tracked screenshots are going to be included in that build.\n\n\u003cbr /\u003e\n\n### Take a screenshot as String in Base64 format\n\n```java\n// Selenium example\nString screenshotBase64 = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BASE64);\n```\n\n\u003cbr /\u003e\n\n### Track image\n\nDefault options\n\n```java\nvisualRegressionTracker.track(\n        \"Name for test\",\n        screenshotBase64\n);\n```\n\nWith specific options \n\n```java\nvisualRegressionTracker.track(\n        \"Name for test\",\n        screenshotBase64,\n        TestRunOptions.builder()\n            .browser(\"Chrome\")\n            .os(\"Windows\")\n            .viewport(\"1200x800\")\n            .diffTollerancePercent(3.0f)\n            .build()\n);\n```\n\n\n### Stop `VisualRegressionTracker`\n\n```java\nvisualRegressionTracker.stop();\n```\n\nShould be called once current build should be considered as completed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisual-regression-tracker%2Fsdk-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisual-regression-tracker%2Fsdk-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisual-regression-tracker%2Fsdk-java/lists"}