Exemplo n.º 1
0
  @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);
  }
Exemplo n.º 2
0
  @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");
  }