Closed theblixguy closed 5 years ago
Easily fixed at least. Hadn't thought of that since I chucked the demo together with a Touch ID simulator. Good catch!
Fixed :) although the tests need to be tweaked to handle the permissions alert
Just an update to say I’ve modified the tests to handle the Face ID permissions prompt (and learnt some more in the process!)
Nice! I also noticed that you have to enroll before you call app.launch()
otherwise canEvaluatePolicy()
returns false if you try enrolling after the app has launched. Not sure if this is a bug or expected behaviour!
Hmm not sure, you’ll definitely need to for this demo because all of the UI is set up at launch time, so enabling biometrics after the app has launched wont have an effect. It shouldn’t be a problem in an app that adapts as things change after launch though.
The UI tests are crashing because the
NSFaceIDUsageDescription
key hasn't been specified in the project'sInfo.plist
(also it needs to be handled in the UI tests i.e. accepting the authorisation dialog).I only realised this when writing UI tests for TABTestKit - I thought it may have something to do with the bridging header, but upon digging deeper into the stack trace, I noticed the text
__CRASHING_DUE_TO_PRIVACY_VIOLATION__
and then it hit me - I forgot to include theNSFaceIDUsageDescription
key! I checked this demo project and noticed it's missing it as well, so the UI tests will crash unless its fixed.Surprisingly the tests pass in the end if you leave it for a minute:
tearDown
takes about 60 seconds and then the tests pass 🤔 Seems like a bug in Xcode, this shouldn't be happening!