KIF can not force app to background

81 Views Asked by At

I have a problem when app push to background and resume app. When app push to background then it can not force to ground to resume my app Here is my code:

   - (void)testResumingEditProfile {
    self.methodName = NSStringFromSelector(_cmd);

    user = [TestUser sharedInstance].defaultNextUser;
    user.username = @"347";
    [tester doLoginSuccessfully:user];

    app = [UITestApp sharedInstance];
    screen = [tester navigateToOverviewPage];

    employee = [[TestEmployee alloc] init].profileEmployee;

    [self openEditProfile];
    [tester catpureScreen:[self getCaptureScreenName:@"afterOpenEditProfile"]];

    [system deactivateAppForDuration:5]; //Code to deactive and resume app
    [tester catpureScreen:[self getCaptureScreenName:@"afterResumeEditProfile"]];

    [tester waitForView:@"text-first-name" in:screen];
    [tester waitForView:@"text-last-name" in:screen];

    [tester tap:@"label-show-detail" in:screen];
    [tester catpureScreen:[self getCaptureScreenName:@"afterOpenDetail"]];

    [system deactivateAppForDuration:5]; //Code to deactive and resume app
    [tester catpureScreen:[self getCaptureScreenName:@"afterResumeEditProfileDetail"]];
    [tester waitForView:@"label-personal-infomation" in:screen];
    [tester waitForView:@"label-contact-infomation" in:screen];
}

Someone guy please help me to solve this problem. Thanks.

1

There are 1 best solutions below

0
atgrubb On

Unfortunately this functionality is not supported. There are workarounds, though. See this github issue https://github.com/kif-framework/KIF/issues/183