Codota Logo
EspButton
Code IndexAdd Codota to your IDE (free)

How to use
EspButton
in
de.nenick.espressomacchiato.elements

Best Java code snippets using de.nenick.espressomacchiato.elements.EspButton (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: nenick/espresso-macchiato

  @Test
  public void testTemplateConstructor() {
    EspButton template = EspButton.byText(buttonText);
    this.espButton = new EspButton(template);
    this.espButton.assertIsVisible();
  }
}
origin: nenick/espresso-macchiato

/**
 * Access neutral button element.
 *
 * @return New element for actions and assertions.
 *
 * @since Espresso Macchiato 0.2
 */
public EspButton cancelButton() {
  return EspButton.byId(spec.cancelButtonResource);
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithDeny() {
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener)
      .setNegativeButton(DENY, clickListener));
  espAlertDialog.denyButton().click();
  espAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_NEGATIVE);
}
origin: nenick/espresso-macchiato

/**
 * Create new instance matching an element with given resourceId.
 *
 * @param resourceId Identifier for this element.
 *
 * @return New element instance for actions and assertions.
 *
 * @since Espresso Macchiato 0.1
 */
public static EspButton byId(int resourceId) {
  return new EspButton(resourceId);
}
origin: nenick/espresso-macchiato

@Test
public void testDummyLauncher() {
  EspPage.byId(EspDummyLauncherActivity.rootLayout).assertIsDisplayedOnScreen();
  // test start method
  EspDummyLauncherActivity activity = getActivity();
  activity.setStartIntent(BaseActivity.class);
  activity.start();
  EspPage.byId(BaseActivity.rootLayout).assertIsDisplayedOnScreen();
  EspDevice.root().clickBackButton();
  EspPage.byId(EspDummyLauncherActivity.rootLayout).assertIsDisplayedOnScreen();
  // test click action
  EspButton.byId(EspDummyLauncherActivity.buttonId).click();
  EspPage.byId(BaseActivity.rootLayout).assertIsDisplayedOnScreen();
}
origin: nenick/espresso-macchiato

  @Test
  public void testWrongLogin() {
    loginPage.confirm().assertIsDisabled();
    loginPage.username().replaceText("MyUserName");
    loginPage.password().replaceText("*****");
    loginPage.confirm().click();
    loginPage.errorMessage().assertTextIs("Username or password not correct.");
  }
}
origin: nenick/espresso-macchiato

@Test
public void testByText() {
  espButton = EspButton.byText(buttonText);
  espButton.assertIsVisible();
}
origin: nenick/espresso-macchiato

  /**
   * Checks that the current text matches the expected text.
   *
   * @param expected Expected text.
   *
   * @since Espresso Macchiato 0.1
   */
  public void assertTextIs(String expected) {
    findView().check(matches(withText(expected)));
  }
}
origin: nenick/espresso-macchiato

@Test
public void testAssertTextIs() {
  espButton.assertTextIs(buttonText);
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithDeny() {
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener)
      .setNegativeButton(DENY, clickListener));
  espSupportAlertDialog.denyButton().click();
  espSupportAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_NEGATIVE);
}
origin: nenick/espresso-macchiato

/**
 * Create new instance matching an element with given text.
 *
 * @param text Identifier for this element.
 *
 * @return New element instance for actions and assertions.
 *
 * @since Espresso Macchiato 0.2
 */
public static EspButton byText(String text) {
  return new EspButton(withText(text));
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithCancel() {
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener)
      .setNeutralButton(CANCEL, clickListener)
      .setNegativeButton(DENY, clickListener));
  espSupportAlertDialog.cancelButton().click();
  espSupportAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_NEUTRAL);
}
origin: nenick/espresso-macchiato

public EspButton confirm() {
  return new EspButton(R.id.buttonConfirm);
}
origin: nenick/espresso-macchiato

/**
 * Access negative button element.
 *
 * @return New element for actions and assertions.
 *
 * @since Espresso Macchiato 0.2
 */
public EspButton denyButton() {
  return EspButton.byId(spec.denyButtonResource);
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithCancel() {
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener)
      .setNeutralButton(CANCEL, clickListener)
      .setNegativeButton(DENY, clickListener));
  espAlertDialog.cancelButton().click();
  espAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_NEUTRAL);
}
origin: nenick/espresso-macchiato

/**
 * Access positive button element.
 *
 * @return New element for actions and assertions.
 *
 * @since Espresso Macchiato 0.2
 */
public EspButton confirmButton() {
  return EspButton.byId(spec.confirmButtonResource);
}
origin: nenick/espresso-macchiato

@Test
public void testTemplateConstructor() {
  espAlertDialog = new EspAlertDialog(espAlertDialog);
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener));
  espAlertDialog.confirmButton().click();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_POSITIVE);
}
origin: nenick/espresso-macchiato

@Test
public void testTemplateConstructor() {
  espSupportAlertDialog = new EspSupportAlertDialog(espSupportAlertDialog);
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener));
  espSupportAlertDialog.confirmButton().click();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_POSITIVE);
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithConfirm() {
  espAlertDialog.assertNotExist();
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener));
  espAlertDialog.assertIsVisible();
  espAlertDialog.title().assertTextIs(TITLE);
  espAlertDialog.message().assertTextIs(MESSAGE);
  espAlertDialog.confirmButton().click();
  espAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_POSITIVE);
}
origin: nenick/espresso-macchiato

@Test
public void testDialogWithConfirm() {
  espSupportAlertDialog.assertNotExist();
  addDialog(new AlertDialog.Builder(activityTestRule.getActivity())
      .setTitle(TITLE)
      .setMessage(MESSAGE)
      .setPositiveButton(OK, clickListener));
  espSupportAlertDialog.assertIsVisible();
  espSupportAlertDialog.title().assertTextIs(TITLE);
  espSupportAlertDialog.message().assertTextIs(MESSAGE);
  espSupportAlertDialog.confirmButton().click();
  espSupportAlertDialog.assertNotExist();
  espTextView.assertTextIs(CLICKED_BUTTON + DialogInterface.BUTTON_POSITIVE);
}
de.nenick.espressomacchiato.elementsEspButton

Javadoc

Actions and assertions for a Button.

Most used methods

  • <init>
    Create new element instance with custom base matcher.
  • byId
    Create new instance matching an element with given resourceId.
  • click
  • assertIsDisabled
  • assertIsVisible
  • assertTextIs
    Checks that the current text matches the expected text.
  • byText
    Create new instance matching an element with given text.
  • findView

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • startActivity (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
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