Bug 770483 - Robocop: add more checks to testAboutPage; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Tue, 18 Sep 2012 10:36:40 -0600
changeset 110982 09c5ad99ae92299f99c8809a53e66f86181969f5
parent 110981 156bdf05dd97b402adc64bc8afdd29670a71fe0e
child 110983 cd720de0b57eddd8c833e8c4943cfbbebffcbfb5
push idunknown
push userunknown
push dateunknown
reviewersjmaher
bugs770483
milestone18.0a1
Bug 770483 - Robocop: add more checks to testAboutPage; r=jmaher
mobile/android/base/tests/testAboutPage.java.in
--- a/mobile/android/base/tests/testAboutPage.java.in
+++ b/mobile/android/base/tests/testAboutPage.java.in
@@ -1,53 +1,62 @@
 #filter substitution
 package @ANDROID_PACKAGE_NAME@.tests;
 
 import @ANDROID_PACKAGE_NAME@.*;
 import android.app.Activity;
 import android.util.Log;
 
+/* Tests related to the about: page:
+ *  - check that about: loads from the awesome bar
+ *  - check that about: loads from Settings/About...
+ */
 public class testAboutPage extends PixelTest {
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void testAboutPage() {
         mActions.expectGeckoEvent("Gecko:Ready").blockForEvent();
 
-        // Load the about: page
+        // Load the about: page and verify its title
         String url = "about:";
         loadAndPaint(url);
 
         Element awesomebar = mDriver.findElement(getActivity(), "awesome_bar_title");
         mAsserter.isnot(awesomebar, null, "Got the awesomebar");
         assertMatches(awesomebar.getText(), "About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)", "page title match");
 
         // Open a new page to remove the about: page from the current tab
         url = getAbsoluteUrl("/robocop/robocop_blank_01.html");
         loadUrl(url);
 
         // Use the menu to open the Settings
         mActions.sendSpecialKey(Actions.SpecialKey.MENU);
 
         // Look for the 'More' menu if this device/OS uses it
         if (mSolo.waitForText("^More$")) {
+            mAsserter.dumpLog("found More item in menu");
             mSolo.clickOnText("^More$");
         }
 
-        mSolo.waitForText("^Settings$");
+        if (mSolo.waitForText("^Settings$")) {
+            mAsserter.dumpLog("found Settings item in menu");
+        }
         mSolo.clickOnText("^Settings$");
 
         // Set up listeners to catch the page load we're about to do
         Actions.EventExpecter tabEventExpecter = mActions.expectGeckoEvent("Tab:Added");
         Actions.EventExpecter contentEventExpecter = mActions.expectGeckoEvent("DOMContentLoaded");
 
         // Tap on the "About Xxxx" setting
-        mSolo.waitForText("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
+        if (mSolo.waitForText("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)")) {
+            mAsserter.dumpLog("found About... title text");
+        }
         mSolo.clickOnText("About (Fennec|Nightly|Aurora|Firefox|Firefox Beta)");
 
         // Wait for the new tab and page to load
         tabEventExpecter.blockForEvent();
         contentEventExpecter.blockForEvent();
 
         // Grab the title to make sure the about: page was loaded
         awesomebar = mDriver.findElement(getActivity(), "awesome_bar_title");