Callum Stott
Callum Stott
Also experiencing this. We're most likely going to pull out an interface for showing toasts that can be replaced with a recording fake in tests for assertions, but it'd be...
One thing that would help here would be to just add an updated or alternative version of `IntentsTestRule` that manages the `init` and `release` calls. For instance: ```kotlin class RecordedIntentsRule...
It seems to be generally true that calling `finish()` doesn't move the state to `DESTROYED`. A minimal test that demonstrates this is: ```kotlin @Test fun finish_moves_to_destroyed_state() { val scenario =...
> Is it possible onActivity might be synchronizing before executing the lambda, but not after? Sounds plausible. I tried adding `shadowOf(getMainLooper()).idle();` after the `onActivity` call and that didn't help. Feels...
An update: I noticed that I was able to do `assertThat(scenario.state, equalTo(Lifecycle.State.DESTROYED))` successfully (after forgetting I'd run into problems with it earlier) for an Activity that called `finish` as part...
> It is the same as what you do, except that finish() is called from onStop() Yeah, that's what I meant by: > and the original example in the issue...
Any word on this?
> I think it's much better to have proper hooks and use DI to replace dispatchers instead of letting Espresso do magic that you might or might now fully understand....
Also encountering this. Have not managed to find a robust solution other than adding a `Thread.sleep`. Waiting on visibility, clickablility etc doesn't help and putting in "try again on failure"...
@brettchabot is this being looked at all? This seems to be forcing people to (I definitely have had to) add `Thread.sleep` to their tests to get something reliable.