forked from eficode/robotframework-imagehorizonlibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 6cc09dd Author: Dave Amies <[email protected]> Date: Sat Feb 26 14:09:19 2022 +1000 My tweaks to atest to make it run locally commit 2dd9d9d Author: Dave Amies <[email protected]> Date: Sat Feb 26 14:07:38 2022 +1000 Will now detect the screen scaling ratio and adjust This update will now detect the screen scaling ratio and adjust accordingly. I tested it using "tests/atest/calculator.robot" on a mac with a Retina display running OSX 12.0.1 I don't have a windows machine to test on, but based on comments in [pyautogui issue #589](asweigart/pyautogui#589) this should work for the various windows scaling ratios. This replaces the self.has_retina which wasn't working as it was returning false on my machine even though it does indeed have a retina display. __get_pixel_ratio should only get called the first time _locate is called, that was my experience in testing, though perhaps it should be called every time as windows users could potentially change their display scaling during the test. Also I don't know of an OS that supports it now but I guess it's possible in the future an OS may have a scaling factor less than 100% and this change won't support that either. Issue eficode#62
- Loading branch information
Showing
7 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
*** Settings *** | ||
Library ImageHorizonLibrary ${CURDIR}${/}reference_images${/}calculator screenshot_folder=${OUTPUT_DIR} | ||
Library ${CURDIR}${/}..${/}..${/}..${/}robotframework-imagehorizonlibrary${/}src${/}ImageHorizonLibrary ${CURDIR}${/}reference_images${/}calculator screenshot_folder=${OUTPUT_DIR} | ||
|
||
*** Test cases *** | ||
|
||
Calculator | ||
Set Confidence 0.9 | ||
Launch application python tests/atest/calculator/calculator.py | ||
Launch application python3 tests/atest/calculator/calculator.py | ||
${location1}= Wait for inputs_folder timeout=30 | ||
Click to the above of ${location1} 20 | ||
Type 1010 | ||
Click to the below of ${location1} 20 | ||
Type 1001 | ||
${location2}= Locate or_button.png | ||
${location2}= Locate or_button | ||
Click to the below of ${location2} 0 | ||
Click to the below of ${location2} 50 | ||
Sleep 0.1 | ||
${result}= Copy | ||
Should be equal as integers ${result} 1011 | ||
Click Image close_button.png | ||
Click Image close_button | ||
[Teardown] Terminate application |
File renamed without changes
Binary file added
BIN
+6.33 KB
tests/atest/reference_images/calculator/close_button/close_button_macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.12 KB
tests/atest/reference_images/calculator/inputs_folder/inputs_macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+5.48 KB
tests/atest/reference_images/calculator/or_button/or_button_macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.