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

Inject events via [[UIApplication sharedApplication] _enqueueHIDEvent:] #293

Open
steipete opened this issue Oct 1, 2016 · 5 comments
Open
Assignees
Labels

Comments

@steipete
Copy link

steipete commented Oct 1, 2016

Digging into EarlGrey again and all the technical crazy/beauty that's in there. This is such an awesome project.

So. Did some research around the use of IOHIDEvent since both KIF and EarlGrey need to use that, and found out that WebKit's TestRunner is doing that as well - but slightly differently than the approach on our testing tools here.

Check out this line specifically:
https://github.com/WebKit/webkit/blob/master/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm#L265

The whole code and handling is interesting and while I don't know what the difference yet, is, see this issue as a TODO to investigate more. Can't promise I'll find the time but maybe one of you wants to take a look if this might be useful.

@tirodkar
Copy link
Collaborator

tirodkar commented Oct 3, 2016

Thanks for bringing this to our attention Peter! For future EarlGrey versions, we'd want to have the tapping handled directly by XCUITests's tap. If I'm right, that would pretty much circumvent the need to use IOHIDEvent altogether.

@khandpur khandpur added the P3 label Oct 3, 2016
@khandpur
Copy link
Collaborator

Yup. One of the goals for the next version of EarlGrey is to reduce our dependency on private APIs with touch injection being the major contender.

@khandpur khandpur self-assigned this Dec 2, 2016
@khandpur
Copy link
Collaborator

khandpur commented Dec 2, 2016

Actually I am going to give this a shot this week :)

@steipete
Copy link
Author

steipete commented Dec 2, 2016

Will watch your progress! 👌

@khandpur
Copy link
Collaborator

Update:
https://github.com/WebKit/webkit/blob/master/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm#L265 doesn't work for all the supported platform versions. Also, it doesn't work on devices due to entitlement issues. And to top it off - there doesn't seem to be a reliable way to wait for the touch to be processes by the Application after it's been enqueued in the system. All of this makes it infeasible for EarlGrey. I have a "somewhat" cleaner solution that I am cleaning up right now and should post it on github by this week if I am able to get all the internal tests passing with it.

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