Post not yet marked as solved
In my XCUITest tests, I expected to be able to scroll elements in iOS >= 15 devices (with X,Y deltas) since it’s declared in the header file as:
/**
* Scroll the view the specified pixels, x and y.
*/
@available(iOS 15.0, *)
open func scroll(byDeltaX deltaX: CGFloat, deltaY: CGFloat)
However, in the documentation website (https://developer.apple.com/documentation/xctest/xcuielement/1500758-scroll) it says under “Discussion”:
Available in macOS and in iPadOS 15 and later.
No iPhones :( Although it says nothing under “Availability”.
Calling this action when running on iPhone simulator, indeed raises the error message:
Pointer events are not supported for this device.
I’d expect this action to work on iOS as well, and not only on iPadOS. But sadly, as I mentioned, it isn't.
I made some workaround to make this "work" (partially), using XCUICoordinate but I really don't like it (since it's impossible to find an hittable coordinate without guessing or using some messy heuristics that includes frames work) and would have been happy for something more elegant.
Is there any reasonable (elegant and accurate) alternative for this, that is scrolls based on X and Y deltas?
Post not yet marked as solved
It seems like there’s no access to many accessibility properties of UI elements exposed in XCUITest framework (XCUIElement).
Specifically, I’m trying to test the accessibility hint (accessibilityHint) of an element, but unable to do that.
Although this is what I'm missing right now, but in general there are more accessibility properties I'd like to be able to access:
accessibilityTraits
accessibilityLanguage
accessibilityActivationPoint
accessibilityPath
Is there any way to do this using XCUITest framework?
If not, why can't we access them if those are accessibility attributes? What am I missing here?
Post not yet marked as solved
I'm trying to use this API in my UITest suite:
https://developer.apple.com/documentation/xctest/xcuicoordinate/3551692-press
press(forDuration:thenDragTo:withVelocity:thenHoldForDuration:)
However, the holdDuration parameter has no affect and the action stops once the drag is finished (instead of keep holding the element).
I've reproduced this error with a demo application, along with a reproductive UI test and videos:
https://github.com/asafkorem/XCUITestHoldBugReproduction
Also, I do not find any reasonable workaround for the problem.
Thanks.
Post not yet marked as solved
Executing /usr/bin/xcrun simctl terminate <Device UDID> <App Bundle ID> when the simulator is available but the app is not currently running causes the following error:
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=3):
Application termination failed.
FBSSystemService reported failure without an error, possibly because the app is not currently running.
This happens with Xcode 13.2 + Xcode CLI tools version 2392, however, it didn't happen in Xcode CLI tools version 2384, also Xcode 13.2, on a different machine.
First, I wonder why there's a difference between the Xcode CLI tools versions if the Xcode version is the same (both were installed from the website). Is it possible that it's related to the MacOS version (first has Monterey version 12.1 and second has Big Sur 11.6)?
Second, is this a new added error in one of the latest versions of simctl? Could we find this anywhere in a release note?