congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TextViewAssert.hasText
Code IndexAdd Tabnine to your IDE (free)

How to use
hasText
method
in
org.assertj.android.api.widget.TextViewAssert

Best Java code snippets using org.assertj.android.api.widget.TextViewAssert.hasText (Showing top 9 results out of 315)

origin: hidroh/materialistic

@Test
public void testNullResponse() {
  verify(itemManager).getItem(any(), eq(ItemManager.MODE_DEFAULT), listener.capture());
  listener.getValue().onResponse(null);
  assertThat((TextView) holder.itemView.findViewById(R.id.title))
      .hasText(R.string.loading_text);
}
origin: passy/Android-DirectoryChooser

@Test
public void testCreateDirectoryDialogAllowFolderNameModification() {
  final String directoryName = "mydir";
  final DirectoryChooserFragment fragment = DirectoryChooserFragment.newInstance(
      DirectoryChooserConfig.builder()
          .newDirectoryName(directoryName)
          .initialDirectory("")
          .allowReadOnlyDirectory(false)
          .allowNewDirectoryNameModification(true)
          .build());
  startFragment(fragment, DirectoryChooserActivityMock.class);
  fragment.onOptionsItemSelected(new TestMenuItem() {
    @Override
    public int getItemId() {
      return R.id.new_folder_item;
    }
  });
  final AlertDialog dialog = (AlertDialog) ShadowDialog.getLatestDialog();
  final ShadowAlertDialog shadowAlertDialog = Shadows.shadowOf(dialog);
  assertThat(shadowAlertDialog.getTitle()).isEqualTo("Create folder");
  assertThat(ShadowDialog.getShownDialogs()).contains(dialog);
  final TextView msgView = (TextView) dialog.findViewById(R.id.msgText);
  assertThat(msgView).hasText("Create new folder with name \"mydir\"?");
  final EditText editText = (EditText) dialog.findViewById(R.id.editText);
  assertThat(editText).isVisible();
  assertThat(editText).hasTextString(directoryName);
}
origin: hidroh/materialistic

@Test
public void testErrorResponse() {
  verify(itemManager).getItem(any(), eq(ItemManager.MODE_DEFAULT), listener.capture());
  listener.getValue().onError(null);
  assertThat((TextView) holder.itemView.findViewById(R.id.title))
      .hasText(R.string.loading_text);
}
origin: hidroh/materialistic

@Test
public void testHelp() {
  ((PreferencesActivity.SettingsFragment) activity.getSupportFragmentManager()
      .findFragmentByTag(PreferencesActivity.SettingsFragment.class.getName()))
      .getPreferenceScreen()
      .findPreference(activity.getString(R.string.pref_volume_help))
      .performClick();
  Dialog dialog = ShadowDialog.getLatestDialog();
  assertNotNull(dialog);
  assertThat((TextView) dialog.findViewById(R.id.alertTitle))
      .hasText(R.string.pref_volume_title);
}
origin: hidroh/materialistic

@Test
public void testLazyLoadHelp() {
  ((PreferencesActivity.SettingsFragment) activity.getSupportFragmentManager()
      .findFragmentByTag(PreferencesActivity.SettingsFragment.class.getName()))
      .getPreferenceScreen()
      .findPreference(activity.getString(R.string.pref_lazy_load_help))
      .performClick();
  Dialog dialog = ShadowDialog.getLatestDialog();
  assertNotNull(dialog);
  assertThat((TextView) dialog.findViewById(R.id.alertTitle))
      .hasText(R.string.pref_lazy_load_title);
}
origin: hidroh/materialistic

    shadowOf(((TextView) activity.findViewById(R.id.posted))
        .getCompoundDrawables()[0]).getCreatedFromResId());
assertThat((TextView) activity.findViewById(R.id.source)).hasText("http://example.com");
reset(hackerNewsClient);
shadowOf(activity).recreate();
origin: hidroh/materialistic

@Test
public void testNoExistingAccount() {
  assertThat(drawerAccount).hasText(R.string.login);
  assertThat(drawerLogout).isNotVisible();
  assertThat(drawerUser).isNotVisible();
  Preferences.setUsername(activity, "username");
  assertThat(drawerAccount).hasText("username");
  assertThat(drawerLogout).isVisible();
  assertThat(drawerUser).isVisible();
  drawerLogout.performClick();
  AlertDialog alertDialog = ShadowAlertDialog.getLatestAlertDialog();
  assertNotNull(alertDialog);
  alertDialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
  assertThat(drawerAccount).hasText(R.string.login);
  assertThat(drawerLogout).isNotVisible();
}
origin: hidroh/materialistic

@Test
public void testExistingAccount() {
  AccountManager.get(activity).addAccountExplicitly(new Account("existing",
      BuildConfig.APPLICATION_ID), "password", null);
  drawerAccount.performClick();
  AlertDialog alertDialog = ShadowAlertDialog.getLatestAlertDialog();
  assertNotNull(alertDialog);
  assertThat(alertDialog.getListView().getAdapter()).hasCount(1);
  shadowOf(alertDialog).clickOnItem(0);
  alertDialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
  assertThat(alertDialog).isNotShowing();
  assertThat(drawerAccount).hasText("existing");
  assertThat(drawerLogout).isVisible();
  drawerAccount.performClick();
  alertDialog = ShadowAlertDialog.getLatestAlertDialog();
  assertThat(alertDialog.getListView().getAdapter()).hasCount(1);
}
origin: passy/Android-DirectoryChooser

@Test
public void testCreateDirectoryDialogDisallowFolderNameModification() {
  final String directoryName = "mydir";
  final DirectoryChooserFragment fragment = DirectoryChooserFragment.newInstance(
      DirectoryChooserConfig.builder()
          .newDirectoryName(directoryName)
          .initialDirectory("")
          .allowReadOnlyDirectory(false)
          .allowNewDirectoryNameModification(false)
          .build());
  startFragment(fragment, DirectoryChooserActivityMock.class);
  fragment.onOptionsItemSelected(new TestMenuItem() {
    @Override
    public int getItemId() {
      return R.id.new_folder_item;
    }
  });
  final AlertDialog dialog = (AlertDialog) ShadowDialog.getLatestDialog();
  final ShadowAlertDialog shadowAlertDialog = Shadows.shadowOf(dialog);
  assertThat(shadowAlertDialog.getTitle()).isEqualTo("Create folder");
  assertThat(ShadowDialog.getShownDialogs()).contains(dialog);
  final TextView msgView = (TextView) dialog.findViewById(R.id.msgText);
  assertThat(msgView).hasText("Create new folder with name \"mydir\"?");
  final EditText editText = (EditText) dialog.findViewById(R.id.editText);
  assertThat(editText).isGone();
}
org.assertj.android.api.widgetTextViewAsserthasText

Popular methods of TextViewAssert

  • <init>
  • hasTextString
  • isVisible
  • containsText
  • doesNotContainText
  • hasCurrentTextColor
  • isEmpty
  • isGone
  • isNotNull
  • isNotVisible

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Collectors (java.util.stream)
  • JComboBox (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now