Skip to content
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

feat: Add support for w3c options #720

Merged
merged 2 commits into from
Jun 10, 2022

Conversation

mykola-mokhnach
Copy link
Contributor

This is just POC to demonstrate my vision for W3C Options support in Python client.
If we accept it then it would be necessary to add all the supported capabilities like we did in Java, although this could be done gradually in multiple PRs.

@mykola-mokhnach
Copy link
Contributor Author

cc @titusfortner @diemol

@@ -36,11 +32,16 @@
class BaseTestCase:
def setup_method(self, method) -> None: # type: ignore
desired_caps = desired_capabilities.get_desired_capabilities('ApiDemos-debug.apk.zip')
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
self.driver = webdriver.Remote(
'http://localhost:4723/wd/hub', options=UiAutomator2Options().load_capabilities(desired_caps)
Copy link
Member

Choose a reason for hiding this comment

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

Seems good, overall.

One confirmation is... when a user wants to set an arbitrary automation name etc (not defined in this client one), they can use:

options = AppiumOptions()
options.automation_name('arbitrary name').set_capability('ownCapability', 'the value')...
...

 self.driver = webdriver.Remote('http://localhost:4723/wd/hub', options=options)

, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that's correct

Copy link
Contributor Author

Choose a reason for hiding this comment

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

small correction to the above code:

options = AppiumOptions()
options.automation_name = 'arbitrary name'
options.set_capability('ownCapability', 'the value')\
    .set_capability('appium:ownCapability2', 'the value')
     ....

Copy link
Member

Choose a reason for hiding this comment

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

thank you

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.

Need to fix tests, otherwise lgtm 👍

'unhandledPromptBehavior',
]
)
_OSS_W3C_CONVERSION = {
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

I didn't review the code but the overall end result seems good.

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.

None yet

3 participants