espresso - Overslept and turned a tap into a long press

1,121 views
Skip to first unread message

tali...@gmail.com

unread,
Aug 23, 2016, 4:26:00 AM8/23/16
to Android Testing Support Library
Hi,

We use espresso in our automated tests.
We have a test suite which is very flaky since we keep getting the following error while trying to click:
"Overslept and turned a tap into a long press"
Our test suite tests an activity which has multiple fragments and sometimes click on each of the fragment becomes a long click.
For now I added a rollback action but I have to say that I don't like this solution.
any other suggestions how to do it right?

Thanks,
Tali

Nick Korostelev

unread,
Aug 23, 2016, 1:19:02 PM8/23/16
to Android Testing Support Library, tali...@gmail.com
See bug for the issue and potential workaround: https://code.google.com/p/android/issues/detail?id=199544

Denys Zelenchuk

unread,
Sep 10, 2016, 7:23:39 AM9/10/16
to Android Testing Support Library, tali...@gmail.com
Hi,

My workaround is to set Touch & Hold delay option in System settings -> Accessibility to Long value.
After I did this I haven't seen this issue anymore.

leslie...@gmail.com

unread,
Feb 23, 2017, 4:06:28 PM2/23/17
to Android Testing Support Library, tali...@gmail.com
Hey Denys,

Were you able to set this in an automated way in your Espresso test? We're trying to do something similar but can't find a command for this setting.

Thanks!
-L

denys.z...@centralway.com

unread,
Mar 22, 2017, 6:10:55 AM3/22/17
to Android Testing Support Library, tali...@gmail.com, leslie...@gmail.com
I'd love to know the same. So far doing this only manually on created emulators and later use them in test automation. 
If you'd find the solution please post here.

JabKnowsNothing

unread,
Mar 22, 2017, 12:47:17 PM3/22/17
to Android Testing Support Library, tali...@gmail.com
One possible solution although not really the espresso way,

https://gist.github.com/jabKnowsNothing/fe34673419500dcc6fc9

Leslie Chong

unread,
Mar 22, 2017, 12:51:07 PM3/22/17
to JabKnowsNothing, Android Testing Support Library, tali...@gmail.com
We actually did find a way. We run an adb script on the emulator before running the test which does this:

settings put secure long_press_timeout 1000

The default long_press_timeout is 500 ms. By increasing long press timeout to 1000, we got rid of most of our flakiness here.

--
You received this message because you are subscribed to a topic in the Google Groups "Android Testing Support Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-testing-support-library/VsqCCYMzhe4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-testing-suppo...@googlegroups.com.
To post to this group, send email to android-testing...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-testing-support-library/56dd9901-a22c-4052-81aa-77706960e743%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

denys.z...@centralway.com

unread,
Mar 30, 2017, 5:04:48 AM3/30/17
to Android Testing Support Library, jabknow...@gmail.com, tali...@gmail.com, leslie...@gmail.com
Great! Thanks for posting it.


On Wednesday, March 22, 2017 at 5:51:07 PM UTC+1, Leslie Chong wrote:
We actually did find a way. We run an adb script on the emulator before running the test which does this:

settings put secure long_press_timeout 1000

The default long_press_timeout is 500 ms. By increasing long press timeout to 1000, we got rid of most of our flakiness here.

On Wed, Mar 22, 2017 at 9:47 AM JabKnowsNothing <jabknow...@gmail.com> wrote:
One possible solution although not really the espresso way,

https://gist.github.com/jabKnowsNothing/fe34673419500dcc6fc9



On Tuesday, August 23, 2016 at 3:26:00 AM UTC-5, tali...@gmail.com wrote:
Hi,

We use espresso in our automated tests.
We have a test suite which is very flaky since we keep getting the following error while trying to click:
"Overslept and turned a tap into a long press"
Our test suite tests an activity which has multiple fragments and sometimes click on each of the fragment becomes a long click.
For now I added a rollback action but I have to say that I don't like this solution.
any other suggestions how to do it right?

Thanks,
Tali

--
You received this message because you are subscribed to a topic in the Google Groups "Android Testing Support Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-testing-support-library/VsqCCYMzhe4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-testing-support-library+unsubscribe@googlegroups.com.
To post to this group, send email to android-testing-support-lib...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages