Tabnine Logo
EspButton
Code IndexAdd Tabnine 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)

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() {
  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 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 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

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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