{"id":21528202,"url":"https://github.com/znsio/applitoolsintegration","last_synced_at":"2025-04-09T23:41:40.771Z","repository":{"id":194552068,"uuid":"688791679","full_name":"znsio/ApplitoolsIntegration","owner":"znsio","description":"Utility to easily integrate Applitools VisualAI with your automation framework","archived":false,"fork":false,"pushed_at":"2025-04-04T16:18:41.000Z","size":41,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-04T17:26:56.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/znsio.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-08T05:47:22.000Z","updated_at":"2024-03-31T14:26:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d17e7f3-fad4-402f-94e2-5d0fd5bb26a5","html_url":"https://github.com/znsio/ApplitoolsIntegration","commit_stats":null,"previous_names":["znsio/applitoolsintegration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2FApplitoolsIntegration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2FApplitoolsIntegration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2FApplitoolsIntegration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/znsio%2FApplitoolsIntegration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/znsio","download_url":"https://codeload.github.com/znsio/ApplitoolsIntegration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131468,"owners_count":21052819,"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":[],"created_at":"2024-11-24T01:52:09.317Z","updated_at":"2025-04-09T23:41:40.743Z","avatar_url":"https://github.com/znsio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n1. Utility to easily integrate Applitools VisualAI with your JAVA-TestNG automation framework\n2. This is a library which implements basic utilities\n   for [Applitools](https://applitools.com/docs/topics/overview.html) `(com.applitools)`\n3. Dashboard link: https://eyes.applitools.com/\n\n# Build\n\n`mvn clean install -DskipTests`\n\u003e If facing issues with dependencies not being resolved from https://jitpack.io, then check the `settings.xml` file\n\u003e you're using for building your maven projects. If you've proxies configured in the same, then make sure `jitpack.io`\n\u003e is part of `nonProxyHosts` configuration. For instance\n\n```xml\n\n\u003cproxy\u003e\n    \u003cid\u003ehttpmyproxy\u003c/id\u003e\n    \u003cactive\u003etrue\u003c/active\u003e\n    \u003cprotocol\u003ehttp\u003c/protocol\u003e\n    \u003chost\u003esomeHost\u003c/host\u003e\n    \u003cport\u003e8080\u003c/port\u003e\n    \u003cusername\u003eUserName\u003c/username\u003e\n    \u003cpassword\u003ePassword\u003c/password\u003e\n    \u003cnonProxyHosts\u003e*.google.com|*jitpack.io\u003c/nonProxyHosts\u003e\n\u003c/proxy\u003e\n```\n\n# How to consume the dependency\n\n   ```\n   \u003cdependency\u003e\n      \u003cgroupId\u003ecom.github.znsio\u003c/groupId\u003e\n      \u003cartifactId\u003eApplitoolsIntegration\u003c/artifactId\u003e\n      \u003cversion\u003ex.x.x\u003c/version\u003e\n   \u003c/dependency\u003e\n   ```\n\n# How to configure Applitools (Visual Testing) in your automation framework\n\n1. To disable visual validation for the tests, set `IS_VISUAL` to `false` in config properties of your automation\n   framework repo\n2. For running visual validations:\n    1. Set `IS_VISUAL` to `true` in config properties of your automation framework repo\n    2. Set the environment variable for `APPLITOOLS_API_KEY` like this\n       ```\n       export APPLITOOLS_API_KEY=\u003cYour API KEY\u003e\n       ```\n       Applitools API Key can be picked from user Dashboard `https://eyes.applitools.com/`\n    3. **Properties file:** Create a `applitools.properties` file either in `src/test/resources` directory in your\n       automation framework. Specify the path of the file in you `config.properties` of your automation framework like\n       this:\n       ```\n       APPLITOOLS_CONFIGURATION_FILE=./src/test/resources/applitools.properties\n       ```\n       The `applitools.properties` file should have the following mandatory attributes:\n       ```\n       SERVER_URL=https://eyes.applitools.com/\n       CONCURRENCY=\u003cInteger Value\u003e\n       MATCH_LEVEL=strict\n       SEND_DOM=\u003ctrue or false\u003e\n       STITCH_MODE=css\n       TAKE_FULL_PAGE_SCREENSHOT=\u003ctrue or false\u003e\n       VIEWPORT_SIZE=1200x700\n       USE_UFG=\u003ctrue or false\u003e\n       SHOW_LOGS=\u003ctrue or false\u003e\n       SAVE_BASELINE_FOR_NEW_TESTS=\u003ctrue or false\u003e\n       FAIL_TEST_WHEN_DIFFERENCE_FOUND=\u003ctrue or false\u003e\n       ```\n    4. Annotate the test with the `visual` TestNG group annotation which you want to run as part of visual validation.\n       If the test is not part of `visual` group, visual validations will not take place for that test even\n       if `IS_DISABLED` value is set to `false` and test contains the `eyes` validations. For instance,\n       ```\n       @Test(description = \"Validating login with valid username and password\", groups = {\"visual\"})\n       public void validLoginTest(String username, String password, String expectedMessage) throws InterruptedException {\n\n          performLogin(username, password);\n          verifyMessageAfterLogin(expectedMessage);\n       }\n       ```\n    5. To perform Visual Validations on a test, add any of the following commands in the test wherever you need to run\n       visual validation. Use one of the following approaches:\n        1. #### Full Screen/Visible Viewport validation (Eyes.checkWindow()):\n           The eyes check window command captures an image of all the content in the browser window. When capturing on a\n           local browser/App, If the content in the window is larger than the viewport, then the command captures\n           multiple images at different offsets in the window and stitches them together to obtain an image that\n           includes all the content in the window.\n           ```\n           eyes.checkWindow(\"\u003cA string message giving info about which screen you're validating\u003e\");\n           ```\n           For Instance:\n           ```\n           eyes.checkWindow(\"HomePage\");\n           ```\n        2. #### Fluent API Check (Eyes.check()):\n           In the Fluent API you create and configure checkpoints using the eyes$check method. You pass this method a\n           parameter that is created from a chain of methods calls from the target and checksettings classes. The\n           particular chain of methods you call, determines the target that will be checked and how it is configured.\n           ```\n           eyes.check(\"\u003cstring message\u003e\", \u003cconstraints\u003e);\n           ```\n            1. **For instance**\n               ```\n               eyes.check(\"Home Page\", Target.window().strict()\n               .layout(By.xpath(\"//div[@class='ReactVirtualized__Grid items']\"),\n                  By.id(\"breadcrumb-container\"),\n                  By.className(\"//div[@class='  breadcrumb-section']\"))\n               .ignore(By.xpath(\"//div[@class='component-layout']//div[@class\" + \"='img-animate'][1]\"),\n                  By.xpath(\"//div[@class='banner-components-runtime']/div\")));\n               ```\n            2. For more detailed explanation and different examples, visit\n               URL: [The Eyes SDK check Fluent API](https://applitools.com/docs/topics/sdk/the-eyes-sdk-check-fluent-api.html)\n    6. #### Using Ultra Fast Grid:\n       Applitools Ultrafast Grid allows you to perform visual testing across multiple browsers and devices in seconds,\n       to make sure that your content is visually perfect on every device, screen size, and browser combination. To Run\n       Visual Validations on multiple Browser Types Using Ultra Fast Grid, Set `USE_UFG` to `true`\n       in `applitools.properties` file of your automation framework repo. Browser Combination need to be added\n       in `setUFGBrowserConfig(Configuration eyesConfig)` under `ApplitoolsConfigurationManager` class as illustrated in\n       Below example:\n        ```\n        eyesConfig.addBrowser(1512, 866, BrowserType.CHROME);\n        eyesConfig.addBrowser(1600, 1200, BrowserType.FIREFOX);\n        eyesConfig.addBrowser(1024, 768, BrowserType.SAFARI);\n        eyesConfig.addDeviceEmulation(DeviceName.Galaxy_Note_10);\n        eyesConfig.addDeviceEmulation(DeviceName.iPhone_11_Pro_Max);\n        ```\n       For More Details on Configuring Ultra Fast Grid,\n       Visit: [Ultrafast Grid configuration](https://applitools.com/docs/topics/sdk/vg-configuration.html)\n    7. #### Setting correct Viewport Size:\n        1. Incorrect Viewport size will cause the tests to be skipped with exception\n           as `EyesException: Unable to set Viewport Size`.\n        2. In that case, follow the below process to set Viewport Size Correctly:\n            - Navigate to Site: `https://whatismyviewport.com/` to get the viewport size.\n            - Set the Viewport size in `VIEWPORT_SIZE` in format: `Widthxheight` in `applitools.properties` file of your\n              automation framework repo\n\n3. **Dynamic properties:** For setting any additional property to either batch/test properties which is not already\n   configured in `ApplitoolsConfigurationManager` class, set that attribute key and value at either System Property\n   level or at Environment variable. Any key with prefix `AP_BATCH_` (for Batch Property) or `AP_TEST_` (for Test\n   property) set at System property or Environment variable level will be set as Applitools's Batch/Test property\n   respectively. The method which takes care of this configuration is `setPropertiesFromSystemVariables` defined\n   inside `ApplitoolsConfigurationManager` class.\n   For instance, if you're setting environment variable like `export AP_BATCH_Version=0.0.1`\n   and `export AP_TEST_Version=0.0.1`, then on Applitools dashboard, you'll see the corresponding properties\n   as `Version:0.0.1` for Batch/Test property respectively\n4. **Pipeline configuration:**\n    1. Set an environment variable `IS_VISUAL` to `true` for configuring visual validations for\n       pipeline executions. This property takes precedence over the `IS_VISUAL` property value of `config.properties` in\n       your automation framework repo.\n    2. The `ApplitoolsConfigurationManager` class takes care of setting the following batch/test properties in case the\n       test execution is happening on CI (Pipeline)\n       ```\n       BUILD_ID\n       AGENT_NAME\n       BRANCH_NAME\n       ```\n       All these properties will be set as either batch/test properties if the execution is happening on CI, and if they\n       are either set at System property or System environment variable. If your pipeline is using different keys to set\n       the above attributes then the ones we're using above, for each such key, you can define the new key value in\n       the `config.proprties` file of your automation framework like below:\n       ```\n       BUILD_ID=BUILD_BUILDID\n       BRANCH_NAME=BUILD_SOURCEBRANCHNAME\n       ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fapplitoolsintegration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fznsio%2Fapplitoolsintegration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fznsio%2Fapplitoolsintegration/lists"}