Skip to content
Permalink
Browse files

Merge pull request #29 from ikedam/feature/JENKINS-28841_ReproduceDoT…

…estError

[JENKINS-28841] Added a test to reproduce JENKINS-28841
  • Loading branch information...
ikedam committed Jun 16, 2015
2 parents 0d8c005 + dad7f37 commit 553735e11d339b86cd51853ed52781129572ad86
@@ -37,6 +37,11 @@
import org.apache.commons.lang.SystemUtils;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.JenkinsRule.WebClient;

import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

/**
* Tests for FilenameChoiceListProvider, concerned with Jenkins.
@@ -303,4 +308,35 @@ public void testDescriptor_doCheckExcludePattern() throws IOException
);
}
}

@Bug(28841)
@Test
public void testDoTest() throws Exception
{
FreeStyleProject p = j.createFreeStyleProject();
p.addProperty(new ParametersDefinitionProperty(new ExtensibleChoiceParameterDefinition(
"Choice",
new FilenameChoiceListProvider(
".",
"*",
"",
FilenameChoiceListProvider.ScanType.File,
false,
FilenameChoiceListProvider.EmptyChoiceType.None
),
false,
""
)));

WebClient wc = j.createWebClient();
HtmlPage page = wc.getPage(p, "configure");

// find the button to call doTest
//List<HtmlElement> elements = page.getElementsByName("choiceListProvider");
//assertEquals(1, elements.size());
//HtmlElement choiceListProviderBlock = elements.get(0);
HtmlElement button = page.<HtmlElement>getFirstByXPath("//*[@name='choiceListProvider']//button|//*[@name='choiceListProvider']//input[@type='button']");
assertNotNull(button);
button.click();
}
}

0 comments on commit 553735e

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