tm1701
tm1701

Reputation: 7601

Android - Espresso - longClick is (still) available?

My first impression is that Espresso helps tremenduously in automatic testing of Android Apps. Great! Thank you Google (employees).

What about the longClick() - is it still available as an ViewAction?

button1 = onView( withId( R.id.buttonOK)); 
button1.perform( click());

Works fine, but I cannot use the longClick or doubleClick in the perform. It seems not available. Why? All other ViewActions can be used.

Upvotes: 0

Views: 2459

Answers (1)

tm1701
tm1701

Reputation: 7601

Thanks to Yashodhan:

Just use this special kind of import:

import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.longClick;

Yes, and it works! And the tests all went well.

Upvotes: 4

Related Questions