-
Notifications
You must be signed in to change notification settings - Fork 568
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
[wip]: define AppiumClientConfig #1070
base: master
Are you sure you want to change the base?
Conversation
When will this PR be merged? |
@@ -59,6 +59,34 @@ For example, some changes in the Selenium binding could break the Appium client. | |||
> to keep compatible version combinations. | |||
|
|||
|
|||
### Quick migration guide from v4 to v5 | |||
- Please use `AppiumClientConfig` as `client_config` arguemnt in favor of client arguments below |
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.
typo argument
options: Union[AppiumOptions, List[AppiumOptions], None] = None, | ||
client_config: Optional[ClientConfig] = None, | ||
client_config: Optional[AppiumClientConfig] = None, | ||
): | ||
if isinstance(command_executor, str): |
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.
would it be possible to extract this logic into a separate method, so super class init would be the very first call there?
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.
super class init would be the very first call there?
Actually we could by modifying here like below:
def __init__(
self,
command_executor: AppiumConnection,
client_config: AppiumClientConfig,
extensions: Optional[List['WebDriver']] = None,
file_detector: Optional[FileDetector] = None,
options: Union[AppiumOptions, List[AppiumOptions], None] = None,
):
Then, a new method will help to build client_config and command_executor.
To avoid handling string of command_executor
in selenium, which uses ClientConfig
, I have added these lines to keep using AppiumClientConfig
as appium python client for such a string case (to keep providing similar syntax to webdriver.Remote for selenium and appium)
@@ -204,28 +205,21 @@ class WebDriver( | |||
): | |||
def __init__( # noqa: PLR0913 |
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.
does it still complain about too many arguments after this change?
command_executor: Union[str, AppiumConnection] = 'http://127.0.0.1:4444/wd/hub', | ||
keep_alive: bool = True, | ||
direct_connection: bool = True, | ||
command_executor: Union[str, AppiumConnection] = 'http://127.0.0.1:4723', |
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.
this is also a breaking change
Let's move the client configuration stuff to AppiumClientConfig only. This will be a major version up.