Mobile/Fennec/Android: Difference between revisions

Line 201: Line 201:
=== 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>. 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>'''.<br />
# Add a 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!
  This will get your test compiled into the Robocop APK.
# Optionally add HTML, JS, and CSS resources to <tt>mobile/android/tests/browser/robocop</tt>. Unfortunately, you'll need to run <tt>mach build</tt> to get them installed before running your test.
# Add a section like ''[testMyThing]'' to <tt>mobile/android/tests/browser/robocop/robocop.ini</tt>.
# Run <tt>mach build build/mobile/robocop</tt> to update the Robocop APK.
  Without this, the Robocop test harness will not know about your test!
# Run <tt>mach robocop testMyThing</tt> to run your new test on your device.
# 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 build/mobile/robocop</tt>''' to update the Robocop APK.
# Export your MOZ_HOST_BIN env var, ex: '''<tt>export MOZ_HOST_BIN=objdir-desktop/dist/bin</tt>'''
# Run '''<tt>./mach robocop testMyThing</tt>''' to run your new test on your device.
# Iterate!
# 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.


=== Copy a profile from your phone ===
=== Copy a profile from your phone ===
15

edits