I'm writing automated UI test using native tools. On one flow there is poped a fingerprint authentication. How can I pass it, to move forward to next screen?
You cannot fake a fingerprint in a UITest. To pass the authentication and test the part of you app that is shielded by the TouchID prompt you can run the test on a device that has not enabled TouchID. Or run it on a Simulator (without enabling TouchID).
When TouchID is not enabled the OS asks you for the device's passcode. You can enter the passcode and pass the authentication. When running the test on a Simulator you can enter anything as passcode. It will always pass.
Here is an example test that passes the authentication by entering a passcode:
func testExample() {
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let app = XCUIApplication()
app.launch()
// this causes the authentication prompt to be displayed
app.buttons["Press Me!"].tap()
let passcodeInput = springboard.secureTextFields["Passcode field"]
passcodeInput.tap()
passcodeInput.typeText("abc\r")
// continue test
....
}