-
Notifications
You must be signed in to change notification settings - Fork 555
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
Conversation
@@ -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) |
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.
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?
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.
yes, that's correct
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.
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')
....
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.
thank you
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.
Need to fix tests, otherwise lgtm 👍
'unhandledPromptBehavior', | ||
] | ||
) | ||
_OSS_W3C_CONVERSION = { |
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.
👍
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.
I didn't review the code but the overall end result seems good.
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.