Not just UI, right @tamaspapik?
Itās better to use waitForView
in place of onView
when you need to wait. This eliminates the need for sleeping a magical amount of time.
Sounds awesome - @tamaspapik did you try this?
Not yet. Yep, sounds good. Will try it soon, hope it replaces the sleeps
As far as I could research, waitForView is not available in every test types. So for now thatās not an overall solution as well. Is there anything similar to waitForView in espresso instruments tests?
Normally IdlingResource is used for waiting for some condition.
For example in case of waiting for view to be added to the hierarchy GlobalLayoutListener can be added to the decor view and then view presence checked inside onGlobalLayout
callback.
Iām not sure youāre understanding the concept behind the code. waitForView is a utility method Iāve defined that implements the concept of a waiting matcher. This is different from a static sleep. Theyāre popular in the web testing realm as well. Another term for this is an explicit wait. In EarlGrey for example, theyāre called conditions.
Ah, got it.
Another workaround (different than arm emulator inside VM on bitrise.io and FTL) for people who have an access to machine which can be reachable from bitrise.io and capable of running x86 emulator is to use remote ADB server.
-H
parameter can be used to specify ADB host. E.g adb -H 1.2.3.4 devices
will list devices connected to server with IP 1.2.3.4.
Emulators can also be connected to Open STF (bitrise step is available). This will add some handy features like app uninstallation after testing or connection with local ADB server, so it will be visible just like local device.
Great ideas @koral!
Open STF seems like an awesome tool, Iāll have to try that some day Also, thanks for the Open STF steps!
We use Create Android Emulator step v1.1.5 and then with avd config: android-25/armeabi-v7a/google_apis and then using Start Android emulator step v1.3.1 still causes steps failing (timeouts). (100% times). We didnāt find any solution yet, so currently all of our builds are failing.
We had this problem once with Travis/jenkins android-wait-for-emulator
script and it turned out that those system images do not have at least one of the properties used for detecting booting completion, like: init.svc.bootanim
. This is why we had to switch to ādefaultā system image. Unfortunately, we canāt do the same in our current project, as we need google_apis sysimg.
Is this issue parked for any near future?
This issue is still open for resolution.
Just checked, and we use init.svc.bootanim
for checking boot status.
And also there are others, here you can check them: