LibGdx and Espresso

Anything about development not directly related to libgdx, e.g. OpenGL, Android APIs etc.

LibGdx and Espresso

Postby damtoul » Thu Nov 30, 2017 9:09 pm

Hello,

If anyone wonders if it's possible to run validation(intrumentation) tests with Google espresso on a libgdx mobile app, the answer is yes. :)

Just have to continue dev and writes according tests....

Edit : Maybe the answer is not yes, I must investigate. The execution of an instrumented test works, but app does not execute on my mobile device. See this log :

Testing started at 05:43 ...

12/01 05:43:35: Launching Rx
$ adb push D:\Git\LapisLazuli\android\build\outputs\apk\android-debug.apk /data/local/tmp/com.lapislazuli
$ adb shell pm install -t -r "/data/local/tmp/com.lapislazuli"
pkg: /data/local/tmp/com.lapislazuli
Success


$ adb push D:\Git\LapisLazuli\android\build\outputs\apk\android-debug-androidTest.apk /data/local/tmp/com.lapislazuli.test
$ adb shell pm install -t -r "/data/local/tmp/com.lapislazuli.test"
pkg: /data/local/tmp/com.lapislazuli.test
Success


Running tests

$ adb shell am instrument -w -r -e debug false -e class com.lapislazuli.instrumentationtests.Rx com.lapislazuli.test/android.support.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running tests

java.lang.RuntimeException: No activities found. Did you forget to launch the activity by calling getActivity() or startActivitySync or similar?
at android.support.test.espresso.base.RootViewPicker.waitForAtLeastOneActivityToBeResumed(RootViewPicker.java:169)
at android.support.test.espresso.base.RootViewPicker.get(RootViewPicker.java:83)
at android.support.test.espresso.ViewInteractionModule.provideRootView(ViewInteractionModule.java:76)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:25)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:10)
at android.support.test.espresso.base.ViewFinderImpl.getView(ViewFinderImpl.java:64)
at android.support.test.espresso.ViewInteraction$2.call(ViewInteraction.java:266)
at android.support.test.espresso.ViewInteraction$2.call(ViewInteraction.java:258)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5260)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:678)

Tests ran to completion.
damtoul
 
Posts: 2
Joined: Sun Oct 29, 2017 12:30 pm

Return to General Development

Who is online

Users browsing this forum: No registered users and 2 guests