Repository navigation
fix: support symbol webSocketUrl capability for BiDiBridge and guard nil bidi on close - #729
Merged
KazuCocoa merged 2 commits intoOct 27, 2026
Conversation
…nil bidi on close
KazuCocoa
requested changes
Oct 27, 2026
| def bidi_enabled?(capabilities) | ||
| return false unless capabilities | ||
|
|
||
| ['webSocketUrl', :webSocketUrl, 'web_socket_url', :web_socket_url].any? { |key| capabilities[key] } |
Member
There was a problem hiding this comment.
We're going to remove the snack_case conversion in #674, so this don't be full modifications. bidi_enabled? can be removed
Contributor
Author
There was a problem hiding this comment.
Updated to inline (capabilities['webSocketUrl'] || capabilities[:webSocketUrl]) and removed bidi_enabled? — thanks @KazuCocoa!
| raise ::Appium::Core::Error::ArgumentError, "Unable to create a driver with parameters: #{opts}" unless opts.empty? | ||
|
|
||
| @has_bidi = capabilities && capabilities['webSocketUrl'] ? true : false | ||
| @has_bidi = bidi_enabled?(capabilities) |
Member
There was a problem hiding this comment.
Suggested change
| @has_bidi = bidi_enabled?(capabilities) | |
| @has_bidi = capabilities && (capabilities['webSocketUrl'] || capabilities[:webSocketUrl]) ? true : false |
KazuCocoa
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Appium::Core::Base::Capabilitiespreserves the input key type when initialized from a hash (e.g.,webSocketUrl: trueas shown in theBiDiBridgedocumentation example, orweb_socket_url: true), whereasDriver#create_bridgeonly checkedcapabilities['webSocketUrl']. WhenwebSocketUrlwas passed as a symbol key,@has_bidiremainedfalseandBridgewas used instead ofBiDiBridge.Additionally, if
BiDiBridge#create_sessioncompleted without awebSocketUrlin the server response (leaving@bidiasnil),BiDiBridge#quitandBiDiBridge#closeraisedNoMethodErrorwhen callingbidi.close.This PR:
'webSocketUrl',:webSocketUrl,'web_socket_url', and:web_socket_urlwhen determining@has_bidiinDriver#create_bridge.bidi&.close) inBiDiBridge#quitandBiDiBridge#close.Testing
bundle exec rake rubocopbundle exec rake steepUNIT_TEST=true bundle exec rake test:unit TEST=test/unit/driver_test.rb