-
Notifications
You must be signed in to change notification settings - Fork 16
[CUS-9542] removed deprecated methods. #279
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
Conversation
WalkthroughVersion bump from 1.1.8 to 1.1.9 in pom.xml. Deprecated TouchAction and PointOption APIs replaced with W3C PointerInput and Sequence across Android and iOS OCR classes for coordinate-based tapping. Unused Appium and Selenium imports removed. No changes to public method signatures or functional behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingmouse.java (1)
98-117: Android mouse-style W3C tap looks good; consider dropping unusedInterruptedExceptionThe new W3C
PointerInputtap sequence (move → down → up viaAndroidDriver.perform(Arrays.asList(tap))) is correct and consistent with the other Android implementations.Since
clickOnCoordinatesno longer performs any blocking calls, you can safely removethrows InterruptedExceptionfrom its signature and any callers, which will simplify usage.Please confirm there are no remaining callers that rely on
InterruptedExceptionin their signatures before removing it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
ocr_actions/pom.xml(1 hunks)ocr_actions/src/main/java/com/testsigma/addons/android/OCRTesting.java(2 hunks)ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingStore.java(0 hunks)ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingdo.java(2 hunks)ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingmouse.java(2 hunks)ocr_actions/src/main/java/com/testsigma/addons/ios/OCRTesting.java(2 hunks)ocr_actions/src/main/java/com/testsigma/addons/ios/OCRTestingdo.java(2 hunks)ocr_actions/src/main/java/com/testsigma/addons/web/OCRTestingdo.java(0 hunks)
💤 Files with no reviewable changes (2)
- ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingStore.java
- ocr_actions/src/main/java/com/testsigma/addons/web/OCRTestingdo.java
🔇 Additional comments (5)
ocr_actions/pom.xml (1)
9-9: Version bump looks consistent with non-breaking internals changeIncrementing
ocr_actionsto1.1.9for the TouchAction→W3C migration is appropriate; no other POM changes affect consumers.ocr_actions/src/main/java/com/testsigma/addons/android/OCRTesting.java (1)
108-114: W3C actions-based tap implementation for Android looks correctThe new
PointerInput/Sequencetap (move → down → up, thenAndroidDriver.perform(Arrays.asList(tap))) is a clean replacement for the deprecatedTouchActiontap and keeps behavior aligned with the old coordinate click.Please run a quick smoke test on a real Android device/emulator to confirm taps still register correctly across different screen densities.
ocr_actions/src/main/java/com/testsigma/addons/ios/OCRTesting.java (1)
104-110: iOS W3C actions tap sequence is consistent and correctThe
PointerInput/Sequencetap (viewport move → pointerDown → pointerUp, executed viaIOSDriver.perform(Arrays.asList(tap))) is a valid W3C replacement for the deprecatedTouchAction-based tap and matches the Android implementation.Please validate this on at least one real iOS device/simulator to ensure the tap is recognized reliably by the app under test.
ocr_actions/src/main/java/com/testsigma/addons/ios/OCRTestingdo.java (1)
51-58: Guard against empty OCR matches before dereferencing first elementThe new W3C
PointerInput/Sequencetap for iOS looks good and matches the other implementations. However,OCRTextPoint textPoint = TextCompare.get(0);will throwIndexOutOfBoundsExceptionifTextCompareis empty (no OCR match), bypassing the existingif (textPoint == null)handling.Add an explicit empty-check before dereferencing:
- OCRTextPoint textPoint = TextCompare.get(0); + if (TextCompare.isEmpty()) { + result = Result.FAILED; + setErrorMessage("Not found"); + return result; + } + OCRTextPoint textPoint = TextCompare.get(0);Also applies to lines 91-97.
ocr_actions/src/main/java/com/testsigma/addons/android/OCRTestingdo.java (1)
54-62: Use W3C tap is fine; also handle case where no OCR match is foundThe Android W3C
PointerInput/Sequencetap inclickOnCoordinatesfollows the standard W3C Actions specification (pointerMove → pointerDown → pointerUp) and is correctly aligned with other classes.As in the iOS variant,
OCRTextPoint textPoint = TextCompare.get(0);will throwIndexOutOfBoundsExceptionifTextCompareis empty, bypassing your "Not found" error message. Explicit validation beforeget()is the recommended pattern.A guard check would make this more robust:
- OCRTextPoint textPoint = TextCompare.get(0); + if (TextCompare.isEmpty()) { + result = Result.FAILED; + setErrorMessage("Not found"); + return result; + } + OCRTextPoint textPoint = TextCompare.get(0);Please test a flow where the given text is not present in the screenshot to confirm it now fails gracefully instead of raising
IndexOutOfBoundsException.Also applies to: 95-101
please review this addon and publish as PUBLIC
Addon name : ocr_actions
Addon accont: https://jarvis.testsigma.com/ui/tenants/3072/addons
Jira: https://testsigma.atlassian.net/browse/CUS-9542
fix
used W3C Actions API instead of deprecated TouchAction
Summary by CodeRabbit
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.