airbnb / okreplay

📼 Record and replay OkHttp network interaction in your tests.
Apache License 2.0
781 stars 71 forks source link

Work together with RoboElectric #78

Open slott opened 6 years ago

slott commented 6 years ago

Hi there,

Seems its not possible to get this to play nicely with RoboElectric - or am I missing something ?

It would be quite EPIC if RoboElectric and okreplay could work together - making even faster and better tests.

slott commented 6 years ago

Trying now to get a basic example working with Espresso... And here you state the following

  .tapeRoot(new AndroidTapeRoot(getContext(), getClass()))

And where exactly is the context suppose to come from ?

It would be very helpful if you could look through your howto and make it work.

slott commented 6 years ago

Right - so finally figured out where the context was coming from

InstrumentationRegistry.getContext

so now everything should work - but it doesn't.

The OkReplayInterceptor isn't running. I can see that I need to call .start - but why isn't there a full example of all this ? Also the basic test that I have does nothing and the whole thing times out after 45 sec. with this error "... within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time?"