diff --git a/README.md b/README.md index 8ae7f37..9ccb255 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,6 @@ ## [Documentation](https://tesena-smart-testing.github.io/WatchUI/) | [Tesena](https://www.tesena.com/) | [Pypi](https://pypi.org/project/WatchUI/) -## Important notice for users - -WatchUI 2.0 brings breaking changes. Dev team decided to streamline the library and focus it solely on the image and text comparison. This allows us to remove the implicit dependency on browser automation libraries - namely SeleniumLibrary, which was implicit part of the library via RF `BuiltIn()` import of the SeleniumLibrary instance. - -This is no longer the case - user of the WatchUI therefore **can and have to choose, what UI automation library will use** and provide screenshots to the WatchUI keywords to be compared. It could be now used with SeleniumLibrary, Browser library, Sikuli, Appium or any other UI library where visual validation is required. - -Version 1.x.x is no longer supported, but it is still available on [Pypi](pip install WatchUI==1.0.11). - ### Basic Info Custom library for works with image, pdf and tesseract with RF. @@ -52,3 +44,25 @@ _Image where the differences are stored + You can see two black box in left corn _The red rectangles outlining missing elements on compared screens_ + + +## Important notice for users + +## For users with Windows + +The scikit image library is used for image matching. Unfortunately, this is a scientific library. +You need to have these libraries for installed to use them properly on windows: +- Windows 10 SDK +- C++ x64/x86 build tools + +These libraries can be downloaded by using [VS studio](https://visualstudio.microsoft.com/cs/) (not vscode) and installing the msbuild tool from VS studio. +Alternatively, [this library](https://visualstudio.microsoft.com/cs/visual-cpp-build-tools/) should also work. + + +## WatchUI 1.0 vs 2.x.x + +WatchUI 2.0 brings breaking changes. Dev team decided to streamline the library and focus it solely on the image and text comparison. This allows us to remove the implicit dependency on browser automation libraries - namely SeleniumLibrary, which was implicit part of the library via RF `BuiltIn()` import of the SeleniumLibrary instance. + +This is no longer the case - user of the WatchUI therefore **can and have to choose, what UI automation library will use** and provide screenshots to the WatchUI keywords to be compared. It could be now used with SeleniumLibrary, Browser library, Sikuli, Appium or any other UI library where visual validation is required. + +Version 1.x.x is no longer supported, but it is still available on [Pypi](pip install WatchUI==1.0.11). diff --git a/WatchUI/keywords/Image.py b/WatchUI/keywords/Image.py index 52f3368..52e20b7 100644 --- a/WatchUI/keywords/Image.py +++ b/WatchUI/keywords/Image.py @@ -98,7 +98,8 @@ def _write_and_log( url: str = f"{checked_save_folder}/Img{time_}{img_format}" # Show image if score < ssim: - cv.imwrite(url, target_image) + img_diff: Any = cv.hconcat([base_image, target_image]) + cv.imwrite(url, img_diff) self.set_log_message( work_object="Image", type_of_messages="Error", path_to_image=url ) @@ -133,7 +134,7 @@ def compare_images( base_image_path (str): path to base image compared_image_path (str): path to compared image save_folder (str): path to the save folder - ssim (float): SSIM threshold value + ssim (float): SSIM threshold value 0 to 1 e.g. "0.5" image_format (str): image format, e.g. "png", "jpg" Raises: TypeError: @@ -182,7 +183,7 @@ def compare_screen_without_areas( base_image_path (str): path to the base image compared_image_path (str): path to the compared image save_folder (str): path to the save folder - ssim (float): SSIM threshold value + ssim (float): SSIM threshold value 0 to 1 e.g. "0.5" image_format (str): format of the image, e.g. "png", "jpg" """ checked_save_folder, my_ssim, img_format = self._do_checks( diff --git a/pyproject.toml b/pyproject.toml index e149e66..e380606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "WatchUI" -version = "2.0.11" +version = "2.0.12" description = "RobotFramework library package for automated visual testing." readme = "README.md" repository = "https://github.com/Tesena-smart-testing/WatchUI" diff --git a/setup.py b/setup.py index 238cc81..1abf7ad 100644 --- a/setup.py +++ b/setup.py @@ -2,4 +2,4 @@ # setup for development purposes # run with python setup.py develop -setup(name="WatchUI", version="2.0.11", packages=find_packages()) +setup(name="WatchUI", version="2.0.12", packages=find_packages()) diff --git a/tests/test.robot b/tests/test.robot index 81bfef4..8f4a41c 100644 --- a/tests/test.robot +++ b/tests/test.robot @@ -1,6 +1,8 @@ *** Variables *** ${TESERACT_PATH} /usr/bin/tesseract ${BASELINE_IMAGE} assets/img.jpg +${IMAGE_1} resource/data/forpres.png +${IMAGE_2} resource/data/forpres1.png ${PDF_FILE} assets/ok.pdf @@ -10,7 +12,11 @@ Library ../WatchUI/ outputs_folder=tests/outputs tesseract_pa *** Test Cases *** Compare Same Images - Compare images ${BASELINE_IMAGE} ${BASELINE_IMAGE} + Compare images ${BASELINE_IMAGE} ${BASELINE_IMAGE} + +Compare different Images + [Tags] 1 + Compare images ${IMAGE_1} ${IMAGE_2} ssim=0.5 Check Compare Screen Without Areas Compare screen without areas ${BASELINE_IMAGE} ${BASELINE_IMAGE} 0 0 100 100 125 125 250 250