Permalink
Browse files

Template tests for basic finding by CSS in Taxi API

  • Loading branch information...
1 parent 5e9c0f7 commit 5ce747cafec5caa2e91fc76916626b95dc6d4acf @semperos committed Nov 6, 2012
Showing with 28 additions and 28 deletions.
  1. +28 −28 test/clj_webdriver/test/taxi.clj
@@ -72,34 +72,34 @@
(deftest-template-param
test-finding-elements-with-CSS @alt-driver
- (click (find-element {:tag :a, :text "example form"}))
- (is (= (attribute "#first_name" :id) "first_name"))
- (is (= (attribute "*[type='text']" :id) "first_name"))
- (is (= (attribute "input[name='first_name']" :id) "first_name"))
- (is (= (attribute "input[type='text'][name='first_name']" :id) "first_name"))
- (is (= (attribute "input[type='text'][name^='first_']" :id) "first_name"))
- (is (= (text "a") "home"))
- (is (= (text "a.menu-item") "home"))
- (is (= (attribute {:tag "a", :class "menu-item"} :class) "menu-item"))
- (is (= (text "#footer a.menu-item") "home"))
- (is (= (attribute "option[value*='cial_']" :value) "social_media"))
- (is (= (attribute "option[value^='social_']" :value) "social_media"))
- (is (= (attribute "option[value$='_media']" :value) "social_media"))
- (is (= (attribute "option[value]" :value) "france"))
- (back) ;; on starting page
- (is (= (attribute "*.first.odd" :class) "first odd"))
- (is (= (tag {:class "external"}) "a"))
- (is (= (text (nth (elements "a") 1)) "Moustache"))
- (is (= (text "*.external") "Moustache"))
- (is (= (attribute "*.first.odd" :class) "first odd"))
- (is (= (attribute "li.first.odd" :class) "first odd"))
- (is (= (count (elements "a")) 10))
- (is (= (text "a[class^='exter']") "Moustache"))
- (is (= (text "a.external[href*='github']") "Moustache"))
- (is (= (text "a[class*='exter'][href*='github']") "Moustache"))
- (is (= (count (elements "*[class*='-item']")) 5))
- (is (= (count (elements "a[class*='-item']")) 5))
- (is (= (count (elements "a[class*='exter'][href*='github']")) 2)))
+ (click __ (find-element __ {:tag :a, :text "example form"}))
+ (is (= (attribute __ "#first_name" :id) "first_name"))
+ (is (= (attribute __ "*[type='text']" :id) "first_name"))
+ (is (= (attribute __ "input[name='first_name']" :id) "first_name"))
+ (is (= (attribute __ "input[type='text'][name='first_name']" :id) "first_name"))
+ (is (= (attribute __ "input[type='text'][name^='first_']" :id) "first_name"))
+ (is (= (text __ "a") "home"))
+ (is (= (text __ "a.menu-item") "home"))
+ (is (= (attribute __ {:tag "a", :class "menu-item"} :class) "menu-item"))
+ (is (= (text __ "#footer a.menu-item") "home"))
+ (is (= (attribute __ "option[value*='cial_']" :value) "social_media"))
+ (is (= (attribute __ "option[value^='social_']" :value) "social_media"))
+ (is (= (attribute __ "option[value$='_media']" :value) "social_media"))
+ (is (= (attribute __ "option[value]" :value) "france"))
+ (back __) ;; on starting page
+ (is (= (attribute __ "*.first.odd" :class) "first odd"))
+ (is (= (tag __ {:class "external"}) "a"))
+ (is (= (text __ (nth (elements __ "a") 1)) "Moustache"))
+ (is (= (text __ "*.external") "Moustache"))
+ (is (= (attribute __ "*.first.odd" :class) "first odd"))
+ (is (= (attribute __ "li.first.odd" :class) "first odd"))
+ (is (= (count (elements __ "a")) 10))
+ (is (= (text __ "a[class^='exter']") "Moustache"))
+ (is (= (text __ "a.external[href*='github']") "Moustache"))
+ (is (= (text __ "a[class*='exter'][href*='github']") "Moustache"))
+ (is (= (count (elements __ "*[class*='-item']")) 5))
+ (is (= (count (elements __ "a[class*='-item']")) 5))
+ (is (= (count (elements __ "a[class*='exter'][href*='github']")) 2)))
(deftest-template-param
test-querying-under-elements @alt-driver

0 comments on commit 5ce747c

Please sign in to comment.