Update Selenium to v.4.36.0#54
Conversation
- Fix javadocs issues Stabilize tests: - Add workaround to handle System UI isn't responding dialog - Wikipedia donate banner handling - set timeout to configure Android task - use different ADO agent and Android images
WalkthroughThis PR includes a dependency version bump for aquality-selenium-core (4.8.0 → 4.9.0), expands documentation across interface and class methods, updates CI pipeline with timeouts and Android SDK configuration changes, adds System UI dialog handling in Android test activities, and introduces a new UIAutomator2 timeout setting. Changes
Sequence DiagramsequenceDiagram
participant Test as Test Code
participant Activity as ActivityScreen.open()
participant Element as UI Elements
participant Services as AqualityServices
Test->>Activity: Call open()
Activity->>Element: Start activity
Note over Activity: New: System UI Dialog Handling
Activity->>Services: Get timeout configuration
loop Wait for button (timeout-wrapped)
Activity->>Element: Check if Wait button visible
alt Button visible
Activity->>Element: Click Wait button
else Button not visible
Activity->>Activity: Exit loop
end
end
alt Wait successful
Activity->>Test: Continue
else Timeout occurred
Activity->>Element: Click Close app button (fallback)
Activity->>Test: Continue
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes The changes consist primarily of repetitive documentation additions across multiple files, straightforward configuration updates (timeout additions, Android SDK version change), and test-code logic additions that implement uncomplicated UI interaction patterns. The heterogeneity of changes (docs, config, test logic) is moderate, but each category remains simple in isolation. Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/test/java/samples/android/nativeapp/apidemos/ApplicationActivity.java (2)
10-10: Prefer explicit imports over wildcard imports.The wildcard import
samples.android.nativeapp.apidemos.screens.*reduces code clarity and can lead to naming conflicts.Apply this diff to use explicit imports:
-import samples.android.nativeapp.apidemos.screens.*; +import samples.android.nativeapp.apidemos.screens.AlertsMenuScreen; +import samples.android.nativeapp.apidemos.screens.AndroidScreen; +import samples.android.nativeapp.apidemos.screens.InvokeSearchScreen; +import samples.android.nativeapp.apidemos.screens.ViewControlsScreen; +import samples.android.nativeapp.apidemos.screens.ViewTabsScrollableScreen;
60-74: LGTM! Workaround logic handles System UI dialog correctly.The implementation properly addresses the "System UI isn't responding" dialog by:
- Using configurable timeouts from the framework
- Attempting to click "Wait" repeatedly until the dialog dismisses
- Falling back to "Close app" if the wait strategy fails
- Handling WebDriverException during the wait
The logic aligns with the PR's test stabilization objective.
For improved readability, consider extracting the dialog handling to a separate method:
private void handleSystemUIDialog() { ITimeoutConfiguration timeoutConfiguration = AqualityServices.getConfiguration().getTimeoutConfiguration(); boolean dialogDismissed = AqualityServices.getConditionalWait().waitFor(() -> { if (!btnWait.state().waitForDisplayed()) { return true; } btnWait.click(); return btnWait.state().waitForNotDisplayed(); }, timeoutConfiguration.getCommand(), timeoutConfiguration.getCondition(), Collections.singletonList(WebDriverException.class)); if (!dialogDismissed) { btnCloseApp.click(); } }Then call it from
open():void open() { startActivity(activity); handleSystemUIDialog(); }src/test/java/samples/android/web/WebTextBoxTest.java (1)
24-27: Consider adding a wait between banner toggle and close button click.The banner handling logic clicks
btnOverlayToggleand immediately clicksbtnCloseBannerwithout waiting for the close button to become available. If there's any animation or delay in the banner appearing, the second click might fail.Consider adding a state wait:
if (btnOverlayToggle.state().isDisplayed()) { btnOverlayToggle.click(); + btnCloseBanner.state().waitForClickable(); btnCloseBanner.click(); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
azure-pipelines.yml(3 hunks)pom.xml(1 hunks)src/main/java/aquality/appium/mobile/application/IMobileApplication.java(2 hunks)src/main/java/aquality/appium/mobile/screens/IScreen.java(1 hunks)src/main/java/aquality/appium/mobile/screens/Screen.java(3 hunks)src/main/java/aquality/appium/mobile/screens/screenfactory/IScreenFactory.java(1 hunks)src/test/java/samples/android/nativeapp/apidemos/ApplicationActivity.java(3 hunks)src/test/java/samples/android/web/WebTextBoxTest.java(3 hunks)src/test/resources/settings.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mialeska
PR: aquality-automation/aquality-appium-mobile-java#53
File: pom.xml:187-187
Timestamp: 2025-08-29T14:08:56.440Z
Learning: In the aquality-appium-mobile-java project, the team intentionally relies on transitive dependency resolution for Selenium versions through aquality-selenium-core, rather than explicitly pinning Selenium dependencies in the POM.
📚 Learning: 2025-08-29T14:08:56.440Z
Learnt from: mialeska
PR: aquality-automation/aquality-appium-mobile-java#53
File: pom.xml:187-187
Timestamp: 2025-08-29T14:08:56.440Z
Learning: In the aquality-appium-mobile-java project, the team intentionally relies on transitive dependency resolution for Selenium versions through aquality-selenium-core, rather than explicitly pinning Selenium dependencies in the POM.
Applied to files:
pom.xml
🧬 Code graph analysis (2)
src/test/java/samples/android/nativeapp/apidemos/ApplicationActivity.java (2)
src/main/java/aquality/appium/mobile/screens/Screen.java (1)
Screen(17-87)src/main/java/aquality/appium/mobile/application/AqualityServices.java (1)
AqualityServices(15-213)
src/test/java/samples/android/web/WebTextBoxTest.java (1)
src/main/java/aquality/appium/mobile/application/AqualityServices.java (1)
AqualityServices(15-213)
🔇 Additional comments (10)
src/main/java/aquality/appium/mobile/screens/IScreen.java (1)
16-17: LGTM! Documentation improvements enhance API clarity.The added @return annotations properly document the return values for getLocator(), getName(), and getSize() methods.
Also applies to: 23-24, 30-31
src/test/resources/settings.json (1)
14-15: LGTM! Launch timeout addition aligns with test stabilization goals.Adding
uiautomator2ServerLaunchTimeoutwith a 60-second window complements the existing install timeout and helps accommodate slower server startup conditions.src/main/java/aquality/appium/mobile/screens/Screen.java (1)
33-35: LGTM! Documentation and formatting improvements.The added @param descriptions for the constructor and minor formatting adjustments improve code documentation without altering behavior.
Also applies to: 56-56, 74-74
src/main/java/aquality/appium/mobile/screens/screenfactory/IScreenFactory.java (1)
12-15: LGTM! Complete method documentation.The JavaDoc enhancements properly document the type parameter, method parameter, and return value for the getScreen method.
src/main/java/aquality/appium/mobile/application/IMobileApplication.java (1)
17-18: LGTM! Comprehensive JavaDoc additions.The added documentation for getDefaultTerminateTimeout() and both executeScript() methods properly describes parameters, type parameters, and return values.
Also applies to: 71-75, 81-84
azure-pipelines.yml (2)
47-47: LGTM! Timeout additions improve pipeline resilience.The 60-minute job timeout and 15-minute task timeout provide adequate buffers for extended test execution and Android SDK configuration, aligning with the PR's test stabilization objectives.
Also applies to: 64-64
59-59: Verify the Android SDK downgrade from android-30 to android-29.The change downgrades the Android SDK image from android-30 to android-29. Please confirm this is intentional and addresses specific compatibility or stability issues mentioned in the PR objectives.
src/test/java/samples/android/web/WebTextBoxTest.java (3)
4-4: LGTM: Imports align with new functionality.The new imports are necessary for the banner handling elements and timeout configuration caching.
Also applies to: 6-6
46-49: LGTM: Refactor aligns with class-level element declaration.The method now uses the class-level
txbSearchfield instead of taking a parameter, which is consistent with the refactoring to class-level elements.
52-56: LGTM: Good refactor to cache timeout configuration.Caching the
ITimeoutConfigurationin a local variable avoids redundant calls togetConfiguration().getTimeoutConfiguration()and improves code clarity. The refactored lambda formatting also enhances readability.



Stabilize tests: