Created
September 7, 2012 23:48
-
-
Save tophyr/3670808 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testLogin() { | |
if (!waitForActivity(LoginActivity.class, Timeouts.SHORT)) { | |
assertActivityShown(HomeActivity.class, Timeouts.NOW); | |
clickImageView(R.id.home_image_logout); | |
} | |
assertActivityShown(LoginActivity.class); | |
EditText email = getEditText(R.id.login_email); | |
EditText password = getEditText(R.id.login_password); | |
clearEditText(email); | |
enterText(email, EMAIL); | |
clearEditText(password); | |
enterText(password, PASSWORD); | |
clickButton(R.id.login_button); | |
// flaky | |
assertTextShown(LOGGING_IN); | |
assertActivityShown(HomeActivity.class, Timeouts.NETWORK); | |
} | |
public void testLogin() { | |
if (!m_Solo.waitForActivity("LoginActivity", 1000)) { | |
m_Solo.clickOnView(m_Solo.getView(R.id.home_image_logout)); | |
} | |
assertTrue("Did not show login activity", m_Solo.waitForActivity("LoginActivity")); | |
EditText email = (EditText)m_Solo.getView(R.id.login_email); | |
EditText password = (EditText)m_Solo.getView(R.id.login_password); | |
assertNotNull("email not found", email); | |
assertNotNull("password not found", password); | |
m_Solo.clearEditText(email); | |
m_Solo.enterText(email, EMAIL); | |
m_Solo.clearEditText(password); | |
m_Solo.enterText(password, PASSWORD); | |
m_Solo.clickOnView(m_Solo.getView(R.id.login_button)); | |
// flaky | |
assertTrue("No log in status", m_Solo.waitForText(LOGGING_IN)); | |
assertTrue("Did not go to home activity", m_Solo.waitForActivity(HOME_ACTIVITY)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment