A sample Android app which shows how to use and run Robolectric using Android Unit Testing Support
Don't forget enable Experimental Unit Testing support
You can use the parameter debugger
to run the tests in debug mode. Example:
- Add some breakpoints.
- First you need to enable debug mode
./gradlew -Pdebugger=true
- Wait until tests will be ready and gradle waits for debugger.
- Make sure you have remote debug configuration on 5005 port.
- Start debugging:
You should be able to debug your tests!
-
Avoid creating MyTestRunner to configure properties
Copyright 2015 NeWorld
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.