Permalink
Browse files

Add tests for new table handling functionality, all passing

  • Loading branch information...
semperos committed Jan 6, 2012
1 parent 7c30adf commit 9f90c13033ea7a88ff6fd63383f8feb44f80da4b
Showing with 18 additions and 0 deletions.
  1. +18 −0 test/clj_webdriver/test/core.clj
@@ -210,6 +210,24 @@
(deftest html-function-should-return-string-html-of-element
(is (= (html (find-it dr {:tag :a, :text "Moustache"})) "<a xmlns=\"http://www.w3.org/1999/xhtml\" class=\"external\" href=\"https://github.com/cgrand/moustache\">Moustache</a>")))
+(deftest find-table-cell-should-find-cell-with-coords
+ (is (= "th"
+ (tag (find-table-cell dr {:id "pages-table"} [0 0]))))
+ (is (= "th"
+ (tag (find-table-cell dr {:id "pages-table"} [0 1]))))
+ (is (= "td"
+ (tag (find-table-cell dr {:id "pages-table"} [1 0]))))
+ (is (= "td"
+ (tag (find-table-cell dr {:id "pages-table"} [1 1])))))
+
+(deftest find-table-row-should-find-all-cells-for-row
+ (is (= 2
+ (count (find-table-row dr {:id "pages-table"} 0))))
+ (is (= "th"
+ (tag (first (find-table-row dr {:id "pages-table"} 0)))))
+ (is (= "td"
+ (tag (first (find-table-row dr {:id "pages-table"} 1))))))
+
(deftest test-form-elements
(to dr (str test-base-url "example-form"))
;; Clear element

0 comments on commit 9f90c13

Please sign in to comment.