Skip to content

Conversation

KazuCocoa
Copy link
Member

No description provided.

def _build_data_matcher(self, name=None, args=None, className=None):
result = {}

for key, value in {'name': name, 'args': args, 'class': className}.items():
Copy link
Member Author

Choose a reason for hiding this comment

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

Python 3 has only items()


return json.dumps(result)

def find_element(self, by=None, value=None):
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Feb 17, 2019

Choose a reason for hiding this comment

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

are these dummy methods needed?

raise NotImplementedError


class WebDriverSearchContext(webdriver.Remote,
Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Feb 17, 2019

Choose a reason for hiding this comment

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

this is still data matcher search context. How we are going to represent this if more search contexts are moved to extensions?

Copy link
Contributor

@mykola-mokhnach mykola-mokhnach Feb 17, 2019

Choose a reason for hiding this comment

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

how about these would be named as AndroidDriverDataMatcherSearchContext and AndroidElementDataMatcherSearchContext?

Copy link
Member Author

@KazuCocoa KazuCocoa Feb 17, 2019

Choose a reason for hiding this comment

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

I came up with like below. AndroidSearchContext will have data matcher, view tag and uiautomator, for example 👀

class WebDriverSearchContext(webdriver.Remote,
                             GeneralSearchContext,
                             AndroidSearchContext,
                             IOSSearchContext,
                             WindowsSearchContext,
                             TizenSearchContext):

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather say this is AppiumSearchContext

raise NotImplementedError


class CommonSearchContext(RootSearchContext):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this class is not needed for now

from appium.webdriver.common.mobileby import MobileBy


class RootSearchContext(object):
Copy link
Contributor

Choose a reason for hiding this comment

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

BaseSearchContext

return json.dumps(result)


class IOSSearchContext(RootSearchContext):
Copy link
Contributor

Choose a reason for hiding this comment

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

these empty classes are also not needed for now. We'll create them when there will be a need

@mykola-mokhnach
Copy link
Contributor

We could also create a task to refactor the other search context and move them to extensions. Just not to forget and to make it visible to other maintainers

@KazuCocoa KazuCocoa merged commit 1c179d2 into appium:master Feb 18, 2019
@KazuCocoa KazuCocoa deleted the add_datamatcher branch February 18, 2019 08:03
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