From ec611e633323fc3b9db233d786c6ba640139d71e Mon Sep 17 00:00:00 2001 From: Paul Feher Date: Fri, 10 May 2013 10:56:53 +0300 Subject: [PATCH] Bug 878587 - Fixes for testMasterPassword to diminish intermittent-failures caused by slow devices. r=jmaher --- .../android/base/tests/testMasterPassword.java.in | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mobile/android/base/tests/testMasterPassword.java.in b/mobile/android/base/tests/testMasterPassword.java.in index 41bfc1739c6..1f0685b420f 100644 --- a/mobile/android/base/tests/testMasterPassword.java.in +++ b/mobile/android/base/tests/testMasterPassword.java.in @@ -76,9 +76,10 @@ public class testMasterPassword extends PixelTest { mSolo.clickOnButton("OK"); // Verify that the Master Password was set - waitForText("^Use master password$"); + mSolo.searchText("Privacy & Security"); + mAsserter.ok(mSolo.waitForText("^Use master password$"), "Checking if Use master password is present", "Use master password is present"); mSolo.clickOnText("^Use master password$"); - mAsserter.ok(mSolo.searchText("Remove Master Password"), "Checking if the password is enabled", "The password is enabled"); + mAsserter.ok(mSolo.waitForText("Remove Master Password"), "Checking if the password is enabled", "The password is enabled"); clickOnButton("Cancel"); // Go back to settings menu waitForText("^Settings$"); mActions.sendSpecialKey(Actions.SpecialKey.BACK);// Close the Settings Menu @@ -114,7 +115,8 @@ public class testMasterPassword extends PixelTest { mSolo.clickOnButton("OK"); // Verify that the Master Password was disabled - waitForText("^Use master password$"); + mSolo.searchText("Privacy & Security"); + mAsserter.ok(mSolo.waitForText("^Use master password$"), "Checking if Use master password is present", "Use master password is present"); mSolo.clickOnText("^Use master password$"); mAsserter.ok(waitForText("^Create Master Password$"), "Checking if the password is disabled", "The password is disabled"); clickOnButton("Cancel"); // Go back to settings menu @@ -191,6 +193,7 @@ public class testMasterPassword extends PixelTest { doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed 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); // Verify that the Master Password isn't deactivated when the password field is empty @@ -213,9 +216,11 @@ public class testMasterPassword extends PixelTest { else { clearPrivateData(); doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed - mSolo.clickOnButton(item); + 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"); doorhangerDisplayed(LOGIN_URL);// Check that the doorhanger is displayed again - mSolo.clickOnButton(item); + 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"); waitForText("Browser Blank Page 01"); } }