Skip to content

Move search context methods from webdriver and webelement to search_context - #461

Merged
ki4070ma merged 9 commits into
appium:masterfrom
ki4070ma:mixin
Nov 7, 2019
Merged

Move search context methods from webdriver and webelement to search_context#461
ki4070ma merged 9 commits into
appium:masterfrom
ki4070ma:mixin

Conversation

@ki4070ma

@ki4070ma ki4070ma commented Nov 3, 2019

Copy link
Copy Markdown
Collaborator

For #336

Comment thread appium/webdriver/extensions/search_context/android.py Outdated
@ki4070ma

ki4070ma commented Nov 6, 2019

Copy link
Copy Markdown
Collaborator Author

@KazuCocoa @mykola-mokhnach
Can I have your review for package structure in this PR?

Returns:
:obj:`list` of :obj:`appium.webdriver.webelement.WebElement`

:rtype: list of `MobileWebElement`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why rtype is set for some methods and is not set for others?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

For auto completion #404.
But I'll remove it if possible after check.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately it's necessary for auto completion in IDE.

@mykola-mokhnach mykola-mokhnach Nov 6, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean can we add rtype to other method declarations to make it consistent?

@ki4070ma ki4070ma Nov 6, 2019

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In my opinion, it's unnecessary. (it's confusing us though.)
Originally rtype is unnecessary since Returns: works for auto completion.

https://www.jetbrains.com/help/pycharm/type-syntax-for-docstrings.html

  • reStructuredText(rtype) / Google(Returns:) / and so on

But auto completion doesn't work with Returns: for find_element_xxx somehow.
So added rtype to only find_element_xxx.

Will add one comment to rtype in each class.

Comment thread appium/webdriver/extensions/search_context/search_context.py Outdated
@mykola-mokhnach

Copy link
Copy Markdown
Contributor

@ki4070ma Added some suggestions, but otherwise looks good

@ki4070ma ki4070ma changed the title [WIP] Move search context methods from webdriver and webelement to search_context Move search context methods from webdriver and webelement to search_context Nov 6, 2019
@@ -0,0 +1,43 @@
#!/usr/bin/env python

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

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