use of com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput in project selenium_java by sergueik.
the class JenkinsConfigurationPage method setAuditReportsPermissionState.
public void setAuditReportsPermissionState(final String userName, final boolean state) {
final HtmlCheckBoxInput input = getAuditReportsPermissionCheckbox(userName);
input.setChecked(state);
}
use of com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput in project workflow-job-plugin by jenkinsci.
the class WorkflowJobTest method disabled.
@Issue("JENKINS-27299")
@Test
public void disabled() throws Exception {
WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p");
assertFalse(p.isDisabled());
assertTrue(p.isBuildable());
JenkinsRule.WebClient wc = j.createWebClient();
j.submit(wc.getPage(p).<HtmlForm>getHtmlElementById("disable-project"));
assertTrue(p.isDisabled());
assertFalse(p.isBuildable());
HtmlForm form = wc.getPage(p, "configure").getFormByName("config");
HtmlCheckBoxInput checkbox = form.getInputByName("disable");
assertTrue(checkbox.isChecked());
checkbox.setChecked(false);
j.submit(form);
assertFalse(p.isDisabled());
wc.getPage(new WebRequest(wc.createCrumbedUrl(p.getUrl() + "disable"), HttpMethod.POST));
assertTrue(p.isDisabled());
assertNull(p.scheduleBuild2(0));
assertThat(new CLICommandInvoker(j, "enable-job").invokeWithArgs("p"), CLICommandInvoker.Matcher.succeededSilently());
assertFalse(p.isDisabled());
}
use of com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput in project shiro by apache.
the class ContainerIntegrationIT method logInAndRememberMe.
@Test
public void logInAndRememberMe() throws Exception {
HtmlPage page = webClient.getPage(getBaseUri() + "login.jsp");
HtmlForm form = page.getFormByName("loginform");
form.<HtmlInput>getInputByName("username").setValueAttribute("root");
form.<HtmlInput>getInputByName("password").setValueAttribute("secret");
HtmlCheckBoxInput checkbox = form.getInputByName("rememberMe");
checkbox.setChecked(true);
page = form.<HtmlInput>getInputByName("submit").click();
jetty.stop();
jetty.start();
page = webClient.getPage(getBaseUri());
// page.getAnchorByHref("/logout");
WebAssert.assertLinkPresentWithText(page, "Log out");
page = page.getAnchorByHref("/account").click();
// login page should be shown again - user remembered but not authenticated
WebAssert.assertFormPresent(page, "loginform");
}
Aggregations