Mobile/Fennec/Android/Testing: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 83: Line 83:
(Note mcomella 5/5/16: they don't all pass for me locally)
(Note mcomella 5/5/16: they don't all pass for me locally)


These jobs run on [http://robolectric.org/ Robolectric], which mocks various Android libraries so you can write integration tests as unit tests. [http://mockito.org/ Mockito] is also supported for mocking (see [http://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/background/junit4/src/org/mozilla/gecko/dlc/TestVerifyAction.java TestVerifyAction for a sample]).
* Runs on [http://robolectric.org/ Robolectric], which mocks various Android libraries so you can write unit tests for Android libraries that would ordinarily have to be run on device
 
* Supports [http://mockito.org/ Mockito] for custom mocking (see [http://mxr.mozilla.org/mozilla-central/source/mobile/android/tests/background/junit4/src/org/mozilla/gecko/dlc/TestVerifyAction.java TestVerifyAction for a sample]).
You can also run specific tests from the IDE by selecting the "Build Variants" menu (bottom left), changing "Test Artifact" to "Unit Tests", right-clicking on the test class you want to run, and selecting the "Run <test-class>" option.
* Run specific tests from the IDE: select the "Build Variants" menu (bottom left), change "Test Artifact" to "Unit Tests", right-click on the test class you want to run, and select the "Run <test-class>" option.


=== integration tests ===
=== integration tests ===
Confirmed users
975

edits

Navigation menu