Exemplo 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();
  }
Exemplo n.º 2
0
  public void testRun() throws InterruptedException {
    /*
     GIVEN THAT I AM ON THE MAIN RESTAURANT LIST
    */
    // Wait for activity: 'com.woww.woww.BaseDrawer'
    solo.waitForActivity(com.woww.woww.BaseDrawer.class, 2000);
    // Set default small timeout to 20009 milliseconds
    Timeout.setSmallTimeout(30009);
    // Scroll to ImageView
    android.widget.ListView listView0 =
        (android.widget.ListView) solo.getView(android.widget.ListView.class, 0);

    ArrayList<Restaurant> res;
    solo.scrollListToLine(listView0, 0);
    /*
     WHEN I OPEN THE MENU AND CLICK SORT BY PRICE
    */
    solo.clickOnView(solo.getView(android.widget.ImageView.class, 1));
    solo.clickInList(2, 0);
    Thread.sleep(2000);
    res = getListViewArray((RestaurantListAdapter) listView0.getAdapter());
    /*
    THEN THE LIST SHOULD BE SORTED BY PRICE IN ASCENDING ORDER
    */
    assertTrue(isOrderingValid(res, "price"));
    /*
     WHEN I OPEN THE MENU AND CLICK SORT BY RATING
    */
    solo.clickOnView(solo.getView(android.widget.ImageView.class, 1));
    solo.clickInList(3, 0);
    Thread.sleep(2000);
    res = getListViewArray((RestaurantListAdapter) listView0.getAdapter());
    /*
    THEN THE LIST SHOULD BE SORTED BY RATING IN DESCENDING ORDER
    */
    assertTrue(isOrderingValid(res, "rating"));
    /*
     WHEN I OPEN THE MENU AND CLICK SORT BY NAME
    */
    solo.clickOnView(solo.getView(android.widget.ImageView.class, 1));
    solo.clickInList(1, 0);
    Thread.sleep(5000);
    res = getListViewArray((RestaurantListAdapter) listView0.getAdapter());
    /*
     THEN THE LIST SHOULD BE SORTED BY NAME IN ALPHABETICAL ORDER
    */
    assertTrue(isOrderingValid(res, "name"));
  }
Exemplo n.º 3
0
  public void testRun() {
    // Wait for activity: 'course.labs.locationlab.PlaceViewActivity'
    solo.waitForActivity(course.labs.locationlab.PlaceViewActivity.class, 2000);

    // Set default small timeout to 55372 milliseconds
    Timeout.setSmallTimeout(55372);

    // Click on action bar item
    solo.clickOnActionBarItem(course.labs.locationlab.R.id.place_one);

    solo.sleep(2000);

    // Click on Get New Place
    solo.clickOnView(solo.getView(course.labs.locationlab.R.id.footer));

    solo.sleep(5000);

    // Click on action bar item
    solo.clickOnActionBarItem(course.labs.locationlab.R.id.print_badges);
  }