Repository navigation
fix: resolve hub URL on appium_lib_core 11+ and read viewportRect as a Hash (PPLT-6148) - #41
Conversation
…a Hash (PPLT-6148)
appium_lib_core 11+ (selenium-webdriver ClientConfig) no longer sets the HTTP
client's @server_url, so the SDK's reflection returned "". On BrowserStack that
made every session resolve to GenericProvider: Android App Percy failed with
"Missing required tag name for comparison", iOS silently skipped the AppAutomate
path, and Percy on Automate posted an empty executor URL ("Comparison tag details
not available"). Fall back to http.client_config.server_url when @server_url is
unset.
AndroidMetadata read capabilities.to_json['viewportRect'], which indexes a JSON
String, so the rect was never used and every call fell back to
driver.get_system_bars (the Appium 2-only `mobile: getSystemBars` on core 13+).
Read it through get_capability_value instead.
CI adds a Ruby 3.3 / appium_lib ~> 16.0 leg (APPIUM_LIB_VERSION) and pins
minitest ~> 5.0 (minitest 6 split out Minitest::Mock).
Verified live on BrowserStack with appium_lib 16.3.2 / core 13.1.4: App Percy
Android+iOS on Appium 1.22.0 and 2.19.0, and Percy on Automate mobile web on
2.19.0, all 3/3 snapshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (6)
🧰 Additional context used🪛 zizmor (1.30.1).github/workflows/test.yml[warning] 1-74: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 14-74: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 📝 WalkthroughWalkthroughThe pull request updates Appium and Minitest dependency selection. It also changes Android viewport capability handling and driver server URL retrieval, with tests for the metadata behavior. ChangesAppium dependency compatibility
Driver and Android metadata
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No identified issue blocks merging after normal checks. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
Summary
Jira: PPLT-6148 — Appium quarterly upgrade + shift default to Appium 2.x
The SDK breaks on
appium_lib15/16 (appium_lib_core>= 11) on every Appium server version.Root cause
Metadata#remote_urlandDriverMetadata#command_executor_urlread the hub URL via@bridge.@http.@server_url. Fromappium_lib_core11 (selenium-webdriverClientConfig) that ivar is no longer set; the URL lives inhttp.client_config.server_url. The SDK got"", so:GenericProviderinstead ofAppAutomate→ Android:Missing required tag name for comparison(no device name); iOS: silently skips the AppAutomate path.commandExecutorUrl→ CLIComparison tag details not available.AndroidMetadatareadcapabilities.to_json['viewportRect'], which indexes a JSON String, so the rect was never used and every call fell back todriver.get_system_bars(the Appium 2-onlymobile: getSystemBarson core 13+).Fix
Percy::DriverMetadata.server_urlkeeps the@server_urlpath and falls back toclient_config.server_url(trailing slash stripped); used by both call sites.viewportRectread viaget_capability_value(Hash or nil).APPIUM_LIB_VERSION='~> 16.0';appium_consoleonly on the 12.x resolution;minitest ~> 5.0(minitest 6 movedMinitest::Mockout).assert(x, y)in the touched specs.Verification
appium_lib12) and 3.3 (appium_lib16.3.2 / core 13.1.4). New specs fail when the fix is reverted.main.appium_lib16.3.2: App Percy Android + iOS on Appium 1.22.0 and 2.19.0, and Percy on Automate (Chrome/Safari) on 2.19.0 — all 3/3 snapshots, comparison tags carry the real device names.🤖 Generated with Claude Code
Summary by CodeRabbit