Thank-you for your reply.
First, I want to re-iterate that the application appears run correctly and the difficulty is only with the XCUITest part. That of course does not mean that the application is put together correctly, only that it seems to work for me.
I did use an explicit co-ordinate space. My SwiftUI Canvas structure employed the .coordinateSpace modifier with a .named(...) parameter specifying a character string constant. My DragGesture also used the same .named(...) parameter; as do my MagnifyGesture and my SpatialTapGesture.
I'll change the code to use .local for the gesture definitions and remove the modifier to the Canvas structure.
It is also the case that my Canvas structure employs an animation modifier
.animation(.interactiveSpring, value: currentOffset)
Did you also animate the drag in your test application?
The view hierarchy is:
- NavigationStack
-- VStack
--- Spacer
--- Text
--- HStack
---- Text
---- Text
---- Text
---- Text
--- Text
--- Spacer
--- GeometryReader
---- Canvas
--- NavigationLink
The modifiers used for the Canvas structure are:
accessibilityIdentifier
coordinateSpace
gesture(drag definition)
offset(current offset CGSize variable)
animation
clipped
onTapGesture(count of 2 sets currentOffset to .zero and current scale to 1.0)
gesture(magnification definition)
scaleEffect(scale CGFloat variable initially 1.0 and anchor UnitPoint set to .zero
animation(.easeInOut, value: scale)
gesture(the SpatialTapGesture)
onChangeOf the tap location, sets an optional variable with the display information
popover(item: the optional variable with display information)
So, after trying the coordinateSpace change to .local assuming that there is no change), I'll create a simple application and the corresponding UI test classes to explore further.
Thanks again.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: