See: Description
Class | Description |
---|---|
BaseDroidDriverTest<T extends android.app.Activity> |
Base class for tests using DroidDriver that reports uncaught exceptions, for * example OOME,
instead of crash.
|
D2ActivityInstrumentationTestCase2<T extends android.app.Activity> |
Fixes bugs in
ActivityInstrumentationTestCase2 . |
DroidDrivers |
Static utility methods using a singleton
DroidDriver instance. |
DroidDriversInitializer |
Calls
DroidDrivers.setSingleton(io.appium.droiddriver.DroidDriver) once and only once. |
PollingListeners |
Static utility methods to create commonly used PollingListeners.
|
ScrollerHelper |
Helper for Scroller.
|
SingleRun |
Base class for an action that should run only once no matter how many times the method
SingleRun.singleRun() is called upon an instance. |
The organization of the entities (pages, components) does not need to strictly follow the AUT structure. The UI model can be greatly simplified to make it easy to use.
In general the framework should follow these principles:
Context.getResources()
to get the
Resources instance, then call Resources.getResourceName(int)
to get
the string representation of a resource id, or call Resources.getString(int)
to get the localized string of a string resource.
This gives you compile-time check over incompatible changes.Context
, which is not available until setUp() is called. If those
are referenced in static fields of a test class, they will be initialized at class loading
time and result in a crash.ActivityInstrumentationTestCase2.getActivity()
calls
InstrumentationTestCase.launchActivityWithIntent(java.lang.String, java.lang.Class<T>, android.content.Intent)
, which may hang in
Instrumentation.waitForIdleSync()
. You can call
Context.startActivity(android.content.Intent)
directly.public void setUp() throws Exception { super.setUp(); if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) { Runtime.getRuntime().gc(); SystemClock.sleep(1000L); } }