Search in sources :

Example 26 with HtmlPage

use of com.gargoylesoftware.htmlunit.html.HtmlPage in project core by weld.

the class ProbeConfigurationPropertiesTest method testEmbededInfoSnippetNOTAvailable.

@Test
public void testEmbededInfoSnippetNOTAvailable() throws IOException {
    WebClient client = new WebClient();
    HtmlPage page = client.getPage(url.toString() + "test");
    System.out.println(page.getBody().asXml());
    assertFalse(page.getBody().asXml().toString().contains("Probe Development Tool"));
    assertFalse(page.getBody().asXml().toString().contains(TEST_ARCHIVE_NAME));
    assertFalse(page.getBody().asXml().toString().contains("The following snippet was automatically added by Weld"));
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.junit.Test)

Example 27 with HtmlPage

use of com.gargoylesoftware.htmlunit.html.HtmlPage in project core by weld.

the class ProbeDefaultConfigurationPropertiesTest method testEmbededInfoSnippetAvailable.

@Test
public void testEmbededInfoSnippetAvailable() throws IOException {
    WebClient client = new WebClient();
    HtmlPage page = client.getPage(url.toString() + "test");
    assertTrue(page.getBody().asXml().toString().contains("Probe Development Tool"));
    assertTrue(page.getBody().asXml().toString().contains(TEST_ARCHIVE_NAME));
    assertTrue(page.getBody().asXml().toString().contains("The following snippet was automatically added by Weld"));
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.junit.Test)

Example 28 with HtmlPage

use of com.gargoylesoftware.htmlunit.html.HtmlPage in project core by weld.

the class TxEventTest method testRequestContextLifecycle.

/*
    * description = "WBRI-401"
    */
@Test
public void testRequestContextLifecycle() throws Exception {
    WebClient webClient = new WebClient();
    HtmlPage home = webClient.getPage(getPath("home.jsf"));
    HtmlSubmitInput beginConversationButton = getFirstMatchingElement(home, HtmlSubmitInput.class, "SaveButton");
    beginConversationButton.click();
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.junit.Test)

Example 29 with HtmlPage

use of com.gargoylesoftware.htmlunit.html.HtmlPage in project core by weld.

the class FlowMultipleWarTest method testFlow.

private void testFlow(WebClient client, URL warContext) throws IOException {
    HtmlPage page = client.getPage(warContext + "/index.faces");
    HtmlSubmitInput startFlowButton = (HtmlSubmitInput) page.getElementById("start-simple-flow");
    page = startFlowButton.click();
    assertTrue(page.getWebResponse().getContentAsString().contains("Flow 1"));
}
Also used : HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput)

Example 30 with HtmlPage

use of com.gargoylesoftware.htmlunit.html.HtmlPage in project core by weld.

the class ClientConversationContextTest method testRedirectToConversation.

@Test
public void testRedirectToConversation() throws Exception {
    WebClient client = new WebClient();
    HtmlPage page = client.getPage(getPath("/cloud.jsf"));
    HtmlPage snowstorm = getFirstMatchingElement(page, HtmlSubmitInput.class, "snow").click();
    String name = getFirstMatchingElement(snowstorm, HtmlSpan.class, "snowstormName").getTextContent();
    assertEquals(Snowstorm.NAME, name);
    snowstorm = getFirstMatchingElement(snowstorm, HtmlSubmitInput.class, "go").click();
    name = getFirstMatchingElement(snowstorm, HtmlSpan.class, "snowstormName").getTextContent();
    assertEquals(Snowstorm.NAME, name);
}
Also used : HtmlSpan(com.gargoylesoftware.htmlunit.html.HtmlSpan) HtmlPage(com.gargoylesoftware.htmlunit.html.HtmlPage) HtmlSubmitInput(com.gargoylesoftware.htmlunit.html.HtmlSubmitInput) WebClient(com.gargoylesoftware.htmlunit.WebClient) Test(org.junit.Test)

Aggregations

HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)159 Test (org.junit.Test)114 WebClient (com.gargoylesoftware.htmlunit.WebClient)51 HtmlSubmitInput (com.gargoylesoftware.htmlunit.html.HtmlSubmitInput)25 HtmlForm (com.gargoylesoftware.htmlunit.html.HtmlForm)23 HtmlSpan (com.gargoylesoftware.htmlunit.html.HtmlSpan)21 File (java.io.File)17 HtmlInput (com.gargoylesoftware.htmlunit.html.HtmlInput)15 Matchers.containsString (org.hamcrest.Matchers.containsString)13 IOException (java.io.IOException)11 JenkinsRule (org.jvnet.hudson.test.JenkinsRule)10 FreeStyleProject (hudson.model.FreeStyleProject)9 URL (java.net.URL)9 Page (com.gargoylesoftware.htmlunit.Page)8 HtmlTextInput (com.gargoylesoftware.htmlunit.html.HtmlTextInput)7 WebWindow (com.gargoylesoftware.htmlunit.WebWindow)6 DomElement (com.gargoylesoftware.htmlunit.html.DomElement)6 WebRequest (com.gargoylesoftware.htmlunit.WebRequest)5 HtmlButton (com.gargoylesoftware.htmlunit.html.HtmlButton)5 HtmlElement (com.gargoylesoftware.htmlunit.html.HtmlElement)5