Skip to content
Permalink
Browse files

[JENKINS-14632] Use a more specific selector so we don't risk matchin… (

#3467)

* [JENKINS-14632] Use a more specific selector so we don't risk matching an element we are not expecting

* [JENKINS-14632] Annotate test with issue number
  • Loading branch information
Vlatombe authored and oleg-nenashev committed Jun 1, 2018
1 parent d7da517 commit 7619aeda1ab4b9d63f73f4548d181882b622c063
@@ -3,7 +3,7 @@ Behaviour.specify("INPUT.advanced-button", 'advanced', 0, function(e) {
var link = $(e.target).up(".advancedLink");
link.style.display = "none"; // hide the button

var container = link.next().down(); // TABLE -> TBODY
var container = link.next("table.advancedBody").down(); // TABLE -> TBODY

var tr = link.up("TR");

@@ -25,4 +25,4 @@ Behaviour.specify("INPUT.advanced-button", 'advanced', 0, function(e) {
layoutUpdateCallback.call();
});
e = null; // avoid memory leak
});
});
@@ -6,6 +6,7 @@
import hudson.util.FormValidation;
import net.sf.json.JSONObject;
import org.jvnet.hudson.test.HudsonTestCase;
import org.jvnet.hudson.test.Issue;
import org.kohsuke.stapler.StaplerRequest;


@@ -32,4 +33,13 @@ public FormValidation doSubmitNestedOptionalBlock(StaplerRequest req) throws Exc
assertEquals("dvalue",c.getString("d"));
return FormValidation.ok();
}
}

@Issue("JENKINS-14632")
public void testSectionInsideOfAdvanced() throws Exception {
HtmlPage p = createWebClient().goTo("self/testSectionInsideOfAdvanced");
HtmlForm f = p.getFormByName("config");
assertFalse(f.getInputByName("b").isDisplayed());
HtmlFormUtil.getButtonByCaption(f, "Advanced...").click();
assertTrue(f.getInputByName("b").isDisplayed());
}
}
@@ -0,0 +1,20 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<l:layout title="Testing the effect of validateButton">
<l:main-panel>
<f:form method="post" name="config" action="">
<f:entry title="a">
<f:textbox name="a" value="avalue" />
</f:entry>
<f:advanced>
<f:section title="foo">
<f:entry title="b">
<f:textbox name="b" value="bvalue" />
</f:entry>
</f:section>
</f:advanced>
<f:submit value="submit" />
</f:form>
</l:main-panel>
</l:layout>
</j:jelly>

0 comments on commit 7619aed

Please sign in to comment.
You can’t perform that action at this time.