jeudi 28 mai 2015

Accurately delaying time between KIF waitForViewWithAccessibilityLabel and tapViewWithAccessibilityLabel

Is there a way to accurately (to thousands of a second) delay the time between waiting for a view to appear waitForViewWithAccessibilityLabel and then tapping another view tapViewWithAccessibilityLabel in KIF. In my app code I set to DateTime objects on view appear and tap but this time difference does not match the delay I put in KIF.

I have tried waitForTimeInterval and also

 while(true) {
    NSTimeInterval time = [[NSDate date] timeIntervalSinceDate:dateStart];
    if(time > 1.678)
        break;
 }

but those both have errors of about 0.15 seconds. I assume that this error comes from the waitForViewWithAccessibilityLabel looking for the view to appear. Is there any way to set the start time of a the timer at the time the view is actually found? Or any other suggestions on solving this problem?

Cheers, Mo

Aucun commentaire:

Enregistrer un commentaire