Beispiel #1
0
 @SuppressWarnings({"unchecked", "non-varargs"})
 public void SqliteCompare(Cursor c, ContentValues[] cvs) {
   mAsserter.is(c.getCount(), cvs.length, "List is correct length");
   if (c.moveToFirst()) {
     do {
       boolean found = false;
       for (int i = 0; !found && i < cvs.length; i++) {
         if (CursorMatches(c, cvs[i])) {
           found = true;
         }
       }
       mAsserter.is(found, true, "Password was found");
     } while (c.moveToNext());
   }
 }
Beispiel #2
0
 public final void verifyPageTitle(String title) {
   final TextView urlBarTitle = (TextView) mSolo.getView(R.id.url_bar_title);
   String pageTitle = null;
   if (urlBarTitle != null) {
     // Wait for the title to make sure it has been displayed in case the view
     // does not update fast enough
     waitForCondition(new VerifyTextViewText(urlBarTitle, title), MAX_WAIT_MS);
     pageTitle = urlBarTitle.getText().toString();
   }
   mAsserter.is(pageTitle, title, "Page title is correct");
 }
Beispiel #3
0
 public final void verifyUrl(String url) {
   final EditText urlEditText = (EditText) mSolo.getView(R.id.url_edit_text);
   String urlBarText = null;
   if (urlEditText != null) {
     // wait for a short time for the expected text, in case there is a delay
     // in updating the view
     waitForCondition(new VerifyTextViewText(urlEditText, url), VERIFY_URL_TIMEOUT);
     urlBarText = urlEditText.getText().toString();
   }
   mAsserter.is(urlBarText, url, "Browser toolbar URL stayed the same");
 }
Beispiel #4
0
  protected final void enterUrl(String url) {
    final EditText urlEditView = (EditText) mSolo.getView(R.id.url_edit_text);

    focusUrlBar();

    // Send the keys for the URL we want to enter
    mSolo.clearEditText(urlEditView);
    mSolo.enterText(urlEditView, url);

    // Get the URL text from the URL bar EditText view
    final String urlBarText = urlEditView.getText().toString();
    mAsserter.is(url, urlBarText, "URL typed properly");
  }
Beispiel #5
0
 public final void verifyTabCount(int expectedTabCount) {
   Element tabCount = mDriver.findElement(getActivity(), R.id.tabs_counter);
   String tabCountText = tabCount.getText();
   int tabCountInt = Integer.parseInt(tabCountText);
   mAsserter.is(tabCountInt, expectedTabCount, "The correct number of tabs are opened");
 }