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