I'm working on developing tests using KIF for a project. I want to know if it's possible to have KIF simulate a tap on the home button? Is it also possible to simulate other actions at that point, such as bringing up the command center or the notification center?
At least a partial answer for you, take a look at deactivateAppForDuration
in KIFTestActor.h
:
/*!
@abstract Backgrounds app using UIAutomation command, simulating pressing the Home button
@param duration Amount of time for a background event before the app becomes active again
*/
- (void)deactivateAppForDuration:(NSTimeInterval)duration;
For swift 3 and Xcode 8, this function of KIFSystemTestActor works:
system().deactivateApp(forDuration: 3)
extension XCTestCase {
func system(_ file : String = #file, _ line : Int = #line) -> KIFSystemTestActor {
return KIFSystemTestActor(inFile: file, atLine: line, delegate: self)
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With