예제 #1
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());
    }
  }
예제 #2
0
 @Test
 public void testCorrectValues() {
   page.fillCorrectValues();
   page.validate();
   page.getMessageForJob().advanced().waitUntilMessageIsNotVisible().perform();
   assertFalse("Unexpected message is present.", page.isAnyMessagePresent());
 }