Auto-tools/Projects/Robocop/WritingTests: Difference between revisions

Line 5: Line 5:
= Setup =
= Setup =


Writing a test for Robocop shouldn't be very hard, but there is a limited API as of yet. Copying a test from the examples is the best way to start. The flow of the test will go from starting the application to killing it.
Copying a test from the examples is the best way to start.  
 
Your test should be in the file test[Case].java.in -- see mobile/android/base/tests.
Your test should be in the file test[Case].java.in -- see mobile/android/base/tests.
It will have three methods in the class test[Case]: setUp(), test[Case](), and tearDown(). setUp gets called at the beginning and starts fennec.
 
The top of the test must have:
The flow of the test will go from starting the application to killing it.
 
The top of each test case file must have:
<pre>
<pre>
#filter substitution
#filter substitution
package @ANDROID_PACKAGE_NAME@.tests
package @ANDROID_PACKAGE_NAME@.tests
</pre>
</pre>
Each test case will have three methods in the class test[Case]: setUp(), test[Case](), and tearDown(). setUp gets called at the beginning and starts fennec.


= APIs  =
= APIs  =
Confirmed users
1,759

edits