提交 9bfbba92 编写于 作者: K kohsuke

added a link check test

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14070 71c3de6d-444a-0410-be80-ed276b4c234a
上级 b8001174
......@@ -8,7 +8,7 @@
<d:tag name="feature">
<t:summary icon="${icon}"
href="${href}" iconOnly="true">
<div><a href="${href}">${title}</a></div>
<div class="link"><a href="${href}">${title}</a></div>
<div style="color:gray; text-decoration:none;">
<d:invokeBody />
</div>
......
package hudson.model;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.jvnet.hudson.test.HudsonTestCase;
import java.util.List;
/**
* @author Kohsuke Kawaguchi
*/
public class ManagementLinkTest extends HudsonTestCase {
/**
* Makes sure every link works.
*/
public void testLinks() throws Exception {
HtmlPage page = new WebClient().goTo("manage");
List<?> anchors = page.selectNodes("id('management-links')//*[@class='link']/a");
assertTrue(anchors.size()>=8);
for(HtmlAnchor e : (List<HtmlAnchor>) anchors) {
if(e.getHrefAttribute().endsWith("reload"))
continue; // can't really click this
e.click();
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册