feat: define device methods natively on Appium::Driver#1109
Merged
KazuCocoa merged 1 commit intoappium:masterfrom Apr 19, 2026
Merged
feat: define device methods natively on Appium::Driver#1109KazuCocoa merged 1 commit intoappium:masterfrom
KazuCocoa merged 1 commit intoappium:masterfrom
Conversation
Adds explicit `def_delegators :driver, ...` for device-layer methods (lock/unlock, hide_keyboard, push_file, pull_file, background_app, shake, press_keycode, ime_*, context_*, app_strings, install_app, etc.) that were previously wired up only implicitly by `extend ::Appium::Core::Device` via a static compatibility list in ruby_lib_core (lib/appium_lib_core/device.rb:26-42). Defining them here lets ruby_lib_core drop that list (appium/ruby_lib_core#97), which every new bridge endpoint currently has to be added to by hand. Native `Appium::Driver#execute_driver` (driver.rb:711) continues to win over the class-level delegator since Ruby redefines methods in source order.
KazuCocoa
approved these changes
Apr 19, 2026
Member
|
lg 👍 |
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.
Description
This PR defines the device layer methods natively on
Appium::Driverviadef_delegators :driverinstead of relying on them being set up implicitly byextend ::Appium::Core::Devicewhich walks a static list inruby_lib_core/lib/appium_lib_core/device.rb#L26-L42The methods covered are the same ones that list covers
lockunlockdevice_locked?hide_keyboardis_keyboard_shownpush_filepull_filepull_folderbackground_appshakepress_keycodekeyeventlong_press_keycodetheime_*group the context groupapp_stringsinstall_appremove_appapp_installed?activate_appterminate_appapp_statestop_recording_screenstop_and_save_recording_screendevice_timeexecute_cdptake_element_screenshotsave_viewport_screenshotand the image comparison methodsexecute_driveris intentionally not in the delegator list becauseAppium::Driveralready defines its ownexecute_driver(driver.rb:711) and we want to keep that oneThe
extend ::Appium::Core::Devicecall ininitializeis kept because it is still needed for the platform specific endpoints that get added throughadd_endpoint_methodlike touch_id clipboard etcMotivation and Context
Following up on appium/ruby_lib_core#97
@KazuCocoa mentioned there that the cleanest way forward is to first define these methods on
ruby_libside and then we can remove the static list inruby_lib_coreso this PR is that first stepOnce this is merged I will open the follow up PR to
ruby_lib_coreto drop the listHappy to adjust anything if you prefer a different approach