1 package br.com.caelum.seleniumdsl.table.layout;
2
3 import br.com.caelum.seleniumdsl.table.Table;
4
5 import com.thoughtworks.selenium.Selenium;
6
7 public class FullTableLayout implements TableLayout {
8
9 private TableLayoutHelper helper;
10
11 public FullTableLayout(Selenium selenium, String id, String type) {
12 helper = new TableLayoutHelper(selenium, id, type);
13 }
14
15 public int getContentCount() {
16 return helper.countXPath("/tbody/tr");
17 }
18
19 public int getColCount() {
20 return helper.countXPath("/thead/tr/th");
21 }
22
23 public String headerValue(int col) {
24 return helper.getXPathText("/thead/tr[1]/th[" + col + "]");
25 }
26
27 public String headerLinkValue(int col) {
28 return helper.getXPathText("/thead/tr[1]/th[" + col + "]/a/text()");
29 }
30
31 public String value(int row, int col) {
32 return helper.getXPathText("/tbody/tr[" + row + "]/td[" + col + "]");
33 }
34
35 public int getRowCount() {
36 return helper.getRowCount();
37 }
38
39 public boolean contains(Table table, String col, String content) {
40 return helper.contains(table, col, content);
41 }
42 }