use of com.gargoylesoftware.htmlunit.html.HtmlAnchor in project javaee7-samples by javaee-samples.
the class UserTest method testLinkWithParam.
@Test
public void testLinkWithParam() throws IOException {
HtmlAnchor anchor = (HtmlAnchor) page.getElementById("link2");
assertTrue(anchor.getHrefAttribute().contains("faces/login.xhtml"));
assertTrue(anchor.getHrefAttribute().contains("?name=Jack"));
assertEquals("Login2", anchor.asText());
HtmlPage output = anchor.click();
assertEquals("HTTP GET (Login)", output.getTitleText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlAnchor in project javaee7-samples by javaee-samples.
the class UserTest method testLink.
@Test
public void testLink() throws IOException {
HtmlAnchor anchor = (HtmlAnchor) page.getElementById("link1");
assertTrue(anchor.getHrefAttribute().contains("faces/login.xhtml"));
assertEquals("Login1", anchor.asText());
HtmlPage output = anchor.click();
assertEquals("HTTP GET (Login)", output.getTitleText());
}
use of com.gargoylesoftware.htmlunit.html.HtmlAnchor in project javaee7-samples by javaee-samples.
the class UserTest method testLinkWithPreProcessParams.
@Test
public void testLinkWithPreProcessParams() {
HtmlAnchor anchor = (HtmlAnchor) page.getElementById("link3");
assertEquals("Login3", anchor.asText());
assertTrue(anchor.getHrefAttribute().contains("faces/index2.xhtml"));
assertTrue(anchor.getHrefAttribute().contains("?name=Jack"));
}
use of com.gargoylesoftware.htmlunit.html.HtmlAnchor in project blueocean-plugin by jenkinsci.
the class TryBlueOceanMenuTest method testOpenBlueOcean.
@Test
public void testOpenBlueOcean() throws IOException, SAXException {
JenkinsRule.WebClient webClient = j.createWebClient();
HtmlPage page = webClient.getPage(j.getInstance());
HtmlAnchor anchor = page.getAnchorByText(Messages.BlueOceanUrlAction_DisplayName());
Assert.assertEquals("/jenkins/blue/organizations/jenkins/pipelines/", anchor.getHrefAttribute());
Assert.assertEquals("task-link", anchor.getAttribute("class"));
}
Aggregations