Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 16 in CI #1306

Merged

Conversation

justinseanmartin
Copy link
Contributor

@justinseanmartin justinseanmartin commented Sep 23, 2024

Configure KIF CI to run on Xcode 16.0 & iOS 18.0, bringing us to a total of 6 CI configurations. I've moved the one that does the extra validation to the Xcode 16 build part. If I could test iOS 16 w/ Xcode 15, I'd drop support for Xcode 14.3.1, but that isn't set up on GH hosted runners and I think it is worth still testing on iOS 16.

Aside from needing to land the fix for UICollectionView asserts in #1307, TypingTests testEnteringTextIntoFirstResponder was also failing on CI and required some behavior changes to get them working reliably. The behavior was that we were attempting to tap "Select All" after a long press, but we weren't waiting long enough for the popover control to appear. Tapping too early was then dismissing the popover rather than actually performing a "Select All" operation.

The KIF framework functional changes are:

  • Ensure that all windows (including the UITextEffectsWindow) get layer speed multipliers applied
    • I noticed that the text effects window wasn't matching the speed of the main window when increasing the animation speed. This is mostly a performance optimization, but it also causes issues because we use the layer speed as a scale multiplier for the animation stabilization time.
  • Improve detection of in progress animations
    • The test wasn't correctly waiting until the popover control fully appeared with "Slow Animations" setting enabled on the iOS simulator. They also wouldn't behave correctly with the layer speed cranked up to 100x. The change in this commit works more reliably, though it does rely on some non-public Apple APIs.
  • Set .25s min for animation stabilization wait time, regardless of layer speed
    • When the animation layer speed is increased to 100x, there is no animation used for presenting the text popover. This is a problem though, because there is still some delay before it is presented. I went back and forth between not scaling the stabilization time or this approach, but this seems like the better route.

I also took this opportunity to speed up the test execution time by a couple seconds by dropping 2 second longPress actions to be 1s instead. This wasn't necessary, but I was running some tests that used long presses a lot and it seemed like a nice small improvement.

You can review each of these changes in the individual commits, which I do not plan to squash on merging this PR.

@justinseanmartin justinseanmartin changed the title jmartin/xcode 16 Xcode 16 in CI Sep 23, 2024
@justinseanmartin justinseanmartin marked this pull request as ready for review September 26, 2024 09:35
… applied

The UITextEffectsWindow directly uses a private initializer, bypassing the public initializer.
The `[UIWindow init]` implementation will call through to this private designated initializer,
so overriding both is unnecessary. I've added an assertion to the swizzle helpers to prevent
this from silently failing in the future if the private APIs change.
There were cases where we were not identifying animations that were still
in progress. For example, if I turn on the simulator slow animations setting,
we don't wait a sufficient amount of time for animations to complete. This
was consistently showing up when running -[TypingTests testEnteringTextIntoFirstResponder]`.

As this test was failing on Xcode 16 in CI, it seems like this change is
needed to get KIF working reliably.
…er speed

When animations are set to 100x speed, the text field popover control is
presented without animations. This causes issues in the call to waitForAnimations,
because the presentation still happens after some delay. This is a crude hack to
prevent significantly sped up animations from failing to tap on popovers.
}
} else if (currentTime > completionTime) {
// Otherwise, use the completion time to determine if the animation has been completed.
// This doesn't seem to always be exactly right however.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about the cases where it's not quite right, can you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I was seeing was when running TypingTests.testEnteringTextIntoFirstResponder, it would try to tap on "Select All" before it was finished being presented on Xcode 16. For some reason, startTime + duration was before the animation completed if I was watching it run in the simulator.

Copy link
Contributor

@RoyalPineapple RoyalPineapple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks for taking this on.

@justinseanmartin justinseanmartin merged commit fbed62a into kif-framework:master Sep 26, 2024
7 checks passed
@justinseanmartin justinseanmartin deleted the jmartin/xcode-16 branch September 26, 2024 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants