Search code examples
objective-cunit-testingswiftkif

accessibility label storekit user input


Is there a way to assign, or get, the accessibility label of the password textfield input that apple displays after a user makes an inapp purchase? I'm trying to automate my tests, and I cannot test my purchases without inputting my test's account password.


Solution

  • In-app purchase dialogs are generated by the system and is outside the purview of KIF generally. If you have a lot of these flows you may want to check out something like Subliminal, Appium, or the like which can control more things outside of your app.

    However, depending on the flow, you may be able to use

    [tester enterTextIntoCurrentFirstResponder:@"something"];
    

    The idea here being that if the text field is already focused you may be able to just type in what you need and confirm (you may also need to tune a slight delay). This is highly dependent on the exact flow though so may or may not work. Good luck!