Skip to content

Update Selenium to v.4.36.0#54

Merged
mialeska merged 1 commit into
masterfrom
update-to-selenium-4.36.0
Oct 20, 2025
Merged

Update Selenium to v.4.36.0#54
mialeska merged 1 commit into
masterfrom
update-to-selenium-4.36.0

Conversation

@mialeska
Copy link
Copy Markdown
Contributor

  • 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

- 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
@mialeska mialeska self-assigned this Oct 20, 2025
@mialeska mialeska added documentation Improvements or additions to documentation enhancement New feature or request java dependencies Pull requests that update a dependency file labels Oct 20, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 20, 2025

Walkthrough

This 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

Cohort / File(s) Summary
CI Pipeline Configuration
azure-pipelines.yml
Added 60-minute timeout to tests job and 15-minute timeout to CmdLine task; changed Android SDK image from android-30 to android-29.
Project Dependency
pom.xml
Bumped aquality-selenium-core dependency version from 4.8.0 to 4.9.0.
Documentation & JavaDoc
src/main/java/aquality/appium/mobile/application/IMobileApplication.java, src/main/java/aquality/appium/mobile/screens/IScreen.java, src/main/java/aquality/appium/mobile/screens/screenfactory/IScreenFactory.java
Added or expanded JavaDoc comments with parameter and return value descriptions for getDefaultTerminateTimeout(), executeScript() overloads, getLocator(), getName(), getSize(), and getScreen().
Code Formatting & Documentation
src/main/java/aquality/appium/mobile/screens/Screen.java
Added JavaDoc for Screen constructor and minor formatting adjustments in getSize() and getElementFactory() methods.
Android Test UI Handling
src/test/java/samples/android/nativeapp/apidemos/ApplicationActivity.java
Introduced System UI dialog handling in ActivityScreen.open() with timeout-wrapped wait for Wait button click and fallback to Close app button; added imports for IButton, ITimeoutConfiguration, and WebDriverException.
Web Test Refactoring
src/test/java/samples/android/web/WebTextBoxTest.java
Refactored UI element declarations to class-level static finals; added logic to close overlay banner if toggle displayed; refactored checkUnfocus() and isKeyboardShown() with centralized timeout configuration.
Test Configuration
src/test/resources/settings.json
Added uiautomator2ServerLaunchTimeout capability set to 60000 milliseconds under Android capabilities.

Sequence Diagram

sequenceDiagram
    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
Loading

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

🐰 Timeouts ticking, docs now bright,
Android SDK shines with light,
Dialog workarounds find their way,
Selenium springs forward today!
With JavaDoc and care we've sewn,
This codebase has gracefully grown. 🌱

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ⚠️ Warning The pull request title "Update Selenium to v.4.36.0" references a real part of the changeset—there is indeed a Selenium-related dependency update in the pom.xml file. However, the actual change shows aquality-selenium-core being updated from version 4.8.0 to 4.9.0, not 4.36.0 as stated in the title. This version discrepancy is misleading, as it suggests a specific Selenium version that doesn't match the actual dependency version being introduced in the code. Additionally, the title focuses narrowly on the Selenium update while omitting several other significant changes in the PR, including JavaDoc documentation fixes across multiple files and test stabilization measures (pipeline configuration, Android SDK changes, and UI dialog handling). Consider revising the title to accurately reflect the actual dependency version being updated (e.g., "Update aquality-selenium-core to v.4.9.0") or verifying that aquality-selenium-core 4.9.0 indeed corresponds to Selenium 4.36.0 and clarifying this relationship in the title if true. Alternatively, broaden the title to reflect the comprehensive nature of changes, such as "Update dependencies, fix JavaDoc, and stabilize tests" to better represent the full scope of the PR.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed The PR description is directly related to the changeset and accurately captures the main themes of the changes. It mentions fixing Javadoc issues, which is reflected in multiple files (IMobileApplication.java, IScreen.java, Screen.java, IScreenFactory.java) and test stabilization efforts including system UI dialog handling (ApplicationActivity.java), banner management (WebTextBoxTest.java), timeout configuration (azure-pipelines.yml, settings.json), and Android image changes, all of which are present in the actual changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch update-to-selenium-4.36.0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mialeska mialeska changed the title Update Selenium reference to v.4.36.0 +semver: feature Update Selenium to v.4.36.0 +semver: feature Oct 20, 2025
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 btnOverlayToggle and immediately clicks btnCloseBanner without 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

📥 Commits

Reviewing files that changed from the base of the PR and between ae2f2fb and e984b83.

📒 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 uiautomator2ServerLaunchTimeout with 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 txbSearch field 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 ITimeoutConfiguration in a local variable avoids redundant calls to getConfiguration().getTimeoutConfiguration() and improves code clarity. The refactored lambda formatting also enhances readability.

Comment thread pom.xml
Comment thread src/test/java/samples/android/web/WebTextBoxTest.java
@github-project-automation github-project-automation Bot moved this from In progress to Review in progress in Aquality Appium Mobile Oct 20, 2025
@mialeska mialeska changed the title Update Selenium to v.4.36.0 +semver: feature Update Selenium to v.4.36.0 Oct 20, 2025
@mialeska mialeska merged commit 2ea60dc into master Oct 20, 2025
7 checks passed
@mialeska mialeska deleted the update-to-selenium-4.36.0 branch October 20, 2025 09:15
@github-project-automation github-project-automation Bot moved this from Review in progress to Done in Aquality Appium Mobile Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation enhancement New feature or request java

Projects

Development

Successfully merging this pull request may close these issues.

1 participant