use of com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior in project openmeetings by apache.
the class TestLoginUI method showRegister.
private FormTester showRegister() {
tester.startPage(SignInPage.class);
tester.assertRenderedPage(SignInPage.class);
ButtonAjaxBehavior b = getButtonBehavior("signin", "register");
tester.executeBehavior(b);
return tester.newFormTester(PATH_REGISTER);
}
use of com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior in project openmeetings by apache.
the class TestInstall method testInstall.
@Test
public void testInstall() {
InstallWizardPage page = tester.startPage(InstallWizardPage.class);
tester.assertRenderedPage(InstallWizardPage.class);
InstallWizard wiz = (InstallWizard) page.get(WIZARD_PATH);
assertNull("Model should be null", wiz.getWizardModel().getActiveStep());
// welcome step
tester.executeBehavior((AbstractAjaxBehavior) page.getBehaviorById(0));
assertNotNull("Model should NOT be null", wiz.getWizardModel().getActiveStep());
ButtonAjaxBehavior prev = getButtonBehavior(tester, WIZARD_PATH, "PREV");
// check enabled, add check for other buttons on other steps
assertFalse("Prev button should be disabled", prev.getButton().isEnabled());
ButtonAjaxBehavior next = getButtonBehavior(tester, WIZARD_PATH, "NEXT");
ButtonAjaxBehavior finish = getButtonBehavior(tester, WIZARD_PATH, SUBMIT);
// DB step
tester.executeBehavior(next);
FormTester wizardTester = tester.newFormTester("wizard:form");
wizardTester.select("view:form:dbType", 1);
checkErrors(tester, 0);
// user step
tester.executeBehavior(next);
checkErrors(tester, 0);
wizardTester.setValue("view:username", adminUsername);
wizardTester.setValue("view:password", userpass);
wizardTester.setValue("view:email", email);
String[] tzIds = TimeZone.getAvailableIDs();
wizardTester.select("view:timeZone", rnd.nextInt(tzIds.length));
wizardTester.setValue("view:group", group);
// cfg+smtp step
tester.executeBehavior(next);
checkErrors(tester, 0);
wizardTester.setValue("view:smtpPort", "25");
wizardTester.select("view:defaultLangId", 0);
// converters step
tester.executeBehavior(next);
checkErrors(tester, 0);
wizardTester.setValue("view:docDpi", "150");
wizardTester.setValue("view:docQuality", "90");
// crypt step
tester.executeBehavior(next);
// not checking errors
if (countErrors(tester) > 0) {
tester.cleanupFeedbackMessages();
wizardTester.setValue("view:docDpi", "150");
wizardTester.setValue("view:docQuality", "90");
// skip errors
tester.executeBehavior(next);
}
wizardTester.setValue("view:cryptClassName", SCryptImplementation.class.getName());
// install step
tester.executeBehavior(next);
checkErrors(tester, 0);
tester.executeBehavior(finish);
checkErrors(tester, 0);
}
use of com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior in project openmeetings by apache.
the class AbstractWicketTester method getButtonBehavior.
public static <T extends Serializable> ButtonAjaxBehavior getButtonBehavior(WicketTester tester, String path, String name) {
Args.notNull(path, "path");
Args.notNull(name, "name");
@SuppressWarnings("unchecked") AbstractDialog<T> dialog = (AbstractDialog<T>) tester.getComponentFromLastRenderedPage(path);
List<ButtonAjaxBehavior> bl = dialog.getBehaviors(ButtonAjaxBehavior.class);
for (ButtonAjaxBehavior bb : bl) {
if (name.equals(bb.getButton().getName())) {
return bb;
}
}
fail(String.format("Button '%s' not found for dialog '%s'", name, path));
return null;
}
use of com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior in project openmeetings by apache.
the class TestCalendar method testEventCreate.
@Test
public void testEventCreate() throws OmException {
testArea(regularUsername, p -> {
Menu menu = (Menu) p.get(PATH_MENU);
Assert.assertNotNull(menu);
tester.getRequest().setParameter("hash", menu.getItemList().get(0).getItems().get(1).getId());
tester.executeBehavior((AbstractAjaxBehavior) menu.getBehaviorById(0));
tester.assertComponent(PATH_CHILD, CalendarPanel.class);
CalendarPanel cal = (CalendarPanel) p.get(PATH_CHILD);
tester.executeAllTimerBehaviors(cal);
User u = userDao.getByLogin(regularUsername, User.Type.user, null);
// test create month
tester.getRequest().setParameter("allDay", String.valueOf(false));
tester.getRequest().setParameter("startDate", LocalDateTime.of(2017, 11, 13, 13, 13).toString());
tester.getRequest().setParameter("endDate", LocalDateTime.of(2017, 11, 13, 13, 13).toString());
tester.getRequest().setParameter("viewName", CalendarView.month.name());
// select-event
tester.executeBehavior((AbstractAjaxBehavior) cal.get("form:calendar").getBehaviorById(0));
FormTester appTester = tester.newFormTester(PATH_APPOINTMENT_DLG_FRM);
// check inviteeType:groupContainer:groups is invisible for regular user
String title = String.format("title%s", UUID.randomUUID());
appTester.setValue("title", title);
ButtonAjaxBehavior save = getButtonBehavior(PATH_APPOINTMENT_DLG, "save");
tester.executeBehavior(save);
List<Appointment> appts = appointmentDao.searchByTitle(u.getId(), title);
assertEquals("Appointment should be created", 1, appts.size());
assertEquals("Appointment should be created", title, appts.get(0).getTitle());
});
}
use of com.googlecode.wicket.jquery.ui.widget.dialog.ButtonAjaxBehavior in project openmeetings by apache.
the class TestLoginUI method performRegister.
private void performRegister(String uid, String lbl) throws ReflectiveOperationException, SecurityException {
ButtonAjaxBehavior b1 = getButtonBehavior("signin", "register");
tester.executeBehavior(b1);
FormTester formTester = tester.newFormTester(PATH_REGISTER);
formTester.setValue("login", getLogin(uid));
formTester.setValue("email", getEmail(uid));
formTester.setValue("firstName", String.format("first%s", uid));
formTester.setValue("lastName", String.format("last%s", uid));
formTester.setValue("password", userpass);
formTester.setValue("confirmPassword", userpass);
formTester.setValue("captcha:captchaText", getCaptcha("register:form:captcha:captcha"));
formTester.submit("submit");
checkErrors(0);
tester.assertLabel("register:confirmRegistration:container:message", getEscapedString(lbl));
ButtonAjaxBehavior b2 = getButtonBehavior("register:confirmRegistration", "OK");
tester.executeBehavior(b2);
}
Aggregations