Skip to content

Commit

Permalink
Up the default animation waiting timeout from .5s to 2s
Browse files Browse the repository at this point in the history
It doesn't really make sense that the default animation wait time
is the same as the stabilization time. This effectively means the
behavior of scanning the UI hierarchy for animations in progress is
never utilized for most tests out of the box.

For what its worth, we've used a 2s animation wait time and .1s
stabilization time as our defaults for a very long time.

This should generally not slow down any tests if there weren't any
animations in progress. If there were animations in progress, this
is probably a worthwhile tradeoff to make things more reliable. This
can still be configured globally to be overidden.

As part of this change, use `waitForAnimationsToFinish` in place of
a static .5s sleep for the `longPress` action.

There will be a followup PR #1301 that should speed up some scenarios
where we're waiting longer than desired for animations to complete.
  • Loading branch information
Justin Martin committed Sep 19, 2024
1 parent 1550322 commit 424ed5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/KIF/Classes/KIFTestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ - (void)runBlock:(KIFTestExecutionBlock)executionBlock

#pragma mark Class Methods

static NSTimeInterval KIFTestStepDefaultAnimationWaitingTimeout = 0.5;
static NSTimeInterval KIFTestStepDefaultAnimationWaitingTimeout = 2.0;
static NSTimeInterval KIFTestStepDefaultAnimationStabilizationTimeout = 0.5;
static NSTimeInterval KIFTestStepDefaultMainThreadDispatchStabilizationTimeout = 0.5;
static NSTimeInterval KIFTestStepDefaultTimeout = 10.0;
Expand Down
2 changes: 1 addition & 1 deletion Sources/KIF/Classes/KIFUITestActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ - (void)longPressAccessibilityElement:(UIAccessibilityElement *)element inView:(
}];

// Wait for view to settle.
[self waitForTimeInterval:0.5 relativeToAnimationSpeed:YES];
[self waitForAnimationsToFinish];
}

- (void)waitForKeyboard
Expand Down

0 comments on commit 424ed5f

Please sign in to comment.