Skip to content

feat: Add support for w3c options#720

Merged
mykola-mokhnach merged 2 commits intoappium:masterfrom
mykola-mokhnach:options
Jun 10, 2022
Merged

feat: Add support for w3c options#720
mykola-mokhnach merged 2 commits intoappium:masterfrom
mykola-mokhnach:options

Conversation

@mykola-mokhnach
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

cc @titusfortner @diemol

@mykola-mokhnach mykola-mokhnach requested a review from jlipps June 10, 2022 05:50
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown
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.

3 participants