Comments (5)
https://github.com/robolectric/robolectric-gradle-plugin is probably the preferred solution at this point, as it's being updated by the robolectric team.
from android-gradle-template.
it should be the best solution. it will never be a solution for me until we have a workaround following issues.
- with that plugin we have some issues when we combined robolectric and espresso which is tracked here robolectric/robolectric-gradle-plugin#17
- it is hard to get robolectric tests running inside android studio, documented at https://github.com/robolectric/deckard-gradle
from android-gradle-template.
My problem with robolectric-gradle-plugin is that it uses androidTest sourceset, preventing a clean separation between unit and functional tests (e.g. Espresso). This is a complete deal-breaker for me as functional tests can be very useful for testing parts of the app that would be overly complex using Robolectric.
My preferred way of using Robolectric is having unit-tests in a separate gradle module using the standard java plugin (allowing functional tests and unit tests to work).
from android-gradle-template.
Looks like we need no plugins anymore. With the new experimental unit test feature we can easy use robolectric. See the example https://github.com/nenick/AndroidStudioAndRobolectric or read a step by step guide http://nenick-android.blogspot.de/2015/02/android-studio-110-beta-4-and.html
from android-gradle-template.
It is possible to use robolectric without extra plugins but having the possibility to use separated test modules is still essential for me. Another advantage I have all sources anytime in Android Studio instead of switching between unit and android tests.
jcandksolution robolectric plugin is now deprecated and replaced by native unit test support.
So I switched this template back to his original root.
from android-gradle-template.
Related Issues (20)
- Project Structure Question HOT 1
- A problem occurred evaluating project ':ComponentTestsRobolectric' HOT 6
- When using this template, I've faced some problems HOT 3
- jacoco with espresso, task jacocoTestReport skipped HOT 6
- Error Illegal use of non virtual function call HOT 4
- Maybe switch to JCAndKSolutions/android-unit-test
- 'android' or 'android-library' plugin is required HOT 8
- Illegal use of nonvirtual function call HOT 2
- Collect code coverage during manual testing? HOT 2
- Update to latest version of Espresso and Mockito? HOT 3
- Can not compile success in the environment Android Studio1.0+ gradle2.2.1+build gradle1.0 HOT 3
- Unexpected top-level exception when running app HOT 2
- Could not find com.novoda:gradle-android-test-plugin:0.10.3. HOT 3
- run-tests.sh needs a simple fix HOT 1
- Android Studio 1.4 Java modules cannot depend on Android modules HOT 2
- FileNotFound Exception HOT 8
- Running / debugging Unit or Component tests in Android Studio HOT 3
- Unable to import project HOT 5
- oops
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-gradle-template.