Our UI test suites are showing some unexpected behaviour where our Create Password screen intermittently auto-completes both the username and password - this results in the test being failed.
The process is something like:
This last step fails because the passwords in both fields have been auto-completed.
This happens for about one in every ten to twenty test executions.
Our understanding is that the password auto-fill should never be seen in any simulator, so it's very confusing to see this at all. Is there something that we can do to extra disable autofill, or otherwise prevent this from happening?
Prevent iPhone from automatically filling in passwordsGo to Settings > Passwords > AutoFill Passwords, then turn off AutoFill Passwords.
Had the same problem. What was useful for me is going to settings of the simulator -> Passwords -> Turn On and then Turn OFF AutoFill passwords.
going to settings of the simulator -> Passwords -> Turn On and then Turn OFF AutoFill passwords.
type any password
Not sure if it was like that since the beginning but setting isSecureTextEntry = true
is enough to trigger that bug as well (at least in Xcode 12.2).
Therefore, the work-around which worked for me was:
let field = UITextField()
if #available(iOS 11.0, *) {
#if targetEnvironment(simulator)
// Do Not enable '.password' or '.newPassword' or 'isSecureTextEntry' text content type on simulator as it ends up with annoying behaviour:
// 'Strong Password' yellow glitch preventing from editing field.
print("Simulator! not setting password-like text content type")
#else
field.textContentType = .password
field.isSecureTextEntry = true
#endif
}
field.placeholder = "Password"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With