Package com.crawljax.core.configuration.CrawlRules

Examples of com.crawljax.core.configuration.CrawlRules.CrawlRulesBuilder


            new Invariant("testInvariantWithPrecondiions", expectElement,
                    onInvariantsPagePreCondition));
  }

  private static void addCrawlElements(CrawljaxConfigurationBuilder builder) {
    CrawlRulesBuilder rules = builder.crawlRules();
    rules.click("a");
    rules.click("div").withText(CLICK_TEXT);
    rules.click("div").underXPath("//SPAN[@id='" + CLICK_UNDER_XPATH_ID + "']");
    rules.click("button").when(new NotRegexCondition("DONT_CLICK_BUTTONS_ON_THIS_PAGE"));
    rules.click("div").withAttribute(ATTRIBUTE, "condition")
            .when(new RegexCondition("REGEX_CONDITION_TRUE"));

    rules.dontClick("a").withText(DONT_CLICK_TEXT);
    rules.dontClick("a").withAttribute(ATTRIBUTE, DONT_CLICK_TEXT);
    rules.dontClick("a").underXPath("//DIV[@id='" + DONT_CLICK_UNDER_XPATH_ID + "']");
  }
View Full Code Here


  @Test
  public void testDontClickUnderXPath() throws Exception {
    CrawljaxConfigurationBuilder builder = SERVER.newConfigBuilder("underxpath.html");
    builder.crawlRules().click("a");
    builder.crawlRules().dontClick("a").underXPath("//A[@class=\"noClickClass\"]");
    CrawlRulesBuilder rules = builder.crawlRules();
    rules.dontClick("a").withAttribute("id", "noClickId");
    rules.dontClickChildrenOf("div").withClass("noChildrenOfClass");
    rules.dontClickChildrenOf("div").withId("noChildrenOfId");

    CrawlSession session = new CrawljaxRunner(builder.build()).call();

    assertThat(session.getStateFlowGraph(), hasStates(2));
  }
View Full Code Here

      new Invariant("testInvariantWithPrecondiions", expectElement,
      onInvariantsPagePreCondition));
  }

  private static void addCrawlElements(CrawljaxConfigurationBuilder builder) {
    CrawlRulesBuilder rules = builder.crawlRules();
    rules.click("a");
    rules.click("div").withText(CLICK_TEXT);
    rules.click("div").underXPath("//SPAN[@id='" + CLICK_UNDER_XPATH_ID + "']");
    rules.click("button").when(new NotRegexCondition("DONT_CLICK_BUTTONS_ON_THIS_PAGE"));
    rules.click("div").withAttribute(ATTRIBUTE, "condition")
       .when(new RegexCondition("REGEX_CONDITION_TRUE"));

    rules.dontClick("a").withText(DONT_CLICK_TEXT);
    rules.dontClick("a").withAttribute(ATTRIBUTE, DONT_CLICK_TEXT);
    rules.dontClick("a").underXPath("//DIV[@id='" + DONT_CLICK_UNDER_XPATH_ID + "']");
  }
View Full Code Here

            new Invariant("testInvariantWithPrecondiions", expectElement,
                    onInvariantsPagePreCondition));
  }

  private static void addCrawlElements(CrawljaxConfigurationBuilder builder) {
    CrawlRulesBuilder rules = builder.crawlRules();
    rules.click("a");
    rules.click("div").withText(CLICK_TEXT);
    rules.click("div").underXPath("//SPAN[@id='" + CLICK_UNDER_XPATH_ID + "']");
    rules.click("button").when(new NotRegexCondition("DONT_CLICK_BUTTONS_ON_THIS_PAGE"));
    rules.click("div").withAttribute(ATTRIBUTE, "condition")
            .when(new RegexCondition("REGEX_CONDITION_TRUE"));

    rules.dontClick("a").withText(DONT_CLICK_TEXT);
    rules.dontClick("a").withAttribute(ATTRIBUTE, DONT_CLICK_TEXT);
    rules.dontClick("a").underXPath("//DIV[@id='" + DONT_CLICK_UNDER_XPATH_ID + "']");
  }
View Full Code Here

TOP

Related Classes of com.crawljax.core.configuration.CrawlRules.CrawlRulesBuilder

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.