Kevin LE GOFF
Kevin LE GOFF

Reputation: 770

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.

Upvotes: 0

Views: 598

Answers (2)

Kevin LE GOFF
Kevin LE GOFF

Reputation: 770

Thank you @Smart Monkey for putting me on the good track

I managed to accept the call using the Springboard app.

 let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
 springboard.buttons["Accept"].tap()

The call is then properly established.

Upvotes: 1

Roman Zakharov
Roman Zakharov

Reputation: 2273

  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)

Upvotes: 2

Related Questions