Search code examples
iosxcodecallkitxcuitest

Automating Callkit accept call


I am working on automating testing for Callkit interaction. I managed to call from client A to B.

When B receives the call he is shown the Callkit screen. Manually, I can click on accept and the call is established. However when I try to record the Callkit interaction, XCode is crashing and the application on the phone as well.

Am I breaking any security limitation by trying to automate the "Accept call" interaction?

As I am not able to access the Callkit screen element via interaction recording;

I am wondering if someone as any experience with that kind of automation or if someone could point me to the documentation that would describe the button ids for the Callkit screen.


Solution

    1. You should determine the application of this screen. Probably, Springboard. Try inspecting with the Console app.
    2. Then, initialise interaction with this app with let app = XCUIApplication(bundleIdentifier: )
    3. Inspect app hierarchy with breakpoint and po app command to get labels and accessibility identifiers. Or use Accessibility Inspector.
    4. Do required action is code (taps and/or swipes)