TestUtils

open class TestUtils(source)

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
interface Predicate<T>
Substitute for Java 8 predicate until everyone moves to Java 8.

Functions

Link copied to clipboard
open fun assertAllPixelsOfColor(failMessagePrefix: String, @NonNull bitmap: @NonNull Bitmap, bitmapWidth: Int, bitmapHeight: Int, @ColorInt color: Int, allowedComponentVariance: Int, throwExceptionIfFails: Boolean)
Checks whether all the pixels in the specified bitmap are of the same specified color.
open fun assertAllPixelsOfColor(failMessagePrefix: String, @NonNull drawable: @NonNull Drawable, drawableWidth: Int, drawableHeight: Int, callSetBounds: Boolean, @ColorInt color: Int, allowedComponentVariance: Int, throwExceptionIfFails: Boolean)
Checks whether all the pixels in the specified drawable are of the same specified color.
Link copied to clipboard
open fun assertCenterPixelOfColor(failMessagePrefix: String, @NonNull bitmap: @NonNull Bitmap, @ColorInt color: Int, allowedComponentVariance: Int, throwExceptionIfFails: Boolean)
Checks whether the center pixel in the specified bitmap is of the same specified color.
open fun assertCenterPixelOfColor(failMessagePrefix: String, @NonNull drawable: @NonNull Drawable, drawableWidth: Int, drawableHeight: Int, callSetBounds: Boolean, @ColorInt color: Int, allowedComponentVariance: Int, throwExceptionIfFails: Boolean)
Checks whether the center pixel in the specified drawable is of the same specified color.
Link copied to clipboard
open fun assertContentEquals(@Nullable expected: @Nullable CharSequence, @Nullable actual: @Nullable CharSequence)
Asserts that the contents of two character sequences are equal, but does not consider their types.
Link copied to clipboard
open fun emulateTapOnView(instrumentation: Instrumentation, activityTestRule: ActivityTestRule<?>, anchorView: View, offsetX: Int, offsetY: Int)
Emulates a tap on a point relative to the top-left corner of the passed View.
Link copied to clipboard
@RequiresApi(value = 21)
open fun executeShellCommandAndFind(@NonNull cmd: @NonNull String, @NonNull find: @NonNull TestUtils.Predicate<String>): Boolean
Executes the given shell command and returns true if any line matches the find predicate, or false otherwise.
Link copied to clipboard
This method takes a view and returns a single bitmap that is the layered combination of background drawables of this view and all its ancestors.
Link copied to clipboard
open fun getThemeAttrColor(context: Context, attr: Int): Int
Link copied to clipboard
open fun runOnMainAndDrawSync(@NonNull activityTestRule: ActivityTestRule, @NonNull view: @NonNull View, @Nullable runner: @Nullable Runnable)
Runs the specified Runnable on the main thread and ensures that the specified View's tree is drawn before returning.
Link copied to clipboard
open fun waitForActivityDestroyed(activity: BaseTestActivity)