Codota Logo
TextViewAssert.containsText
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: hidroh/materialistic

@Config(shadows = {ShadowRecyclerView.class, ShadowItemTouchHelper.class})
@Test
public void testSwipeToDelete() {
  RecyclerView.ViewHolder holder = shadowAdapter.getViewHolder(0);
  customShadowOf(recyclerView).getItemTouchHelperCallback()
      .onSwiped(holder, ItemTouchHelper.LEFT);
  verify(favoriteManager).remove(any(Context.class), anyCollection());
  when(favoriteManager.getSize()).thenReturn(1);
  observerCaptor.getValue().onChanged();
  assertEquals(1, adapter.getItemCount());
  assertThat((TextView) activity.findViewById(R.id.snackbar_text))
      .isNotNull()
      .containsText(R.string.toast_removed);
  activity.findViewById(R.id.snackbar_action).performClick();
  verify(favoriteManager).add(any(Context.class), any(WebItem.class));
  when(favoriteManager.getSize()).thenReturn(2);
  observerCaptor.getValue().onChanged();
  assertEquals(2, adapter.getItemCount());
}
origin: hidroh/materialistic

  @Test
  public void testRefreshQuery() {
    RuntimeEnvironment.application.getSharedPreferences("WidgetConfiguration_" + appWidgetId, MODE_PRIVATE)
        .edit()
        .putString(RuntimeEnvironment.application.getString(R.string.pref_widget_theme),
            RuntimeEnvironment.application.getString(R.string.pref_widget_theme_value_light))
        .putString(RuntimeEnvironment.application.getString(R.string.pref_widget_query), "Google")
        .apply();
    widgetProvider.onReceive(RuntimeEnvironment.application,
        new Intent(BuildConfig.APPLICATION_ID + ".ACTION_REFRESH_WIDGET")
            .putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId));
    View view = shadowOf(widgetManager).getViewFor(appWidgetId);
    assertThat((TextView) view.findViewById(R.id.title))
        .containsText("Google");
    assertThat((TextView) view.findViewById(R.id.subtitle))
        .doesNotContainText(R.string.loading_text);
  }
}
origin: hidroh/materialistic

@Test
public void testUpdateBest() {
  RuntimeEnvironment.application.getSharedPreferences("WidgetConfiguration_" + appWidgetId, MODE_PRIVATE)
      .edit()
      .putString(RuntimeEnvironment.application.getString(R.string.pref_widget_theme),
          RuntimeEnvironment.application.getString(R.string.pref_widget_theme_value_dark))
      .putString(RuntimeEnvironment.application.getString(R.string.pref_widget_section),
          RuntimeEnvironment.application.getString(R.string.pref_widget_section_value_best))
      .apply();
  widgetProvider.onReceive(RuntimeEnvironment.application,
      new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE)
          .putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, new int[]{appWidgetId}));
  View view = shadowOf(widgetManager).getViewFor(appWidgetId);
  assertThat((TextView) view.findViewById(R.id.title))
      .containsText(R.string.title_activity_best);
  assertThat((TextView) view.findViewById(R.id.subtitle))
      .doesNotContainText(R.string.loading_text);
}
origin: hidroh/materialistic

Assertions.assertThat((TextView) snackbarView.findViewById(R.id.snackbar_text))
    .isNotNull()
    .containsText(activity.getResources().getQuantityString(R.plurals.new_stories_count, 1, 1));
snackbarView.findViewById(R.id.snackbar_action).performClick();
assertEquals(1, ((RecyclerView) activity.findViewById(R.id.recycler_view)).getAdapter().getItemCount());
Assertions.assertThat((TextView) snackbarView.findViewById(R.id.snackbar_text))
    .isNotNull()
    .containsText(activity.getResources().getQuantityString(R.plurals.showing_new_stories, 1, 1));
snackbarView.findViewById(R.id.snackbar_action).performClick();
assertEquals(2, ((RecyclerView) activity.findViewById(R.id.recycler_view)).getAdapter().getItemCount());
origin: hidroh/materialistic

assertThat((TextView) snackbarView.findViewById(R.id.snackbar_text))
    .isNotNull()
    .containsText(R.string.toast_saved);
snackbarView.findViewById(R.id.snackbar_action).performClick();
verify(favoriteManager).remove(any(Context.class), eq("1"));
origin: hidroh/materialistic

RecyclerView.ViewHolder viewHolder = customShadowOf(recyclerView.getAdapter()).getViewHolder(1);
assertThat((TextView) viewHolder.itemView.findViewById(R.id.posted))
    .containsText(activity.getResources().getQuantityString(R.plurals.score, 46, 46));
assertThat((TextView) viewHolder.itemView.findViewById(R.id.title))
    .isVisible()
origin: hidroh/materialistic

assertThat((TextView) activity.findViewById(R.id.snackbar_text))
    .isNotNull()
    .containsText(R.string.toast_removed);
activity.findViewById(R.id.snackbar_action).performClick();
MaterialisticDatabase.getInstance(RuntimeEnvironment.application).setLiveValue(MaterialisticDatabase
org.assertj.android.api.widgetTextViewAssertcontainsText

Popular methods of TextViewAssert

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

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • putExtra (Intent)
  • onRequestPermissionsResult (Fragment)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Notification (javax.management)
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now