Skip to content

fix(typing): refine WebDriver, WebElement, MobileSwitchTo, and AppiumBy type annotations - #1357

Merged
KazuCocoa merged 1 commit into
appium:masterfrom
hoanle0126:fix/webdriver-typing-1147
Nov 6, 2026
Merged

KazuCocoa merged 1 commit into
appium:masterfrom
hoanle0126:fix/webdriver-typing-1147

Conversation

@hoanle0126

@hoanle0126 hoanle0126 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1147

Summary

  • Update MobileSwitchTo.active_element return type annotation to WebElement so callers get Appium mobile element typing without manual casts.
  • Broaden the by parameter type on WebDriver and WebElement find methods to accept Selenium locator enums alongside string values, matching the protocol signatures.
  • Add explicit ByType annotations to AppiumBy constants so type checkers preserve narrow locator literal types, and remove redundant casts in FlutterFinder.

Testing

  • uv run mypy --warn-unused-ignores appium
  • uv run ruff check .
  • make check-format
  • make unittest (227 passed)

@KazuCocoa
KazuCocoa merged commit 1474968 into appium:master Nov 6, 2026
13 of 14 checks passed
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.

mypy error "Incompatible return value type" on webdriver.find_element

2 participants