americanexpress / busybee Goto Github PK
View Code? Open in Web Editor NEWBusyBee is an alternative API for IdlingResources in Espresso tests
License: Apache License 2.0
BusyBee is an alternative API for IdlingResources in Espresso tests
License: Apache License 2.0
Right now there is a fixed list of categories (GENERAL
, NETWORK
, etc), should allow applications to have default categories.
Currently Busybee in /test
in Android modules fails with:
Caused by: java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details.
at android.os.Looper.getMainLooper(Looper.java)
at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<init>(AndroidMainThreadExecutor.java:27)
at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<clinit>(AndroidMainThreadExecutor.java:25)
stop using jCenter as it's going away
If you are making a library (e.g. busybee-rxjava
) that provides an integration of BusyBee with another lib (e.g. RxJava) you will probably want to be able to get a TestBusyBee
instance where you can control the Executor.
The operation
is only needed when tests are running, so we might consider changing the API to allow the operation
to be lazily created.
Quoting the current README:
Why is this written in Java and not Kotlin?
We wanted to get an initial release out that didn't depend on the Kotlin standard library, but we plan on converting the implementation to 100% Kotlin.
There might be testing use cases for awaitNotBusy
/awaitBusy
blocking methods for testing your busybee intergration.
We want to avoid calling thing.slowToString()
in release builds.
busyBee.busyWith(thing.slowToString());
try {
thing.process();
} finally {
// Espresso will continue
busyBee.completed(thing.slowToString());
}
maybe something like:
// { thing.slowToString() } is only executed when busyBee
val thingOperationId: OperationId = busyBee.createOperationId { counter -> thing.slowToString(counter) }
busyBee.busyWith(thingOperationId);
try {
thing.process();
} finally {
// Espresso will continue
busyBee.completed(thingOperationId);
}
sealed class OperationId {
object NoOp: OperationId()
class StringOperationId(val operationId: String): OperationId()
}
the noop impl of busybee returns NoOp
in release builds.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.