feat: add action and camera values for mobile: pressButton#1115
feat: add action and camera values for mobile: pressButton#1115eglitise merged 8 commits intoappium:masterfrom
action and camera values for mobile: pressButton#1115Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for additional iOS hardware button names (action, camera) to mobile: pressButton in WebDriverAgent by mapping them to the corresponding XCUIDeviceButton values when available on-device.
Changes:
- Extend
XCUIDevice (FBHelpers)button name mapping to includeaction(iOS 16+) andcamera(iOS 16+) gated byhasHardwareButton:. - Update the public header docstring to list the newly supported button names.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m | Adds runtime-gated mapping for action/camera buttons and updates supported button list construction. |
| WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.h | Updates API documentation to include action and camera button names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| } | ||
| } | ||
|
|
||
| - (BOOL)fb_hasButton:(NSString *)buttonName |
There was a problem hiding this comment.
I assume this is expected to be called only for non-tvOS, then wrapping the entire method with #if !TARGET_OS_TV and reduce it inside this method would simplify the context switching when we read the code. Then, we can assume this button is dedicated for non-tvOS env.
There was a problem hiding this comment.
I would like to extend it in the other tvOS PR, which is why I haven't added the target compiler guard for the whole method. Or would it be better to make two separate fb_hasButton methods?
There was a problem hiding this comment.
Personally yes. One is dedicated for tvOS and the other is iPhone, rather than mixed up both in one method and add many if/endif in it. (this is more internal/private method thing)
Test session results, code coverage, and logs: |
|
I'll create the XCUITest driver PR after merging #1116, if that's okay. |
## [11.2.0](v11.1.7...v11.2.0) (2026-03-04) ### Features * add `action` and `camera` values for `mobile: pressButton` ([#1115](#1115)) ([3df0284](3df0284))
|
🎉 This PR is included in version 11.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Currently WDA only supports the
home,volumeUpandvolumeDownbuttons for iOS, but Apple's documentation also listsactionandcamera. This PR adds support for them.Since not all devices have these buttons, their use is guarded behind the
hasHardwareButton:check, which itself requires iOS 16, so a second guard was also added.(I don't actually have a way to test this, so any validation would be appreciated)
Reference: https://developer.apple.com/documentation/xcuiautomation/xcuidevice/button?language=objc