Skip to content

Instantly share code, notes, and snippets.

@izacus
Created May 1, 2015 21:24
Show Gist options
  • Save izacus/82b5bf7490a7cca09909 to your computer and use it in GitHub Desktop.
Save izacus/82b5bf7490a7cca09909 to your computer and use it in GitHub Desktop.
Test example
package com.example.test;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.PointF;
import android.net.Uri;
import android.os.ConditionVariable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
public class ActivityTest extends ActivityInstrumentationTestCase2<ExampleActivity> {
public ActivityTest() {
super(ExampleActivity.class);
}
@Override
protected void setUp() throws Exception {
super.setUp();
// Setup logic goes here
}
// Make sure the test methods start with name "test"
public void testDocumentOpen() {
ExampleActivity activity = getActivity(); // This will actually start the activity
getInstrumentation().waitForIdleSync(); // Wait for animations to complete and acitvity enter idle state
Assert.assertNotNull(null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment