Repository navigation
Conversation
README "Set custom AppiumConnection":
- The example passed init_args_for_pool_manage (missing "r"), which
raises TypeError in RemoteConnection.__init__. Selenium also
deprecates passing remote_server_addr and init_args_for_pool_manager
to RemoteConnection directly, and its ClientConfig reads the
urllib3.PoolManager arguments from a nested
'init_args_for_pool_manager' key, so a flat {'retries': ...} dict is
silently ignored. The example now builds an AppiumClientConfig with
the nested dict and passes it as client_config.
README options examples:
- options.platformVersion = ... only sets a Python attribute, so the
value never reaches to_capabilities(). All three occurrences now use
options.platform_version.
ExtensionBase docstring:
- RemoteConnection.execute builds the URL as remote_server_addr + path,
so 'session/$sessionId/...' produced http://localhost:4723session/....
The example URLs now start with a slash.
- The second example defined test_command but registered
custom_method_name, which raises AttributeError when the driver
installs the extension. The third example registered
YourCustomCommand instead of CustomURLCommand.
Flutter wait commands:
- appium-flutter-server reads the wait timeout with
(json['timeout'] as num?)?.toInt(), so fractions are dropped. The
wait_for_visible and wait_for_invisible docstrings now say the
timeout is in whole seconds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several examples in the README and docstrings do not work as written.
AppiumConnection": the example passesinit_args_for_pool_manage=(missing the final "r"), which raisesTypeError: RemoteConnection.__init__() got an unexpected keyword argument 'init_args_for_pool_manage'. Fixing only the typo is not enough:remote_server_addrandinit_args_for_pool_managertoRemoteConnection(), and warns for both.RemoteConnection._get_connection_managerreads theurllib3.PoolManagerarguments from a nested'init_args_for_pool_manager'key. A flat{'retries': ...}dict is silently ignored, so the retries never apply. Selenium's own unit tests and a direct-connect test intest/unit/webdriver/webdriver_test.pyuse the nested form.options.platformVersion = '13.4'only sets a Python attribute, so the version never reachesto_capabilities(). This appears three times: in the pytest fixture example (iOS and Android) and in theAppiumConnectionexample.ExtensionBasedocstring: the example URLs are'session/$sessionId/...'.RemoteConnection.executebuilds the URL asf"{remote_server_addr}{path}", so the request goes tohttp://localhost:4723session/1234/path/to/your/custom/url. The second example also definestest_commandwhilemethod_name()returnscustom_method_name, so creating the driver raisesAttributeError. The third example registersYourCustomCommandinstead ofCustomURLCommand.wait_for_visibleandwait_for_invisible: the timeout is documented as seconds with typefloat. appium-flutter-server reads it as(json['timeout'] as num?)?.toInt()inserver/lib/src/models/api/wait.dart, so the fractional part is dropped and 0.5 becomes 0. appium-flutter-integration-driver passes the value through unchanged.Fix
AppiumConnectionexample to build anAppiumClientConfigwith the nestedinit_args_for_pool_managerdict and pass it asAppiumConnection(client_config=...).options.platformVersion = ...lines tooptions.platform_version = ....ExtensionBasedocstring, renametest_commandtocustom_method_name, and registerCustomURLCommandin the third example.floatannotation is unchanged.These are documentation changes only.
scroll_till_visibleis not touched.Tests
AppiumConnectionexample against a mocked/sessionendpoint. It creates the driver without errors or Selenium deprecation warnings, theRetryobject reachesurllib3.PoolManager, andappium:platformVersion: 13.4is sent in the new session request.Retryobject does not reach the pool manager.XCUITestOptions()andUiAutomator2Options()withoptions.platformVersion = '13.4'produce noplatformVersioncapability. Withoptions.platform_version = '13.4'they produce'appium:platformVersion': '13.4'.'session/$sessionId/...'requestshttp://localhost:4723session/1234/.... With the leading slash it requestshttp://localhost:4723/session/1234/....ruff check,ruff format --check,mypy appiumand the full unit test suite pass.🤖 Generated with Claude Code