Esempio n. 1
0
 @Test
 public void testCorrectValues() {
   page.fillCorrectValues();
   page.validate();
   page.getMessageForJob().advanced().waitUntilMessageIsNotVisible().perform();
   assertFalse("Unexpected message is present.", page.isAnyMessagePresent());
 }
Esempio n. 2
0
  @Test
  public void testLessThanMinimum() {
    page.fillShorterValues();
    page.validate();
    page.getMessageForJob().advanced().waitUntilMessageIsVisible().perform();
    assertTrue("All message should be present.", page.areAllMessagesPresent());

    assertMessageDetail("Name", page.getMessageForName(), MessagePage.NAME_ERROR_LESS_THAN_MINIMUM);
    assertMessageDetail("Job", page.getMessageForJob(), MessagePage.JOB_ERROR_LESS_THAN_MINIMUM);
    assertMessageDetail(
        "Address", page.getMessageForAddress(), MessagePage.ADDRESS_ERROR_LESS_THAN_MINIMUM);
    assertMessageDetail("Zip", page.getMessageForZip(), MessagePage.ZIP_ERROR_LESS_THAN_MINIMUM);
  }
Esempio n. 3
0
  @Test
  @Category(Smoke.class)
  public void testEmptyInputs() {
    page.eraseAll();
    page.validate();
    page.getMessageForJob().advanced().waitUntilMessageIsVisible().perform();
    assertTrue("All message should be present.", page.areAllMessagesPresent());

    assertMessageDetail("Name", page.getMessageForName(), MessagePage.NAME_ERROR_VALUE_REQUIRED);
    assertMessageDetail("Job", page.getMessageForJob(), MessagePage.JOB_ERROR__VALUE_REQUIRED);
    assertMessageDetail(
        "Address", page.getMessageForAddress(), MessagePage.ADDRESS_ERROR__VALUE_REQUIRED);
    assertMessageDetail("Zip", page.getMessageForZip(), MessagePage.ZIP_ERROR__VALUE_REQUIRED);
  }
Esempio n. 4
0
  @Test
  public void testGreaterThanMaximum() {
    page.fillCorrectValues();
    page.fillLongerJob();
    page.validate();
    page.getMessageForJob().advanced().waitUntilMessageIsVisible().perform();
    assertTrue(
        "The message for the Job input should be present.",
        page.getMessageForJob().advanced().isVisible());
    assertMessageDetail("Job", page.getMessageForJob(), MessagePage.JOB_ERROR_GREATER_THAN_MAXIMUM);

    for (Message message :
        new Message[] {
          page.getMessageForAddress(), page.getMessageForName(), page.getMessageForZip()
        }) {
      assertFalse("Unexpected message is present.", message.advanced().isVisible());
    }

    page.fillLongerZip();
    page.validate();
    page.getMessageForZip().advanced().waitUntilMessageIsVisible().perform();
    assertTrue(
        "A message for the Job input should be present.",
        page.getMessageForJob().advanced().isVisible());
    assertMessageDetail("Job", page.getMessageForJob(), MessagePage.JOB_ERROR_GREATER_THAN_MAXIMUM);

    assertTrue(
        "A message for the Zip input should be present.",
        page.getMessageForZip().advanced().isVisible());
    assertMessageDetail("Zip", page.getMessageForZip(), MessagePage.ZIP_ERROR_GREATER_THAN_MAXIMUM);

    for (Message message : new Message[] {page.getMessageForAddress(), page.getMessageForName()}) {
      assertFalse("Unexpected message is present.", message.advanced().isVisible());
    }
  }