Esempio n. 1
0
  public void testRun() {
    /** Given: I am logged into a valid user profile starting from the main restaurant list */
    // Wait for activity: 'com.woww.woww.BaseDrawer'
    solo.waitForActivity(com.woww.woww.BaseDrawer.class, 2000);
    // Set default small timeout to 23836 milliseconds
    Timeout.setSmallTimeout(23836);
    // Click on ImageView
    solo.clickOnView(solo.getView(android.widget.ImageButton.class, 0));
    // Click on Log In
    solo.clickOnText(java.util.regex.Pattern.quote("Log In"));
    // Wait for activity: 'com.woww.woww.LoginActivity'
    assertTrue(
        "com.woww.woww.LoginActivity is not found!",
        solo.waitForActivity(com.woww.woww.LoginActivity.class));
    // Enter the text: 'changed'
    solo.clearEditText((android.widget.EditText) solo.getView(com.woww.woww.R.id.userName));
    solo.enterText((android.widget.EditText) solo.getView(com.woww.woww.R.id.userName), "changed");
    // Enter the text: 'c'
    solo.clearEditText((android.widget.EditText) solo.getView(com.woww.woww.R.id.password));
    solo.enterText((android.widget.EditText) solo.getView(com.woww.woww.R.id.password), "c");
    // Click on Login
    solo.clickOnView(solo.getView(com.woww.woww.R.id.loginButton));
    // Click on ImageView
    solo.clickOnView(solo.getView(android.widget.ImageButton.class, 0));

    /** When: I go to the profile page */
    // Click on Profile
    solo.clickOnText(java.util.regex.Pattern.quote("Profile"));
    ParseUser user = ParseUser.getCurrentUser();
    TextView profile = (TextView) solo.getView(R.id.profileName);

    /** Then: It is my profile page */
    assertEquals(
        "check that on same user profile as login name", user.getUsername(), profile.getText());

    /** When: When I go to my reviews from the profile page */
    // Long click Restaurant:   Rubio's Rating:   Review:   itwas
    solo.clickLongInList(1, 1);
    // Wait for activity: 'com.woww.woww.ViewUserReviewsActivity'

    /** Then: I am brought to my reviews */
    assertTrue(
        "com.woww.woww.ViewUserReviewsActivity is not found!",
        solo.waitForActivity(com.woww.woww.ViewUserReviewsActivity.class));
    // Press menu back key
    solo.goBack();
    // Press menu back key
    solo.goBack();
  }