@Test(groups = "4.Future") @IssueTracking("https://issues.jboss.org/browse/RF-12609") public void testShowControls() { inplaceInputAttributes.set(InplaceInputAttributes.showControls, Boolean.TRUE); assertFalse(inplaceInput.getControls().isVisible(), "Controls should not be visible."); assertFalse( Graphene.element(inplaceInput.getControls().getCancelButtonElement()) .isVisible() .apply(driver), "Cancel button should not be visible."); assertFalse( Graphene.element(inplaceInput.getControls().getOkButtonElement()).isVisible().apply(driver), "Ok button should not be visible."); inplaceInput.editBy(OpenBy.CLICK); assertTrue(inplaceInput.getControls().isVisible(), "Controls are not visible."); assertTrue( Graphene.element(inplaceInput.getControls().getCancelButtonElement()) .isVisible() .apply(driver), "Cancel button is not visible."); assertTrue( Graphene.element(inplaceInput.getControls().getOkButtonElement()).isVisible().apply(driver), "Ok button is not visible."); }
@Test public void testDisabled() { inplaceInputAttributes.set(InplaceInputAttributes.disabled, Boolean.TRUE); assertTrue(inplaceInput.isVisible(), "Inplace input is not on the page."); assertEquals(inplaceInput.getLabelValue(), "RichFaces 4", "Default label"); assertFalse( Graphene.element(inplaceInput.getControls().getCancelButtonElement()) .isVisible() .apply(driver), "OK button should not be present on the page."); assertFalse( Graphene.element(inplaceInput.getControls().getCancelButtonElement()) .isVisible() .apply(driver), "Cancel button should not be present on the page."); }
@Override public void setDateTime(DateTime dt) { if (Graphene.element(getFooterControls().getApplyButtonElement()).isVisible().apply(driver)) { super.setDateTime(dt); getFooterControls().getApplyButtonElement().click(); } else { getHeaderControls().openYearAndMonthEditor().selectDate(dt).confirmDate(); getDayPicker().selectDayInMonth(dt); if (Graphene.element(getProxiedFooterControls().getTimeEditorOpenerElement()) .isVisible() .apply(driver)) { getProxiedFooterControls() .openTimeEditor() .setTime(dt, TimeEditor.SetValueBy.TYPING) .confirmTime(); } } }
@Test public void testInit() { assertTrue(inplaceInput.isVisible(), "Inplace input is not on the page."); assertEquals(inplaceInput.getLabelValue(), "RichFaces 4", "Default label"); assertEquals(inplaceInput.getEditValue(), "RichFaces 4", "Default value of input"); assertTrue( Graphene.element(inplaceInput.getControls().getOkButtonElement()) .not() .isVisible() .apply(driver), "OK button should not be present on the page."); assertTrue( Graphene.element(inplaceInput.getControls().getCancelButtonElement()) .not() .isVisible() .apply(driver), "Cancel button should not be present on the page."); }
@Test public void testButtonLabel() { calendarAttributes.set(CalendarAttributes.buttonLabel, "label"); assertTrue( Graphene.element(calendar.getPopupButton()).isVisible().apply(driver), "Button should be displayed."); assertEquals(calendar.getPopupButton().getText(), "label", "Label of the button."); assertNotEquals( calendar.getPopupButton().getTagName(), "img", "Image should not be displayed."); calendarAttributes.set(CalendarAttributes.buttonIcon, "star"); assertNotEquals( calendar.getPopupButton().getTagName(), "img", "Image should not be displayed."); }
private void assertNotVisible(WebElement element) { assertTrue(Graphene.element(element).not().isVisible().apply(driver)); }