kif-framework / KIF

Keep It Functional - An iOS Functional Testing Framework
Other
6.21k stars 914 forks source link

Xcode 13 - waitForView(withAccessibilityIdentifier) issue #1240

Closed lolindrath closed 2 years ago

lolindrath commented 2 years ago

I have a project where I test that a UILabel within a UITableView section header is set correctly. This test runs fine in Xcode 12 / iOS 14 but in Xcode 13 / iOS 15 it crashes because waitForView returns the UITableView instead of the expected UILabel. Here's the error:

Could not cast value of type 'UITableView' (0x11637a978) to 'UILabel' (0x1163852d8).

Steps to Reproduce:

  1. Open sample project below in Xcode 12 and run the tests on a iOS 14
  2. Note that the test runs fine
  3. Open sample project below in Xcode 13 and run the tests on iOS 15
  4. The testLayout() test should crash and throw the above message.

https://github.com/lolindrath/TableSectionHeaderKIF

Let me know if I can supply any more details, thanks!

dostrander commented 2 years ago

Awesome, thanks for the repro steps+project. I'll try this out today

This seems to be a duplicate of #1239 but I'm going to keep this open since it has the repro project and will close both when finished.

lolindrath commented 2 years ago

@dostrander I agree it's really close and most likely related, the only difference I see is this bug is returning a UITableView and #1239 returns null so I figured a fresh bug couldn't hurt.

Feel free to combine after you have a chance to look - I'll move the above details over if I see this one get closed as a dup.

dostrander commented 2 years ago

@lolindrath I've got this reproduced, just looking for a "good" solution

dostrander commented 2 years ago

Your repro steps are fixed by https://github.com/kif-framework/KIF/pull/1241 will try to get it merged and released today or by EoW

lolindrath commented 2 years ago

I pointed my project to a local copy of KIF and it worked great, thanks!

lolindrath commented 2 years ago

Thanks @dostrander ! You're awesome!

dostrander commented 2 years ago

This has been released with 3.8.4