@Test public void testRequiredMessage() { String msg = "RichFaces 4"; calendarAttributes.set(CalendarAttributes.requiredMessage, msg); calendarAttributes.set(CalendarAttributes.required, Boolean.TRUE); submitWithA4jSubmitBtn(); assertTrue(message.isVisible()); assertEquals(message.getDetail(), msg); }
@Test public void testRequiredMessage() { String reqMsg = "Another new and completely different required message."; inplaceInputAttributes.set(InplaceInputAttributes.required, Boolean.TRUE); inplaceInputAttributes.set(InplaceInputAttributes.requiredMessage, reqMsg); MetamerPage.waitRequest(inplaceInput.editBy(OpenBy.CLICK).type(""), WaitRequestType.XHR) .confirm(); assertTrue(requiredMessage.isVisible()); assertEquals(requiredMessage.getDetail(), reqMsg); }
@Test @RegressionTest("https://issues.jboss.org/browse/RF-11313") public void testConverterMessage() { String errorMsg = "conversion error"; calendarAttributes.set(CalendarAttributes.enableManualInput, Boolean.TRUE); calendarAttributes.set(CalendarAttributes.converterMessage, errorMsg); calendar.getInput().sendKeys("RF 4"); submitWithA4jSubmitBtn(); Graphene.waitAjax().until(message.isVisibleCondition()); assertEquals(message.getDetail(), errorMsg); }
@Test @Use( field = "booleanValue", booleans = {false, true}) public void testRequired() { calendarAttributes.set(CalendarAttributes.required, booleanValue); submitWithA4jSubmitBtn(); if (booleanValue) { assertTrue(message.isVisible()); assertEquals(message.getDetail(), "value is required"); } else { assertFalse(message.isVisible()); } }
@Test public void testRequired() { inplaceInputAttributes.set(InplaceInputAttributes.required, Boolean.TRUE); MetamerPage.waitRequest(inplaceInput.editBy(OpenBy.CLICK).type(""), WaitRequestType.XHR) .confirm(); assertTrue(requiredMessage.isVisible()); assertEquals( requiredMessage.getDetail(), inplaceInputAttributes.get(InplaceInputAttributes.requiredMessage)); inplaceInputAttributes.set(InplaceInputAttributes.required, Boolean.FALSE); MetamerPage.waitRequest(inplaceInput.editBy(OpenBy.CLICK).type(""), WaitRequestType.XHR) .confirm(); assertFalse(requiredMessage.isVisible()); }
@Test public void testValidation() { String goodText = "1234"; String longText = "1234567"; assertEquals(input.getAttribute("value"), AbstractPlaceholderJSFTest.DEFAULT_PLACEHOLDER_TEXT); assertFalse(msg.isVisible(), "Validation message should not be visible"); typeTextAndBlur(goodText); assertEquals(input.getAttribute("value"), goodText); assertFalse(msg.isVisible(), "Validation message should not be visible"); typeTextAndBlur(""); Graphene.waitGui().until(msg.isVisibleCondition()); assertEquals(input.getAttribute("value"), AbstractPlaceholderJSFTest.DEFAULT_PLACEHOLDER_TEXT); assertTrue(msg.isVisible(), "Validation message should be visible"); typeTextAndBlur(goodText); Graphene.waitGui().until(msg.isNotVisibleCondition()); typeTextAndBlur(longText); Graphene.waitGui().until(msg.isVisibleCondition()); assertEquals(input.getAttribute("value"), longText); assertTrue(msg.isVisible(), "Validation message should be visible"); }