FEX_forcedTouch and app "isIgnoringInteractionEvents"

172 views
Skip to first unread message

Martin Taylor

unread,
May 23, 2013, 4:04:48 PM5/23/13
to frank-...@googlegroups.com

First let me say thanks again to Ondrej whose FEX_forcedTouch is working well for me in most circumstances!

The first check in the new FEX_forcedTouch method is:

    if ([[UIApplication sharedApplication] isIgnoringInteractionEvents]) {
       return NO;
    }

The problem I'm having is that sometimes displaying a "fancy dialog or symbolic menu" causes my app to go into the isIgnoringInteractionEvents state for a period of time.  When this happens, and my client-side test case is too fast, I get a failure from the above check in the new FEX_forcedTouch.  I don't like to hard-code waits, so I wrote a new method that I can call with Frank's app_exec feature.  My new method, getAppIsIgnoringInteractionEvents, returns a True or False string depending on the same "if" in the logic above.  I have a generic "WaitForState" method in my Python client that can wait for some state change, so I use this to wait for getAppIsIgnoringInteractionEvents to return False.  It turned out that a delay of about .3 sec was required (on an iPad 2) for my app to return to the state where isIgnoringInteractionEvents is False!

Now for my question: Do you think this should be a built-in part of Frank (i.e. the ability to query the isIgnoringInteractionEvents state)?  If so, what kind of API do you think it should be?

If we get some agreement on this I'd be happy to convert my implementation into an "inside Frank" implementation and submit a Pull Request (as always... employer approval permitting). Someone else would then have to write the Cucumber bits, 'cause I don't do Ruby.

Thanks,

Martin

Peter Hodgson

unread,
May 23, 2013, 11:19:52 PM5/23/13
to frank-...@googlegroups.com
Great idea Martin. I think an api endpoint that exposes this would be useful enough that it's worth building into Frank itself. 


--
You received this message because you are subscribed to the Google Groups "Frank" group.
To unsubscribe from this group and stop receiving emails from it, send an email to frank-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
  


Martin Taylor

unread,
May 24, 2013, 8:57:14 AM5/24/13
to frank-...@googlegroups.com
On looking into other similar Frank interfaces, I think this new isIgnoringInteractionEvents capability should be modeled on the current one in AccessibilityCheckCommand.m.  So I propose to write an IgnoringInteractionCheckCommand.m module that supports a 'ignoring_interaction_check' command and returns a dictionary with a single element 'isIgnoringInteractionEvents' that has a string value 'true' or 'false'.  The basic code structure will be identical to that of AccessibilityCheckCommand.m with the boolean logic replaced by the
    if ([[UIApplication sharedApplicationisIgnoringInteractionEvents])
test.  Given that this is modeled on such a similar existing command, I think I can write the appropriate Ruby in frank_helper.rb, but I won't be able to test this or write the higher level Cucumber step.

Any better suggestions?

Thanks,
Martin

Pete Hodgson

unread,
May 24, 2013, 10:36:30 AM5/24/13
to frank-...@googlegroups.com, frank-...@googlegroups.com
That all sounds good Martin. If you want to write a basic ruby helper method then definitely go ahead, but don't feel obliged. Someone else can pick up the ruby integration piece I expect.

Cheers,
Pete
--
Typed on a little bitty keyboard

Ondrej Hanslik

unread,
May 27, 2013, 10:51:53 AM5/27/13
to frank-...@googlegroups.com
It's not a bad idea but I never had the need for this myself.

When the application is ignoring user activity, typically it is also showing some animation and I am waiting for that animation to end.

What I don't like is to have 1 command for every method. "AppCommand", "DeviceCommand" etc. could use some refactoring.
Reply all
Reply to author
Forward
0 new messages