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

printViewHierarchy prints over 12000 lines of the same text #1146

Closed
paulz opened this issue Apr 11, 2020 · 2 comments
Closed

printViewHierarchy prints over 12000 lines of the same text #1146

paulz opened this issue Apr 11, 2020 · 2 comments

Comments

@paulz
Copy link
Contributor

paulz commented Apr 11, 2020

When using KIF_PRINTVIEWTREEONFAILURE
and the test fails on a view with UIDatePicker I am getting failure log with over 12000 lines containing:

UITableViewCellAccessibilityElement, label: (null), traits: none

and output looks like:

UIWindow
|	UITransitionView
|	|	UIDropShadowView
|	|	|	UILayoutContainerView
|	|	|	|	UINavigationTransitionView
|	|	|	|	|	UIViewControllerWrapperView
|	|	|	|	|	|	UITableView, identifier: reminders table
|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	UITableViewCell (invisible)
|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	UIDatePicker (enabled) (not selected) (not highlighted)
|	|	|	|	|	|	|	|	|	|	_UIDatePickerView
|	|	|	|	|	|	|	|	|	|	UIAccessibilityPickerComponent, label: (null), value: 11 o’clock, traits: adjustable
|	|	|	|	|	|	|	|	|	|	UIAccessibilityPickerComponent, label: (null), value: 25 minutes, traits: adjustable
|	|	|	|	|	|	|	|	|	|	UIAccessibilityPickerComponent, label: (null), value: AM, traits: adjustable
|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	UIPickerColumnView
|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none

+ over 12000 times

|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: 00 minutes, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: 00 minutes
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: 00
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: 05 minutes, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: 05 minutes
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: 05
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: 10 minutes, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: 10 minutes
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: 10
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	_UIScrollViewScrollIndicator, label: Horizontal scroll bar, 1 page
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	UIPickerColumnView
|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: PM, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: AM, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: AM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: AM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	_UIScrollViewScrollIndicator, label: Horizontal scroll bar, 1 page
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: PM, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	_UIScrollViewScrollIndicator, label: Horizontal scroll bar, 1 page
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellAccessibilityElement, label: (null), traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: PM, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: PM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIPickerTableViewWrapperCell
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIAccessibilityElementMockView, label: AM, traits: none
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UITableViewCellContentView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIDatePickerContentView, label: AM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UILabel, label: AM
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	_UIScrollViewScrollIndicator, label: Horizontal scroll bar, 1 page
|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	|	|	|	UIView
|	|	|	|	|	|	|	|	_UITableViewCellSeparatorView
|	|	|	|	|	|	|	|	_UITableViewCellSeparatorView
@justinseanmartin
Copy link
Contributor

It seems reasonable to special case the output when walking into a UIDatePicker in the -[UIView(Debugging) printViewHierarchyWithIndentation:] method. It already has some special casing for UIImageView and UIControl. I think we'd probably want to replace the 12k lines with a single line with the properties of the UIDatePicker that control (at least date, min, max, mode?, minuteInterval?).

Is this something you'd be willing to contribute? I'd be happy to review and merge the change if so.

dostrander added a commit to dostrander/KIF that referenced this issue Jul 7, 2020
dostrander added a commit to dostrander/KIF that referenced this issue Jul 10, 2020
dostrander added a commit that referenced this issue Jul 14, 2020
…ker-description

Fixes issue #1146 where date pickers print over 12k lines of text
@dostrander
Copy link
Contributor

Fixed in PR #1157

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

No branches or pull requests

3 participants