Bug 915449 - Avoid EditText error in testMasterPassword; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Mon, 16 Dec 2013 09:57:01 -0700
changeset 160679 bf56e107bb07c919298f50c5ed036f29e840d053
parent 160678 4b78a373acbdf0394490aaed7eeca13c1700d537
child 160680 1559f81806fb5089c14d8f690b29cc1da078e403
push id25844
push userryanvm@gmail.com
push dateMon, 16 Dec 2013 21:58:33 +0000
treeherdermozilla-central@8aa46cd4c63c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs915449
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 915449 - Avoid EditText error in testMasterPassword; r=jmaher
mobile/android/base/tests/testMasterPassword.java
--- a/mobile/android/base/tests/testMasterPassword.java
+++ b/mobile/android/base/tests/testMasterPassword.java
@@ -179,34 +179,43 @@ public class testMasterPassword extends 
         mAsserter.ok(mSolo.waitForText("Browser Blank Page 01"), "Waiting for blank browser page after exiting settings", "Blank browser page present");
     }
 
     public void verifyLoginPage(String password, String badPassword) {
         String LOGIN_URL = getAbsoluteUrl("/robocop/robocop_login.html");
         String option [] = {"Save", "Don't save"};
 
         doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed
+
+        // TODO: Remove this hack -- see bug 915449
+        mSolo.sleep(2000);
+
         for (String item:option) {
             if (item.equals("Save")) {
-                mAsserter.ok(mSolo.waitForText("Save"), "Checking if Save option is present", "Save option is present");
-                mSolo.clickOnButton(item);
+                final String OK_BUTTON_LABEL = "^OK$";
+                final String SAVE_BUTTON_LABEL = "^Save$";
+                mAsserter.ok(mSolo.waitForText(SAVE_BUTTON_LABEL), "Checking if Save option is present", "Save option is present");
+                mSolo.clickOnButton(SAVE_BUTTON_LABEL);
 
                 // Verify that the Master Password isn't deactivated when the password field is empty
                 closeTabletKeyboard();
-                mSolo.clickOnButton("OK");
+                waitForText(OK_BUTTON_LABEL);
+                mSolo.clickOnButton(OK_BUTTON_LABEL);
 
                 // Verify that the Master Password isn't deactivated when using the wrong password
                 closeTabletKeyboard();
                 editPasswordField(0, badPassword);
-                mSolo.clickOnButton("OK");
+                waitForText(OK_BUTTON_LABEL);
+                mSolo.clickOnButton(OK_BUTTON_LABEL);
 
                 // Verify that the Master Password is deactivated when using the right password
                 closeTabletKeyboard();
                 editPasswordField(0, password);
-                mSolo.clickOnButton("OK");
+                waitForText(OK_BUTTON_LABEL);
+                mSolo.clickOnButton(OK_BUTTON_LABEL);
 
                 // Verify that the Master Password is triggered once per session
                 noDoorhangerDisplayed(LOGIN_URL);// Check that the doorhanger isn't displayed
             } else {
                 clearPrivateData();
                 doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed
                 mAsserter.ok(mSolo.waitForText("Don't save"), "Checking if Don't save option is present again", "Don't save option is present again");
                 mSolo.clickOnText("Don't save");