Package fitnesse.testsystems.slim

Examples of fitnesse.testsystems.slim.HtmlTableScanner


  }

  @Test
  public void canSeeIfItIsASpecifcationsTable() throws Exception {
     String page = "<table><tr><td>Suite</td></tr><tr><td>Page</td><td>TestPageOne</td></tr><tr><td></td></tr></table>";
    HtmlTableScanner scanner = new HtmlTableScanner(page);
    Table table = scanner.getTable(0);
    assertTrue(SuiteSpecificationRunner.isASuiteSpecificationsTable(table));
    page = "<table><tr><td>no suite</td></tr><tr><td>Page</td><td>TestPageOne</td></tr></table>";
    scanner = new HtmlTableScanner(page);
    table = scanner.getTable(0);
    assertFalse(SuiteSpecificationRunner.isASuiteSpecificationsTable(table));
  }
View Full Code Here


  }

  @Test
  public void shouldBeAbleToParseASmallTableAndGetThePageName() throws Exception {
    String page = "<table><tr><td>Suite</td></tr><tr><td>Page</td><td>TestPageOne</td></tr><tr><td></td></tr></table>";
    HtmlTableScanner scanner = new HtmlTableScanner(page);
    Table table = scanner.getTable(0);
    assertTrue(runner.getImportantTableInformation(table));
    assertEquals("TestPageOne",runner.searchRoot.getName());
    assertEquals(0,runner.testPageList.size());
  }
View Full Code Here

  }

  @Test
  public void shouldBeAbleToGetTheTitleRegExFromATable() throws Exception {
    String page = "<table><tr><td>Suite</td></tr><tr><td>Page</td><td>TestPageOne</td></tr><tr><td>Title</td><td>ChildPage</td></tr></table>";
    HtmlTableScanner scanner = new HtmlTableScanner(page);
    Table table = scanner.getTable(0);
    assertTrue(runner.getImportantTableInformation(table));
    assertEquals("TestPageOne", runner.searchRoot.getName());
    assertEquals("ChildPage", runner.titleRegEx);
  }
View Full Code Here

  }

  @Test
  public void shouldBeAbleToGetTheContentRegExFromTable() throws Exception {
    String page = "<table><tr><td>Suite</td></tr><tr><td>Page</td><td>TestPageOne</td></tr><tr><td>Content</td><td>has.*content</td></tr></table>";
    HtmlTableScanner scanner = new HtmlTableScanner(page);
    Table table = scanner.getTable(0);
    assertTrue(runner.getImportantTableInformation(table));
    assertEquals("has.*content", runner.contentRegEx);
  }
View Full Code Here

  }

  private void initializeComparerHelpers() {
    matchedTables = new ArrayList<MatchedPair>();
    resultContent = new ArrayList<String>();
    firstScanner = new HtmlTableScanner(firstFileContent);
    secondScanner = new HtmlTableScanner(secondFileContent);
  }
View Full Code Here

    finder.search(searchRoot);
  }


  public boolean getPageListFromPageContent(String pageContent) {
    HtmlTableScanner scanner = new HtmlTableScanner(pageContent);
    for (int tableIndex = 0; tableIndex < scanner.getTableCount(); tableIndex++) {
      Table table = scanner.getTable(tableIndex);
      if (!getPageListFromTable(table))
        return false;
    }
    return true;
  }
View Full Code Here

    if (page.getData().hasAttribute("Test"))
      testPageList.add(page);
  }

  public static boolean isASuiteSpecificationsPage(String page) {
    HtmlTableScanner scanner = new HtmlTableScanner(page);
    if (scanner.getTableCount() > 0) {
      Table table = scanner.getTable(0);
      return isASuiteSpecificationsTable(table);
    }
    return false;
  }
View Full Code Here

  private void buildPacket() {
    packet = new JSONObject();
    String html = page.getHtml();

    TableScanner scanner = new HtmlTableScanner(html);

    try {
      addTablesToPacket(scanner);
      if (jsonpFunction != null)
        response.setContent(String.format("%s(%s)", jsonpFunction, packet.toString(1)));
View Full Code Here

TOP

Related Classes of fitnesse.testsystems.slim.HtmlTableScanner

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.