Mobile/Fennec/Android/UITest: Difference between revisions

No edit summary
 
Line 63: Line 63:
At the start of your test method, you'll likely also want to call:
At the start of your test method, you'll likely also want to call:
  GeckoHelper.blockForReady();
  GeckoHelper.blockForReady();
===Just one test() function please!===
When you write that testSomething() function, you don't need to register it anywhere -- the test framework will find your function and run it automatically as long as it is public and named test<something>. Unfortunately, if you have more than one test function, the framework will try to run that too -- and that can cause problems! ({{bug|1113751}})
// DO NOT DO THIS
public class testSomething extends UITest {
    public void testAAA() {
        // Test code here...
    }
    public void testBBB() {
        // More test code here...
    }
}
// You can do this instead!
public class testSomething extends UITest {
    public void testAAA() {
        // Test code here...
        checkBBB()
    }
    private void checkBBB() {
        // More test code here...
    }
}


===Assertions===
===Assertions===
Confirmed users
1,759

edits