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

Line 7: Line 7:
Copying a test from the examples is the best way to start.  
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[Feature].java.in -- see mobile/android/base/tests.


The flow of the test will go from starting the application to killing it.
The flow of the test will go from starting the application to killing it.
Line 17: Line 17:
</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.
Then define a test class extending the Robotium ActivityInstrumentationTestCase2:
<pre>
public class testMyFeature extends ActivityInstrumentationTestCase2
</pre>
 
Each test class must have three methods:  
 
setUp() - Starts Fennec and sets up commonly used member variables. This is usually very similar for every test class.
test[Feature]() - Your test code goes here.
tearDown() - Clean up. This is usually very similar for every test class.


= APIs  =
= APIs  =
Confirmed users
1,759

edits