- 
                Notifications
    You must be signed in to change notification settings 
- Fork 14
[wip] Add zoom and pan #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| try: | ||
| for left, mid, right in data_set: | ||
| if left.strip().lower() == 'action': | ||
| action = right.strip().lower().replace(' ','') | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strip() not required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the strip() not required? Is it because the word "Action" will come from the control server and as there will be no user interference hence no need to strip() the word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace() function you wrote is already doring strip()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| elif left.strip().lower() == 'count': | ||
| count = int(right) | ||
| elif 'coordinates' in left.strip().lower(): | ||
| cords = right.strip() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested this code? I dont think it will work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I haven't tested it. In fact, we can remove this part. The idea was the user could provide a (x,y) coordinate and the zoom/pan action would occur keeping that coordinate in the center. But now as we have added element parameter I think it's redundant to keep the option of the coordinates as well. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay. since there is no client need as well, you can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| x_cord2 = int(cords[1].replace(')','')) | ||
| elif left.strip().lower() == 'double tap': | ||
| if right.strip().lower() == 'true': | ||
| double_tap = True | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double_tap = right.strip().lower() in ('true', 'enable', 'ok', 'yes')There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
PR Type
Feature
PR Checklist
Overview
Have added two new functions in
Framework\Built_In_Automation\Mobile\CrossPlatform\Appium\BuiltInFunctions.pythe functions arezoom_actionandpan_actionThe
zoom_actionfunction will enable zoom in and zoom out for Android devicesThe
pan_actionfunction will pan left/right/up/down for Android devicesAlso have updated the
take_screenshot_appiumfunction. Previously the screenshot's name was saved as a timestamp of the moment the screenshot was taken. But now we can provide a name as an optional option parameter. We can also access the location of thescreen_capture_folderby providing a variable name in appium action. The default variable is 'ss_path'Also updated the
compare_imagesfunction. The 'skimage' library will only get installed if we call thecompare_imagesfunction. Also we can access the score of similarity by using the 'score' variable. We can also set the variable name in 'utility action' rowTest Cases