tutorial - Complete LoginTest no se ejecuta en Android con espresso
unit test android (0)
Estoy usando automatización de espresso y ui para casos de prueba y generación de informes ejecutando gradlew.bat: app: createDebugCoverageReport en el símbolo del sistema.
Mi problema:-
Tengo una actividad de LoginTest que contiene 4 o 5 métodos. Los métodos se nombran en orden de clasificación usando @FixMethodOrder (MethodSorters.NAME_ASCENDING) . Cuando ejecuto el comando gradlew.bat: app: createDebugCoverageReport en el símbolo del sistema, solo se ejecuta un método, después de finalizar, detenga la aplicación. Por ejemplo: - Ejecuta aa_doLogin () solamente. No ejecuta cc_secondmethod y bb_firstmethod.
Mi código:-
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class LoginTest{
@Before
setup(){
}
@Test
aa_doLogin(){
bb_firstmethod()
}
@Test
bb_firstmethod(){
cc_secondmethod
}
@Test
cc_secondmethod(){
}
}
Error: -
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:189)
at android.support.test.espresso.base.RootViewPicker.findRoot(RootViewPicker.java:134)
at android.support.test.espresso.base.RootViewPicker.get(RootViewPicker.java:80)
at android.support.test.espresso.ViewInteractionModule.provideRootView(ViewInteractionModule.java:69)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:23)
at android.support.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:9)
at android.support.test.espresso.base.ViewFinderImpl.getView(ViewFinderImpl.java:68)
at android.support.test.espresso.ViewInteraction$1.run(ViewInteraction.java:120)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)