Skip to content

feat: add the Android class chain and predicate string locators and deprecate UiSelector - #2508

Open
mykola-mokhnach wants to merge 1 commit into
appium:masterfrom
mykola-mokhnach:feat/android-class-chain-predicate
Open

mykola-mokhnach wants to merge 1 commit into
appium:masterfrom
mykola-mokhnach:feat/android-class-chain-predicate

Conversation

@mykola-mokhnach

Copy link
Copy Markdown
Contributor

Change list

Google is going to remove UiSelector and UiScrollable from the UiAutomator framework, so the -android uiautomator strategy is going to stop working. appium-uiautomator2-driver 10.1.0 and 10.2.0 added the -android class chain and -android predicate string strategies as the faster replacement. This PR adds them to the client and deprecates the UiSelector ones.

  • AppiumBy.androidClassChain and AppiumBy.androidPredicateString (ByAndroidClassChain, ByAndroidPredicateString)
  • androidClassChain and androidPredicate attributes of @AndroidFindBy and @AndroidBy
  • AppiumBy.androidUIAutomator, ByAndroidUIAutomator and the uiAutomator attribute of @AndroidFindBy and @AndroidBy are deprecated, with a pointer to the replacements and to the migration guide
  • docs/Advanced-By.md describes the new locators and marks the old one as deprecated
  • Tests: wire golden entries for the new locators and the page factory decoration of the new attributes

OverrideWidget.androidUIAutomator() is not deprecated: it names the Android platform, not the locator strategy.

Types of changes

  • No changes in production code.
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Details

Unit tests, checkstyle and javadoc pass. The locator strings and the driver side were checked on an emulator with server 11.6.0: appium/appium-uiautomator2-driver#1091

…eprecate UiSelector

Google is going to remove UiSelector and UiScrollable from the UiAutomator
framework. appium-uiautomator2-driver 10.1.0 and 10.2.0 added the class chain
and predicate string strategies as the replacement.

- AppiumBy.androidClassChain and AppiumBy.androidPredicateString
- androidClassChain and androidPredicate of AndroidFindBy and AndroidBy
- deprecate AppiumBy.androidUIAutomator, ByAndroidUIAutomator and the
  uiAutomator attribute of AndroidFindBy and AndroidBy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant