Package com.crawljax.test

Examples of com.crawljax.test.BaseCrawler


  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void testHiddenElementsSiteCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site") {
      @Override
      public CrawljaxConfigurationBuilder newCrawlConfigurationBuilder() {
        CrawljaxConfigurationBuilder builder =
                super.newCrawlConfigurationBuilder();
        builder.crawlRules().crawlHiddenAnchors(true);
View Full Code Here


  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void whenHiddenElementsOfItShouldntCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site").crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();

    // this includes the bug of #97
    int expectedStates = 3 - 2;
    assertThat(stateFlowGraph, hasStates(expectedStates));
View Full Code Here

@Category(BrowserTest.class)
public class BrowserDoesntLeaveUrlTest {

  @Test
  public void whenJavaScriptNavigatesAwayFromPageItIsBlocked() throws Exception {
    BaseCrawler crawler = new BaseCrawler("navigate_other_urls.html");
    // crawler.showWebSite();
    CrawlSession session = crawler.crawl();
    assertThat(session.getStateFlowGraph(), hasStates(5));
  }
View Full Code Here

  private CrawlSession crawl;

  @Before
  public void setup() {
    crawl = new BaseCrawler(Resource.newClassPathResource("demo-site")) {
      @Override
      protected CrawljaxConfigurationBuilder newCrawlConfigurationBuilder() {
        return super.newCrawlConfigurationBuilder()
                .setMaximumStates(2);
      }
View Full Code Here

  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void testHiddenElementsSiteCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site") {
      @Override
      public CrawljaxConfigurationBuilder newCrawlConfigurationBuilder() {
        CrawljaxConfigurationBuilder builder =
                super.newCrawlConfigurationBuilder();
        builder.crawlRules().crawlHiddenAnchors(true);
View Full Code Here

  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void whenHiddenElementsOfItShouldntCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site").crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();

    // this includes the bug of #97
    int expectedStates = 3 - 2;
    assertThat(stateFlowGraph, hasStates(expectedStates));
View Full Code Here

@Category(BrowserTest.class)
public class BrowserClosesDownloadPopUp {

  @Test
  public void webBrowserWindowOpensItIsIgnored() {
    BaseCrawler crawler =
            new BaseCrawler(Resource.newClassPathResource("/site"), "download/download.html");
    CrawlSession crawl = crawler.crawl();
    assertThat(crawl.getStateFlowGraph(), hasStates(2));
  }
View Full Code Here

  @Test
  public void chromeProxyConfig() {
    assumeThat(System.getProperty("webdriver.chrome.driver"), is(notNullValue()));
    CrawlSession crawl =
            new BaseCrawler(Resource.newClassPathResource("/site"),
                    "simplelink/simplelink.html") {
              @Override
              public CrawljaxConfigurationBuilder newCrawlConfigurationBuilder() {
                CrawljaxConfigurationBuilder builder =
                        super.newCrawlConfigurationBuilder();
View Full Code Here

  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void testHiddenElementsSiteCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site") {
      @Override
      public CrawljaxConfigurationBuilder newCrawlConfigurationBuilder() {
        CrawljaxConfigurationBuilder builder =
                super.newCrawlConfigurationBuilder();
        builder.crawlRules().crawlHiddenAnchors(true);
View Full Code Here

  /**
   * Shows <a href='https://github.com/crawljax/crawljax/issues/97'>Issue 97</a>
   */
  @Test
  public void whenHiddenElementsOfItShouldntCrawl() throws Exception {
    CrawlSession crawl = new BaseCrawler("hidden-elements-site").crawl();
    StateFlowGraph stateFlowGraph = crawl.getStateFlowGraph();

    // this includes the bug of #97
    int expectedStates = 3 - 2;
    assertThat(stateFlowGraph, hasStates(expectedStates));
View Full Code Here

TOP

Related Classes of com.crawljax.test.BaseCrawler

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.