I'm struggling fixing my UI tests for iOS 14 that set date on DatePicker views. They were previously running without any problems on iOS 13 when they were shown as wheel pickers. My code used to set the different wheels but since there aren't any wheels anymore on iOS 14, this is not working anymore.
I've tried to use a small demo project and record the change of the date using XCode 12 record button, but it's not working (on Mac OS 10.15.6) because of an error: "Timestamped Event Matching Error: Failed to find matching element" after pressing the date button.
What I'm looking for is a UI test case to set a date for the new date picker of iOS 14:
Here's my demo project:
import SwiftUI
struct ContentView: View {
@State private var date = Date()
var body: some View {
Form {
DatePicker(selection: $date, displayedComponents: .date) {
Text("Date")
}
}
}
}