Skip to content

Commit

Permalink
Merge pull request #437 from janfaracik/remove-disable-project
Browse files Browse the repository at this point in the history
Remove 'Disable project' button usage in test
  • Loading branch information
jglick authored May 24, 2024
2 parents bebf01b + 22a0edd commit 2ecbaa4
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,25 @@ public void addAction() throws Exception {
assertFalse(p.isDisabled());
assertTrue(p.isBuildable());
JenkinsRule.WebClient wc = j.createWebClient();
j.submit(wc.getPage(p).getHtmlElementById("disable-project"));
assertTrue(p.isDisabled());
assertFalse(p.isBuildable());

// Disable the project
HtmlForm form = wc.getPage(p, "configure").getFormByName("config");
HtmlCheckBoxInput checkbox = form.getInputByName("enable");
assertTrue(checkbox.isChecked());
checkbox.setChecked(false);
j.submit(form);
assertTrue(p.isDisabled());
assertFalse(p.isBuildable());

// Re-enable the project
form = wc.getPage(p, "configure").getFormByName("config");
checkbox = form.getInputByName("enable");
assertFalse(checkbox.isChecked());
checkbox.setChecked(true);
j.submit(form);
assertFalse(p.isDisabled());
assertTrue(p.isBuildable());

wc.getPage(new WebRequest(wc.createCrumbedUrl(p.getUrl() + "disable"), HttpMethod.POST));
assertTrue(p.isDisabled());
assertNull(p.scheduleBuild2(0));
Expand Down

0 comments on commit 2ecbaa4

Please sign in to comment.