-
Notifications
You must be signed in to change notification settings - Fork 566
Add touch action unittest #306
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
Add touch action unittest #306
Conversation
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.
[nits]
The element numbers have no rule, thus you do not need to increment it
json = [ | ||
{'action': 'tap', 'options': {'count': 1, 'element': 8}}, {'action': 'release', 'options': {}} | ||
] | ||
touch_action.tap(ElementStub(8)).release() |
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.
What about calling only release()
?
def test_perform_json(self, touch_action): | ||
json = [] | ||
touch_action.tap(ElementStub(9)).perform() | ||
assert json == touch_action.json_wire_gestures |
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.
You can write as below if you would like to make sure the json
is exactly cleared after the perform
json_tap = [...]
touch_action.tap(ElementStub(9))
assert json_tap == touch_action.json_wire_gestures
touch_action.perform()
assert [] == touch_action.json_wire_gestures
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.
thanks!
#283