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

fix: Update the constructor for compatibility with python client 4.10 #879

Merged
merged 3 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ typing-extensions = "~=4.6"
types-python-dateutil = "~=2.8"

[packages]
selenium = "~=4.9"
selenium = "~=4.10"
19 changes: 15 additions & 4 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def add_command(self):

2. Creates a session with the extension.
# Appium capabilities
desired_caps = { ... }
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps,
options = AppiumOptions()
driver = webdriver.Remote('http://localhost:4723/wd/hub', options=options,
extensions=[YourCustomCommand])

3. Calls the custom command
Expand Down Expand Up @@ -232,12 +232,23 @@ def __init__(
if isinstance(command_executor, str):
command_executor = AppiumConnection(command_executor, keep_alive=keep_alive)

if desired_capabilities is not None:
warnings.warn(
'desired_capabilities argument is deprecated and will be removed in future versions. '
'Use options instead.'
)
# TODO: Remove the fallback after desired_capabilities removal
dst_options = (
AppiumOptions().load_capabilities(desired_capabilities)
if desired_capabilities is not None and options is None
else options
)

super().__init__(
command_executor=command_executor,
desired_capabilities=desired_capabilities,
browser_profile=browser_profile,
proxy=proxy,
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
Contributor Author

Choose a reason for hiding this comment

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

done

options=options,
options=dst_options,
)

if hasattr(self, 'command_executor'):
Expand Down