Skip to content

fix(workflow): 🐛 fixing android test with appium v3#1071

Merged
WasiqB merged 17 commits intomainfrom
issue-1070
Aug 30, 2025
Merged

fix(workflow): 🐛 fixing android test with appium v3#1071
WasiqB merged 17 commits intomainfrom
issue-1070

Conversation

@WasiqB
Copy link
Copy Markdown
Member

@WasiqB WasiqB commented Aug 29, 2025

Closes: #1070

Type of changes?

  • Bug fixes: Non-breaking change which fixes an issue
  • New feature: Non-breaking change which adds a new feature
  • Performance improvement: Non-breaking change which improves performance
  • Documentation: Non-breaking change which improves documentation
  • Other: Non-breaking change which does not fit into the above categories
  • Breaking change: A breaking change which requires a new version of the library

Checklist for Java project

  • Change not related to Java project

Following checklists are optional if above checkbox is selected:

  • Copyright banner comment added to newly added files, except *.md, *.yml, *.json?
  • Proper JavaDoc updated in main and test classes for all public classes and methods?
  • Tests added for changes?
  • Tests are passing locally?
  • Check style checks are passing locally?
  • Test coverage is at least 80% for newly added changes?
  • There are no SonarCloud issues?
  • README updated? (if applicable)
  • Documentation website updated for the PR raised?

Checklist for Website

  • Change not related to Website project

Following is optional if above checkbox is selected:

  • Lint check passes locally?
  • Prettier check passes locally?
  • Build command working fine locally?

Reviewers

@BoykaFramework/boyka-core

Important

Make sure to check the Allow edits from maintainers box below this window

Summary by CodeRabbit

  • New Features
    • Per-driver configuration for allow/deny insecure options in mobile server settings, enabling more granular control.
  • Tests
    • Upgraded CI to Appium 3 with refined platform-specific setup and safer defaults.
    • Updated Android emulator to Pixel 7 Pro (API 35) and test configs to target Android 15.
    • Reduced local web test scope; improved UI color assertion robustness.
  • Chores
    • Dependency bumps: release-it and @mdx-js/react.
    • Cleaned up Dependabot settings (removed default reviewers).

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 29, 2025

Walkthrough

Updates CI to Appium 3, adjusts Android emulator settings, introduces per-driver insecure flags in server configuration and usage, tweaks a UI test assertion, updates Android versions and allow_insecure in test configs, narrows a TestNG suite scope, removes Dependabot reviewers, and bumps minor/patch package versions.

Changes

Cohort / File(s) Summary
CI: Appium v3 and Android emulator
.github/workflows/_test-core-java.yml, .github/workflows/test-core.yml
Switches setup to Appium 3; refines platform gating, KVM enablement, and driver install conditions; updates --allow-insecure formatting; installs platform tools (ffmpeg, applesimutils). Changes Android emulator profile to pixel_7_pro and version to 35.
Dependabot config
.github/dependabot.yml
Removes reviewers entries from npm, maven, and github-actions sections.
Core Java: server settings and manager
core-java/src/main/java/.../server/ServerSetting.java, core-java/src/main/java/.../ServiceManager.java
Adds getAllowInsecure(String driverName) and getDenyInsecure(String driverName) returning per-driver tokens; ServiceManager updated to use driver-scoped insecure lists when building server args.
Test config and tests
core-java/src/test/resources/boyka-config.json, core-java/src/test/java/.../DoubleClickTest.java
Bumps Android device version to 15 in several blocks; adds allow_insecure entries (get_server_logs, chromedriver_autodownload). Relaxes a color assertion to startsWith("rgba").
Test suite scope
core-java/test-suites/testng-web-local.xml
Removes io.github.boykaframework.testng.ui.ecomm package from local web suite.
Package updates
package.json, website/package.json
Bumps release-it (^19.0.3 → ^19.0.4) and @mdx-js/react (^3.1.0 → ^3.1.1).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Tester
  participant ServiceManager
  participant ServerSetting
  participant Appium as Appium Server

  Tester->>ServiceManager: startServer()
  ServiceManager->>ServerSetting: getAllowInsecure(driverName)
  ServiceManager->>ServerSetting: getDenyInsecure(driverName)
  Note over ServiceManager,ServerSetting: Build per-driver insecure tokens (driver:flag)
  ServiceManager->>Appium: launch with args (--allow-insecure [...], --deny-insecure [...])
  Appium-->>ServiceManager: server ready
  ServiceManager-->>Tester: session can start
Loading
sequenceDiagram
  autonumber
  actor CI
  participant Runner as GitHub Runner
  participant Setup as Setup Steps
  participant Appium as Appium 3

  CI->>Runner: dispatch workflow
  Runner->>Setup: install platform deps (ffmpeg/applesimutils)
  Setup->>Setup: install drivers conditionally (Android/iOS/macOS)
  Setup->>Appium: start with per-driver --allow-insecure tokens
  Appium-->>Runner: ready for tests
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Handle Appium v3 for Android (#1070)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Remove reviewers from Dependabot config (.github/dependabot.yml) Not related to Appium v3 or Android handling.
Relax UI color assertion (core-java/src/test/java/.../DoubleClickTest.java) Test change unrelated to Appium v3 Android support.
Remove e-comm package from local web suite (core-java/test-suites/testng-web-local.xml) Test suite scope change not tied to Appium v3 Android.
Bump release-it in root package.json (package.json) Build tooling version bump unrelated to the objective.
Bump @mdx-js/react in website (website/package.json) Website dependency update unrelated to Appium v3 Android.

Poem

I thump my paws: v3 is here, hooray!
Drivers lined with flags in tidy array.
Pixels march to thirty-five’s bright tune,
Android fifteens hum a snappy rune.
CI brews the tools, logs hop in queue—
Carrots for all, and faster tests too! 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-1070

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the 🐛 pr: bug fix PR which fixes a bug label Aug 29, 2025
@WasiqB WasiqB marked this pull request as ready for review August 30, 2025 16:43
@WasiqB WasiqB requested a review from a team as a code owner August 30, 2025 16:43
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/_test-core-java.yml (1)

98-104: Apt commands are interactive; job can hang.

Use apt-get with -y (or drop upgrade entirely for speed/stability).

-          if [ "${{ startsWith(inputs.runs-on, 'ubuntu') }}" == "true" ]; then
-            sudo apt update && sudo apt upgrade
-            sudo apt install ffmpeg
+          if [ "${{ startsWith(inputs.runs-on, 'ubuntu') }}" == "true" ]; then
+            sudo apt-get update -y
+            sudo apt-get install -y ffmpeg
           else
             brew install ffmpeg
             brew tap wix/brew && brew install wix/brew/applesimutils
           fi
-          npm install -g appium
+          npm install -g appium@^3
🧹 Nitpick comments (7)
.github/workflows/test-core.yml (1)

139-141: AVD naming vs profile mismatch; API level bump to 35

You’re creating an AVD named Pixel_8_Pro but using the pixel_7_pro hardware profile. Likely fine, but it’s confusing during triage. Consider aligning the AVD name with the profile to avoid misreads in logs. Also ensure your reusable workflow pulls a system image for apiLevel 35 (google_apis, x86_64) to prevent cold-download timeouts.

If you want, I can propose a small change to make emulator-name: Pixel_7_Pro for consistency.

core-java/src/test/java/io/github/boykaframework/testng/ui/theinternet/DoubleClickTest.java (1)

79-81: Assertion too loose; keep flexibility but assert intended color

startsWith("rgba") may pass on any color. Consider anchoring to the expected RGB to keep the test meaningful while allowing alpha/spacing drift.

Apply:

-        onElement (doubleClickPage ().getDoubleClick ()).verifyStyle ("background-color")
-            .startsWith ("rgba");
+        onElement (doubleClickPage ().getDoubleClick ()).verifyStyle ("background-color")
+            .startsWith ("rgba(147, 203, 90");

If available, an even better option is a contains/matches on 147, 203, 90.

core-java/src/main/java/io/github/boykaframework/manager/ServiceManager.java (1)

209-212: Per-driver allow/deny wiring looks right; minor readability tweak.

Avoid repeating getDriverName() and reduce chance of mismatch by caching it locally.

-        setArgument (USE_DRIVERS, this.setting.getDriver ()
-            .getDriverName ());
-        setArgument (ALLOW_INSECURE, this.setting.getAllowInsecure (this.setting.getDriver ()
-            .getDriverName ()));
-        setArgument (DENY_INSECURE, this.setting.getDenyInsecure (this.setting.getDriver ()
-            .getDriverName ()));
+        final var driverName = this.setting.getDriver ().getDriverName ();
+        setArgument (USE_DRIVERS, driverName);
+        setArgument (ALLOW_INSECURE, this.setting.getAllowInsecure (driverName));
+        setArgument (DENY_INSECURE, this.setting.getDenyInsecure (driverName));
.github/workflows/_test-core-java.yml (2)

112-116: mac2 driver install guard is fine. Small portability nit.

Good guard; no change required. Optional: move this logic to a dedicated step with if: ${{ startsWith(inputs.runs-on, 'macos') && !inputs.run-android && !inputs.run-ios }} to keep scripts simpler.


117-119: Make log dir creation idempotent and quote allow-insecure safely.

Use -p for mkdir. Also, a single-quoted, comma-separated value avoids shell concat quirks.

-          mkdir core-java/logs
-          appium server --address 127.0.0.1 --port 4724 --use-drivers uiautomator2 --allow-insecure "uiautomator2:get_server_logs","uiautomator2:chromedriver_autodownload" > core-java/logs/appium-android-server.log 2>&1 &
+          mkdir -p core-java/logs
+          appium server --address 127.0.0.1 --port 4724 --use-drivers uiautomator2 --allow-insecure 'uiautomator2:get_server_logs,uiautomator2:chromedriver_autodownload' > core-java/logs/appium-android-server.log 2>&1 &
core-java/src/main/java/io/github/boykaframework/config/ui/mobile/server/ServerSetting.java (2)

69-84: Guard null/empty inputs and de-dup entries.

Prevent null: prefixes and unnecessary allocations; filter blanks and distinct() the result.

-    public List<String> getAllowInsecure (final String driverName) {
-        if (nonNull (this.allowInsecure)) {
-            return this.allowInsecure.stream ()
-                .map (s -> format ("{0}:{1}", driverName, s))
-                .toList ();
-        }
-        return emptyList ();
-    }
+    public List<String> getAllowInsecure (final String driverName) {
+        if (isEmpty (driverName) || this.allowInsecure == null || this.allowInsecure.isEmpty ()) {
+            return emptyList ();
+        }
+        return this.allowInsecure.stream ()
+            .filter (s -> s != null && !s.isBlank ())
+            .map (s -> format ("{0}:{1}", driverName, s))
+            .distinct ()
+            .toList ();
+    }

98-113: Mirror the same guards and filters for deny list.

-    public List<String> getDenyInsecure (final String driverName) {
-        if (nonNull (this.denyInsecure)) {
-            return this.denyInsecure.stream ()
-                .map (s -> format ("{0}:{1}", driverName, s))
-                .toList ();
-        }
-        return emptyList ();
-    }
+    public List<String> getDenyInsecure (final String driverName) {
+        if (isEmpty (driverName) || this.denyInsecure == null || this.denyInsecure.isEmpty ()) {
+            return emptyList ();
+        }
+        return this.denyInsecure.stream ()
+            .filter (s -> s != null && !s.isBlank ())
+            .map (s -> format ("{0}:{1}", driverName, s))
+            .distinct ()
+            .toList ();
+    }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 32d5893 and 078f472.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .github/dependabot.yml (0 hunks)
  • .github/workflows/_test-core-java.yml (3 hunks)
  • .github/workflows/test-core.yml (1 hunks)
  • core-java/src/main/java/io/github/boykaframework/config/ui/mobile/server/ServerSetting.java (3 hunks)
  • core-java/src/main/java/io/github/boykaframework/manager/ServiceManager.java (1 hunks)
  • core-java/src/test/java/io/github/boykaframework/testng/ui/theinternet/DoubleClickTest.java (1 hunks)
  • core-java/src/test/resources/boyka-config.json (3 hunks)
  • core-java/test-suites/testng-web-local.xml (0 hunks)
  • package.json (1 hunks)
  • website/package.json (1 hunks)
💤 Files with no reviewable changes (2)
  • core-java/test-suites/testng-web-local.xml
  • .github/dependabot.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: test-mobile-android-local / test
  • GitHub Check: test-mobile-lt / test
  • GitHub Check: test-web-bs / test
  • GitHub Check: test-mobile-ios-local / test
  • GitHub Check: test-mobile-bs / test
  • GitHub Check: test-desktop-macos / test
  • GitHub Check: test-web-lt / test
  • GitHub Check: test-web-local / test
🔇 Additional comments (7)
package.json (1)

64-64: release-it bump: OK; confirm plugin compatibility matrix

19.0.4 should be a safe patch upgrade. Please double-check compatibility with @release-it-plugins/lerna-changelog (^8.0.1) and your current Node (engines >=22) to avoid CI surprises.

Run locally/CI: pnpm release --version and pnpm release --ci --dry-run to validate.

website/package.json (1)

22-22: Patch bump to @mdx-js/react: LGTM

No breaking API; safe update for Docusaurus site.

core-java/src/test/resources/boyka-config.json (4)

272-272: Android 15 bump aligns with emulator API 35

Version set to "15" for local Sauce Android looks good and matches the workflow’s emulator-version: 35.


311-311: Android 15 for WDIO local

Consistent with the workflow update; no issues spotted.


352-352: Grid WDIO Android to 15: OK; external Appium node must match

Looks fine. Ensure the Grid node’s Appium instance (if any) also runs with the required allow-insecure per-driver flags, as these cannot be injected via Selenium Grid caps.


303-308: Driver name mapping is correct; external server must include flags
getDriverName() returns “uiautomator2” for UI_AUTOMATOR, so the insecure flags will be prefixed properly. Since this config sets "external": true, Boyka won’t launch Appium with these arguments—ensure your standalone Appium server is started with the same --allow-insecure flags.

core-java/src/main/java/io/github/boykaframework/config/ui/mobile/server/ServerSetting.java (1)

19-22: Static imports improve readability.

Good choice; keeps stream mapping concise.

Comment on lines +95 to +96
- name: Install Appium 3.0
if: inputs.run-appium
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Broken step condition: missing expression delimiters.

if: must use expression syntax; otherwise the step may not evaluate as intended.

-      - name: Install Appium 3.0
-        if: inputs.run-appium
+      - name: Install Appium 3.0
+        if: ${{ inputs.run-appium }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install Appium 3.0
if: inputs.run-appium
- name: Install Appium 3.0
if: ${{ inputs.run-appium }}
🤖 Prompt for AI Agents
.github/workflows/_test-core-java.yml around lines 95 to 96: the step condition
uses bare `if: inputs.run-appium` which is invalid; wrap the input in an
expression so GitHub evaluates it (e.g. replace with `if: ${{ inputs.run-appium
}}` or an explicit expression like `if: ${{ inputs.run-appium == 'true' }}`) to
ensure the step condition is evaluated correctly.

Comment on lines 136 to 138
- name: Enable KVM
if: inputs.run-android
if: inputs.run-android && startsWith(inputs.runs-on, 'ubuntu')
run: |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Another step condition missing expression delimiters.

Without ${{ }}, this may be parsed as a literal string.

-      - name: Enable KVM
-        if: inputs.run-android && startsWith(inputs.runs-on, 'ubuntu')
+      - name: Enable KVM
+        if: ${{ inputs.run-android && startsWith(inputs.runs-on, 'ubuntu') }}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
.github/workflows/_test-core-java.yml lines 136-138: the step condition is
written as a plain string (`if: inputs.run-android && startsWith(inputs.runs-on,
'ubuntu')`) and will be treated literally; wrap the entire expression in GitHub
Actions expression delimiters so it reads `if: ${{ inputs.run-android &&
startsWith(inputs.runs-on, 'ubuntu') }}` to ensure the condition is evaluated.

@sonarqubecloud
Copy link
Copy Markdown

@WasiqB WasiqB merged commit cc3a7f0 into main Aug 30, 2025
55 of 57 checks passed
@WasiqB WasiqB deleted the issue-1070 branch August 30, 2025 19:52
@WasiqB
Copy link
Copy Markdown
Member Author

WasiqB commented Oct 7, 2025

🚀 This pull request is included in v2.9.0. See Release 2.9.0 for release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 pr: bug fix PR which fixes a bug

Projects

Development

Successfully merging this pull request may close these issues.

✨ Update feature: Handle Appium v3

1 participant