Package com.crawljax.core.configuration.CrawljaxConfiguration

Examples of com.crawljax.core.configuration.CrawljaxConfiguration.CrawljaxConfigurationBuilder.build()


  public void testIframeExclusions() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder = setupConfig();
    builder.crawlRules().dontCrawlFrame("frame1");
    builder.crawlRules().dontCrawlFrame("sub");
    builder.crawlRules().dontCrawlFrame("frame0");
    CrawljaxConfiguration config = builder.build();
    crawljax = new CrawljaxRunner(config);
    CrawlSession session = crawljax.call();
    assertThat(session.getStateFlowGraph(), hasEdges(3));
    assertThat(session.getStateFlowGraph(), hasStates(4));
  }
View Full Code Here


  @Test
  public void testIFramesNotCrawled() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder = setupConfig();
    builder.crawlRules().crawlFrames(false);
    crawljax = new CrawljaxRunner(builder.build());
    CrawlSession session = crawljax.call();
    assertThat(session.getStateFlowGraph(), hasEdges(3));
    assertThat(session.getStateFlowGraph(), hasStates(4));
  }
View Full Code Here

  public void testIFramesWildcardsNotCrawled() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder = setupConfig();

    builder.crawlRules().dontCrawlFrame("frame%");
    builder.crawlRules().dontCrawlFrame("sub");
    crawljax = new CrawljaxRunner(builder.build());
    CrawlSession session = crawljax.call();
    assertThat(session.getStateFlowGraph(), hasEdges(3));
    assertThat(session.getStateFlowGraph(), hasStates(4));
  }
View Full Code Here

  @Test
  public void testCrawlingOnlySubFrames() throws CrawljaxException {
    CrawljaxConfigurationBuilder builder = setupConfig();
    builder.crawlRules().dontCrawlFrame("frame1.frame10");
    crawljax = new CrawljaxRunner(builder.build());
    CrawlSession session = crawljax.call();
    assertEquals("Clickables", 12, session.getStateFlowGraph()
            .getAllEdges().size());
    assertEquals("States", 12, session.getStateFlowGraph().getAllStates()
            .size());
View Full Code Here

  public void testExtract() throws InterruptedException, CrawljaxException {
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl().toExternalForm());
    builder.crawlRules().click("a");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration.builderFor(DEMO_SITE_SERVER.getSiteUrl().toExternalForm());
    builder.crawlRules().click("a");
    builder.crawlRules().dontClick("div").withAttribute("id", "menubar");
    builder.crawlRules().clickOnce(true);
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(DEMO_SITE_SERVER.getSiteUrl());

    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

    server.before();
    CrawljaxConfigurationBuilder builder =
            CrawljaxConfiguration
                    .builderFor(server.getSiteUrl().toExternalForm() + "iframe/");
    builder.crawlRules().click("a");
    CrawljaxConfiguration config = builder.build();

    CandidateElementExtractor extractor = newElementExtractor(config);
    browser.goToUrl(new URL(server.getSiteUrl().toExternalForm() + "iframe/"));
    List<CandidateElement> candidates = extractor.extract(DUMMY_STATE);
View Full Code Here

      @Override
      public boolean check(EmbeddedBrowser browser) {
        return false;
      }
    }));
    setStateMachineForConfig(builder.build());

    // state2.equals(state3)
    StateVertex state2 = new StateVertexImpl(2, "state2", "<table><div>state2</div></table>");
    StateVertex state3 = new StateVertexImpl(3, "state3", "<table><div>state2</div></table>");
View Full Code Here

                    + "popup");
    builder.setMaximumDepth(3);
    builder.crawlRules().click("a");
    builder.crawlRules().waitAfterEvent(100, TimeUnit.MILLISECONDS);
    builder.crawlRules().waitAfterReloadUrl(100, TimeUnit.MILLISECONDS);
    CrawljaxRunner runner = new CrawljaxRunner(builder.build());
    CrawlSession session = runner.call();
    assertThat(session.getStateFlowGraph(), hasEdges(2));
    assertThat(session.getStateFlowGraph(), hasStates(3));
  }
View Full Code Here

    addOracleComparators(builder);
    addInvariants(builder);
    addWaitConditions(builder);
    addPlugins(builder);

    return builder.build();
  }

  private static InputSpecification getInputSpecification() {
    InputSpecification input = new InputSpecification();
    input.field("textManual").setValue(MANUAL_INPUT_TEXT);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.