-
Notifications
You must be signed in to change notification settings - Fork 62
impl Index on XCUIElementQuery, siri, device buttons and orientation in objc2-xc-ui-automation #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl Index on XCUIElementQuery, siri, device buttons and orientation in objc2-xc-ui-automation #809
Conversation
madsmtm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with carrying manual additions like these until we progress further on #408.
|
I tested record-compressed.mp4The change in orientation doesn't change the macOS simulator app's orientation but it does actually change the orientation of the app inside the simulator. |
| # Maybe, unsure if desirable: | ||
| default = [ | ||
| "std", | ||
| "block2", | ||
| "objc2-app-kit", | ||
| "objc2-core-foundation", | ||
| "objc2-core-location", | ||
| "objc2-ui-kit", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this works without changes to the translator, so I've removed it for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! And sorry for letting this PR languish a bit.
I've been playing around with the
objc2-xc-ui-automationcrate and figure some additional features should be added.Most of this is really just a stop gap in place of #408
I spent like 20 minutes fighting
Retained<XCUIElementQuery>and&XCUIElementQueryand then I asked claude for some help which it suggested dereferencing*mut T. I'm not really a fan but I'm not sure what's better.I was already in the space and had noticed some other pieces that would be nice.
framework-crates/objc2-xu-ui-automation/src/device_buttons.rshas theXCUIDeviceButtonsconditionally compiled for iOS, watchOS, visionOS and tvOS. These can be used viapressButton.framework-crates/objc2-xu-ui-automation/src/siri.rsadds getting thesiriServiceout of theXCUIDevice, and the correspondingXCUISiriServicestruct and it's few calls.framework-crates/objc2-xu-ui-automation/src/orientation.rsadds the calls ofsetOrientationandorientationonXCUIDevice. This should ideally be behind a feature flag ofobjc2-ui-kitas the generated stuff would be and then haveobjc2-ui-kitas an optional dependency. It's sloppy but I figure that just duplicating the UIOrientation struct might be the least bad. Is there a flag totranslation-config.tomlto do this nicely?If there's not a great way to do the
Indextrait ororientation, I'm cool with dropping them.