Confirmed users
1,759
edits
(→Setup) |
(→Setup) |
||
Line 3: | Line 3: | ||
Robotium is a test framework created to make it easy to write powerful and robust automatic black-box test cases for Android applications. Robocop provides a wrapper around Robotium making it even easier to write and execute UI tests for native Fennec. | Robotium is a test framework created to make it easy to write powerful and robust automatic black-box test cases for Android applications. Robocop provides a wrapper around Robotium making it even easier to write and execute UI tests for native Fennec. | ||
= | = Creating a new test = | ||
The best way to create a new test is to copy and modify an existing test case -- see mobile/android/base/tests. | |||
Create a new file in the test directory named test[YourFeature].java.in. | |||
The top of each test file must have: | |||
The top of each test | |||
<pre> | <pre> | ||
#filter substitution | #filter substitution | ||
Line 23: | Line 21: | ||
Each test class must have three methods: | Each test class must have three methods: | ||
<pre> | |||
setUp() | protected void setUp() // Starts Fennec and sets up commonly used member variables. This is usually very similar for every test class. | ||
test[ | public void test[YourFeature]() // Your test code goes here. Use the Robocop API to access Fennec elements, click, send keys, and assert conditions. | ||
tearDown() | public void tearDown() // Clean up. This is usually very similar for every test class. | ||
</pre> | |||
= APIs = | = APIs = |