Skip to content

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

Merged
merged 7 commits into from
Jan 5, 2019
Merged

Add touch action unittest #306

merged 7 commits into from
Jan 5, 2019

Conversation

tadashi0713
Copy link
Contributor

Copy link
Member

@KazuCocoa KazuCocoa left a 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()
Copy link
Member

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
Copy link
Member

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

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@KazuCocoa KazuCocoa merged commit 9733c60 into appium:master Jan 5, 2019
@tadashi0713 tadashi0713 deleted the add_touch_action_unittest branch January 7, 2019 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants