bitrise-steplib / steps-virtual-device-testing-for-android

MIT License
22 stars 23 forks source link

Espresso test fails on Bitrise, but doesn't fail on local machine #56

Closed agap closed 4 years ago

agap commented 4 years ago

So, here's the thing.

I have a bunch of Espresso tests which run smoothly on a local machine/emulator, every time I run it on a Bitrise, one of them fails (let's call it test F, where F stands for "failing"). After some investigation, I figured it's always the same test.

It fails due to

androidx.test.espresso.NoActivityResumedException: No activities in stage RESUMED. Did you forget to launch the activity. (test.getActivity() or similar)?

Essentially it times out after 30-33 seconds of waiting. What's interesting, is that it started to fail once I added another test, which always runs before test "F". This second test makes use of espresso-intents package - essentially I do some clicks in it, and then verify that my app has send a proper Intent to OS. The test starts with Intents.init() and it ends with Intents.release(), so my assumption was that all the proper clean up should be done in due time. And it is - as I said, on my local machine it works smoothly, but on Bitrise something happens and I can't figure out what it is.

Please ping me if I need to provide some additional input.

agap commented 4 years ago

Woops, I just realized it was my own mistake after all. Sorry for the false alarm. :)

tokou commented 4 years ago

@agap What was your issue? How did you solve it?

sammysium commented 3 years ago

@agap what was your mistake please....