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

Line 171: Line 171:
=== Logging ===
=== Logging ===
Robocop logs to both logcat and a file log via Assert.dumpLog (or FennecNativeDriver.log). Test code can use these, or log as a side-effect of Assert.is, Assert.ok, etc. Do not call android.util.Log.i/w/e/etc directly.
Robocop logs to both logcat and a file log via Assert.dumpLog (or FennecNativeDriver.log). Test code can use these, or log as a side-effect of Assert.is, Assert.ok, etc. Do not call android.util.Log.i/w/e/etc directly.
=== Indirect Database Operations ===
Robocop UI operations (eg click on a certain button) may initiate database operations (eg create a new record in a database table). When performing these actions manually, the effect appears to occur instantly, but of course the database operation takes some time, and often occurs on a background thread, independent of the UI. Robocop tests that indirectly initiate database operations and then immediately check for the effect of that operation (eg search for text in a table) may fail, or fail intermittently. It is generally better to loop, periodically checking for the effect to occur. See testBookmark for an example.


= More Information =
= More Information =
Confirmed users
1,759

edits