Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage


   @Test
   public void testFacesConverterByIdAndByType() throws Exception
   {

      HtmlPage page = getWebClient("/convert/foo/").getPage();

      String content = page.getWebResponse().getContentAsString();
      assertContains(content, "byId = [foo] with length 3");
      assertContains(content, "byType = [foo] with length 3");

   }
View Full Code Here


   }

   @Test
   public void testActionPhases() throws Exception
   {
      HtmlPage firstPage = getWebClient("/action").getPage();

      // reload so we get a postback that visits all the phases
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "Action 1 = RESTORE_VIEW");
      assertContains(secondPageContent, "Action 2 = RENDER_RESPONSE");
      assertContains(secondPageContent, "Action 3 = INVOKE_APPLICATION");

   }
View Full Code Here

   @Test
   public void testActionPhases() throws Exception
   {

      HtmlPage firstPage = getWebClient("/action").getPage();

      // reload so we get a postback that visits all the phases
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "Default = [true]");
      assertContains(secondPageContent, "Ignore Postback = [false]");

   }
View Full Code Here

   @Test
   public void testActionPhases() throws Exception
   {

      HtmlPage firstPage = getWebClient("/binding/foo/").getPage();

      // reload so we get a postback that visits all the phases
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "Wrote [foo] to [defaultPhase] during RESTORE_VIEW");
      assertContains(secondPageContent, "Wrote [foo] to [beforeRenderResponse] during RENDER_RESPONSE");
      assertContains(secondPageContent, "Wrote [foo] to [afterInvokeApplication] during INVOKE_APPLICATION");

   }
View Full Code Here

   @Test
   public void testActionPhases() throws Exception
   {

      HtmlPage firstPage = getWebClient("/binding/foo/").getPage();

      String firstPageContent = firstPage.getWebResponse().getContentAsString();
      assertContains(firstPageContent, "valueDefault = [foo]");
      assertContains(firstPageContent, "valueIgnorePostback = [foo]");

      // reload so we get a postback
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "valueDefault = [foo]");
      assertContains(secondPageContent, "valueIgnorePostback = []");

   }
View Full Code Here

   @Test
   public void testActionPhases() throws Exception
   {

      HtmlPage firstPage = getWebClient("/binding/foo/").getPage();

      // reload so we get a postback that visits all the phases
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "Wrote [foo] to [defaultPhase] during RESTORE_VIEW");
      assertContains(secondPageContent, "Wrote [foo] to [beforeRenderResponse] during RENDER_RESPONSE");
      assertContains(secondPageContent, "Wrote [foo] to [afterInvokeApplication] during INVOKE_APPLICATION");

   }
View Full Code Here

   @Test
   public void testActionPhases() throws Exception
   {

      HtmlPage firstPage = getWebClient("/binding/foo/").getPage();

      String firstPageContent = firstPage.getWebResponse().getContentAsString();
      assertContains(firstPageContent, "valueDefault = [foo]");
      assertContains(firstPageContent, "valueIgnorePostback = [foo]");

      // reload so we get a postback
      HtmlPage secondPage = firstPage.getHtmlElementById("form:reload").click();

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertContains(secondPageContent, "valueDefault = [foo]");
      assertContains(secondPageContent, "valueIgnorePostback = []");

   }
View Full Code Here

  @TestType(Type.ACCEPTANCE)
  public void testPushing() throws Exception {
    WebClient c = new WebClient();
    WebWindow w = new TopLevelWindow("1", c);
    c.setCurrentWindow(w);
    HtmlPage p = c.getPage(TEST_URL);
    Thread.sleep(4000);
    int current = Integer.parseInt(p.getElementById("content").getFirstChild().getFirstChild().getTextContent().trim());
    if (current < 3 || current > 5) {
      throw new Exception("The value is not in the expected interval:[3,5]. The current value:" + current);
    }
    c.getPage(TEST_URL_PREFIX + "/leaving/?requestId=" + p.getElementById("requestId").getAttribute("value"));
  }
View Full Code Here

   @Test
   public void testFacesConverterByIdAndByType() throws Exception
   {

      HtmlPage page = getWebClient("/convert/foo/").getPage();

      String content = page.getWebResponse().getContentAsString();
      assertContains(content, "byId = [foo] with length 3");
      assertContains(content, "byType = [foo] with length 3");

   }
View Full Code Here

   @Test
   public void testNavigateWithSimpleString() throws Exception
   {

      HtmlPage firstPage = getWebClient("/navigate").getPage();
      HtmlPage secondPage = firstPage.getHtmlElementById("form:redirectSimpleString").click();

      assertThat(secondPage.getUrl().toString(), endsWith("/navigate?q=foo"));

      String secondPageContent = secondPage.getWebResponse().getContentAsString();
      assertThat(secondPageContent, containsString("Value = [foo]"));

   }
View Full Code Here

TOP

Related Classes of com.gargoylesoftware.htmlunit.html.HtmlPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.