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

[wip]: define AppiumClientConfig #1070

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

[wip]: define AppiumClientConfig #1070

wants to merge 13 commits into from

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Nov 28, 2024

Let's move the client configuration stuff to AppiumClientConfig only. This will be a major version up.

@testerxiaodong
Copy link
Contributor

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
Copy link
Contributor

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):
Copy link
Contributor

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?

Copy link
Member Author

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
Copy link
Contributor

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',
Copy link
Contributor

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

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