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 13 - waitForView returns nil #1239

Closed
alekkania opened this issue Sep 27, 2021 · 17 comments
Closed

Xcode 13 - waitForView returns nil #1239

alekkania opened this issue Sep 27, 2021 · 17 comments
Labels

Comments

@alekkania
Copy link

alekkania commented Sep 27, 2021

I faced with issue in Xcode 13 that waitForView method returns nil for view with accessibilityIdentifier as well as accessbilityLabel.
It is strange because sometimes it works if tests are started as whole class instead of single one.

It mostly happen on UITable/CollectionView.

Anyone faced with this issue as well?

@dostrander
Copy link
Contributor

@alekkania have you or anyone else seen this on CI or is this mostly only local?

@dostrander dostrander added the Bug label Sep 27, 2021
@alekkania
Copy link
Author

@dostrander Yes it happen on CI as well.

@dostrander
Copy link
Contributor

Got it, let me look into this a bit

@dostrander
Copy link
Contributor

@alekkania is this just return nil or is it also giving you an error in the test when calling waitForView?

Also if you have a repro project and/or code that'd be super helpful

@alekkania
Copy link
Author

@dostrander It seems that default timeout is not enough. I've forked KIF repo and change waitForView timeout to 200 seconds. It solved the issue with single tests but run in group still fails - stuck on waiting for view and fail in the end.

@dostrander
Copy link
Contributor

@alekkania Would you be able to create a test to try to repro this in the KIF project and send over the branch? I am having trouble reproing it on my machine using beta 5

@argneshu
Copy link

Hi any update around this bug, are we fixing it? we are facing the same issue with Xcode 13

@dostrander
Copy link
Contributor

@argneshu I haven't been able to repro on my end, is there a small project and/or peice of code you could put together that repros semi consistently. If it makes it easier adding a test to the KIF test suite might be easiest

@alekkania
Copy link
Author

@dostrander Sorry I can't share the project.
I've tested in on new project with collection view and it seems to work but I have very simple cells and views there :/

@dostrander
Copy link
Contributor

@alekkania is it always tableviews or collection views? Does it sometimes happen on other views as well or is it pretty particular to those?

@argneshu
Copy link

argneshu commented Oct 20, 2021

@dostrander
Sorry I cannot provide the exact code but below type of method we are using of KIFTestActor in our scripts

tester().text(from: tester().waitForView(withAccessibilityLabel: "locatorString"))
tester().text(from: tester().waitForView(withAccessibilityLabel: "locatorString", traits: UIAccessibilityTraits.staticText))
tester().text(from: tester().waitForView(withAccessibilityLabel: "locatorString")) as? UILabel

We were using tester().text(from: tester().waitForView(withAccessibilityLabel: "locatorString")) to fetch the text from accessibility element having traits as static text and we were able to fetch the text

But after upgrading to Xcode 13 its returning null value, we tried other workaround but no success till now

Label which I was trying to access is inside a CollectionItem, which is inside a UITableView

Hierarchy is like
UITableView > UITableViewCell > UITableViewCellContentView > UILabel(Trait -> Static Text)

@alekkania
Copy link
Author

@dostrander Yes it seems to be on table/collectionview always. I think that this is similar issue to @argneshu and #1240 this one.

@dostrander
Copy link
Contributor

@alekkania @argneshu could you check against #1241 and see if that fixes your issue?

@argneshu
Copy link

@alekkania : yes it worked for us, thank you 👍

@alekkania
Copy link
Author

@dostrander It works for us as well. Thank you!

@dostrander
Copy link
Contributor

Fixed in #1241

@dostrander
Copy link
Contributor

This has been released with 3.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants