[UI Tests] Trigger applicationWillTerminate() in UI Testing

Currently I'm facing an issue in creating UI tests:

When users terminate the app, applicationWillTerminate() will start some tasks. I want to verify this user flow in UI tests. However, just using terminate() does not actually call applicationWillTerminate(). A way I thought of:

In UI test, mock user actions by opening app switcher. Then swipe up the app in app switcher and close the app.

However, I haven't found a way to open app switcher in UI testing. Could anyone help me on this? Thank you.

[UI Tests] Trigger applicationWillTerminate() in UI Testing
 
 
Q