Mobile/Fennec/Android: Difference between revisions

Jump to navigation Jump to search
Line 206: Line 206:
=== Add a new Robocop test ===
=== Add a new Robocop test ===


# Add a Java test file named like '''<tt>mobile/android/tests/browser/robocop/testMyThing.java</tt>'''.<br /> This will get your test compiled into the Robocop APK.
# Add a Java test file named like <tt>mobile/android/tests/browser/robocop/testMyThing.java</tt>. This will get your test compiled into the Robocop APK.
# Add your test file/name section like '''[testMyThing]''' to '''<tt>mobile/android/tests/browser/robocop/robocop.ini</tt>'''.<br /> Without this, the Robocop test harness will not know about your test!
# Add your test file/name section like ''[testMyThing]'' to <tt>mobile/android/tests/browser/robocop/robocop.ini</tt>. Without this, the Robocop test harness will not know about your test!
# Optionally add HTML, JS, and CSS resources to folder '''<tt>mobile/android/tests/browser/robocop</tt>'''.
# Optionally add HTML, JS, and CSS resources to folder <tt>mobile/android/tests/browser/robocop</tt>.
# Run '''<tt>./mach build</tt>''' to get them built/installed before running your test.
# Run <tt>mach build</tt> to get them built/installed before running your test.
# Run '''<tt>./mach build build/mobile/robocop</tt>''' to update the Robocop APK.<br /><br />
# Run <tt>mach build build/mobile/robocop</tt> to update the Robocop APK.
# Export your MOZ_HOST_BIN '''<tt>export MOZ_HOST_BIN=objdir-desktop/dist/bin</tt>'''<br /> See [[Mobile/Fennec/Android#Host_Builds_.28MOZ_HOST_BIN.29|Host Builds (MOZ_HOST_BIN)]]
# Make sure you have set host binaries downloaded and configured, following [[Mobile/Fennec/Android#Host_Builds_.28MOZ_HOST_BIN.29|Host Builds (MOZ_HOST_BIN)]].
# Run '''<tt>./mach robocop testMyThing</tt>''' to run your new test on your device.<br />
# Run <tt>mach robocop testMyThing</tt> to run your new test on your device.
# Iterate!<br /><br />
# Iterate!


Here's an [https://hg.mozilla.org/mozilla-central/rev/101feffdaed8 example patch] that adds a fairly complicated new '''testSelectionCarets''' test.
Here's an [https://hg.mozilla.org/mozilla-central/rev/101feffdaed8 example patch] that adds a fairly complicated new ''testSelectionCarets'' test.


See also some tips on writing [[Mobile/Fennec/Android/UITest|UITest]]s.
See also some tips on writing [[Mobile/Fennec/Android/UITest|UITest]]s.
Confirmed users
355

edits

Navigation menu