简体   繁体   English

robolelectric设置问题-如何从roboelectric框架开始

[英]robolelectric setup issue — how to start with roboelectric framework

I am starting with Robolectric framework 3.0. 我从Robolectric框架3.0开始。 for android testing. 用于android测试。 I am goingthrough there site and they mention the first step as adding in build gradle 我正在浏览该站点,他们提到第一步是添加build gradle

testCompile "org.robolectric:robolectric:3.0" testCompile“ org.robolectric:robolectric:3.0”

I have done that and did a complete clean build. 我已经做到了,并且做了一个完整的干净构建。 Now once I start writing my first test case I get comilation issue-- cannot find symbol class RunWith for the annotation @ 现在,一旦我开始编写第一个测试用例,就会遇到编译问题-无法为注释@找到符号类RunWith

RunWith(RobolectricGradleTestRunner.class) RunWith(RobolectricGradleTestRunner.class)

Please tell me, what I am missing? 请告诉我,我想念的是什么? I thought mavencentral() will download the respective jar file. 我以为mavencentral()将下载相应的jar文件。

Thanks in advance. 提前致谢。

You can refer this this link. 您可以参考链接。

Make sure your test case locations are proper. 确保您的测试用例位置正确。

Android Studio defaults to looking for tests in the following locations: Unit Tests => src/test/java Android Studio默认在以下位置查找测试:单元测试=> src / test / java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM