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

There is no support in the selector engine for UICollectionView #178

Closed
TimothyChilvers opened this issue Mar 21, 2013 · 5 comments
Closed

Comments

@TimothyChilvers
Copy link

Selectors such as "view:'UICollectionViewCell' first" don't work as expected - It selects an arbitrary cell rather than the first one.

@moredip
Copy link
Owner

moredip commented Mar 21, 2013

This is a pretty hard one to fix I'm afraid. The ordering is based on the order of the subviews in the live view hierarchy, and that ordering appears to be quite arbitrary (presumably there are performance reasons for this).

It's conceivable that we could re-arrange the reported order based on the view's location in the UI, but I don't see one general heuristic that could be used to decide that ordering.

@ondrejhanslik
Copy link
Contributor

The same thing can happen with UITableView when cells are dynamically added/removed. It can also happen with plain UIScrollView - I saw it changing the order of its subviews in some cases (optimization?).

The best solution would be to add "sort" predicates to the query language. Sorting by position seems to be the best sorting option here (UIAutomation does it too).

Actually I am doing it in my frank tests - get all the cells (using "index"), sort them by accessibilityRect and then return the cell at the given position.

A much bigger problem is to get the text in table section headers. It requires some magic to check if the returned labels are not inside a cell.

@shoucal
Copy link

shoucal commented Apr 15, 2013

I am having the same problem too.
is anyone could tell me how to execrate the function which already write in my app?

such as I write a function - (void) clickTableViews
how I could call it by frank?

thanks a lot.
-chao

chao xu
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On 2013年4月9日Tuesday at 下午11:03, ondrejhanslik wrote:

The same thing can happen with UITableView when cells are dynamically added/removed. It can also happen with plain UIScrollView - I saw it changing the order of its subviews in some cases (optimization?).
The best solution would be to add "sort" predicates to the query language. Sorting by position seems to be the best sorting option here (UIAutomation does it too).
Actually I am doing it in my frank tests - get all the cells (using "index"), sort them by accessibilityRect and then return the cell at the given position.
A much bigger problem is to get the text in table section headers. It requires some magic to check if the returned labels are not inside a cell.


Reply to this email directly or view it on GitHub (#178 (comment)).

@ondrejhanslik
Copy link
Contributor

You can use frankly_map for this. See core_frank_steps.rb for examples or just go for the documentation. It's very straightforward, e.g. frankly_map(selector, "clickTableViews").

@moredip
Copy link
Owner

moredip commented Apr 22, 2013

I'm going to close this issue out. I don't see a way to order the views that will always yield the 'correct' order.

@moredip moredip closed this as completed Apr 22, 2013
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

4 participants