Skip to content

Instantly share code, notes, and snippets.

@stephenmac7
Created June 3, 2015 15:34
Show Gist options
  • Save stephenmac7/a40a0536f973393451f1 to your computer and use it in GitHub Desktop.
Save stephenmac7/a40a0536f973393451f1 to your computer and use it in GitHub Desktop.
Android bug reproduction code
package com.example.stephen.myapplication;
import android.test.ActivityInstrumentationTestCase2;
import android.test.TouchUtils;
import android.widget.TextView;
/**
* Created by stephen on 15/06/03.
*/
public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActivity> {
private MainActivity activity;
private TextView hello;
public MainActivityTest() {
super(MainActivity.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
setActivityInitialTouchMode(true);
activity = getActivity();
hello = (TextView) activity.findViewById(R.id.hello_world);
}
public void testHelloClick() {
TouchUtils.clickView(this, hello);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment