I have a loading indicator created by the code below. How can I add an identifier that will allow me to test for its presence on the page using XCUIApplication.something["identifier"].isHittable
or similar?
var body: some View {
HStack {
Circle()
.fill(dotColor)
.opacity(shouldAnimate ? 1 : 0.1)
.frame(width: dotSize, height: dotSize)
.scaleEffect(shouldAnimate ? 1.1 : 0.9)
.animation(easyDoesIt, value: shouldAnimate)
Circle()
.fill(dotColor)
.opacity(shouldAnimate ? 1 : 0.1)
.frame(width: dotSize, height: dotSize)
.scaleEffect(shouldAnimate ? 1.1 : 0.9)
.animation(easyDoesIt.delay(0.2), value: shouldAnimate)
Circle()
.fill(dotColor)
.opacity(shouldAnimate ? 1 : 0.1)
.frame(width: dotSize, height: dotSize)
.scaleEffect(shouldAnimate ? 1.1 : 0.9)
.animation(easyDoesIt.delay(0.4), value: shouldAnimate)
}
.onAppear {
self.shouldAnimate = true
}
}