Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Template tests for basic finding by CSS in Taxi API
Browse files Browse the repository at this point in the history
  • Loading branch information
semperos committed Nov 6, 2012
1 parent 5e9c0f7 commit 5ce747c
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/clj_webdriver/test/taxi.clj
Expand Up @@ -72,34 +72,34 @@


(deftest-template-param (deftest-template-param
test-finding-elements-with-CSS @alt-driver test-finding-elements-with-CSS @alt-driver
(click (find-element {:tag :a, :text "example form"})) (click __ (find-element __ {:tag :a, :text "example form"}))
(is (= (attribute "#first_name" :id) "first_name")) (is (= (attribute __ "#first_name" :id) "first_name"))
(is (= (attribute "*[type='text']" :id) "first_name")) (is (= (attribute __ "*[type='text']" :id) "first_name"))
(is (= (attribute "input[name='first_name']" :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_name']" :id) "first_name"))
(is (= (attribute "input[type='text'][name^='first_']" :id) "first_name")) (is (= (attribute __ "input[type='text'][name^='first_']" :id) "first_name"))
(is (= (text "a") "home")) (is (= (text __ "a") "home"))
(is (= (text "a.menu-item") "home")) (is (= (text __ "a.menu-item") "home"))
(is (= (attribute {:tag "a", :class "menu-item"} :class) "menu-item")) (is (= (attribute __ {:tag "a", :class "menu-item"} :class) "menu-item"))
(is (= (text "#footer a.menu-item") "home")) (is (= (text __ "#footer a.menu-item") "home"))
(is (= (attribute "option[value*='cial_']" :value) "social_media")) (is (= (attribute __ "option[value*='cial_']" :value) "social_media"))
(is (= (attribute "option[value^='social_']" :value) "social_media")) (is (= (attribute __ "option[value^='social_']" :value) "social_media"))
(is (= (attribute "option[value$='_media']" :value) "social_media")) (is (= (attribute __ "option[value$='_media']" :value) "social_media"))
(is (= (attribute "option[value]" :value) "france")) (is (= (attribute __ "option[value]" :value) "france"))
(back) ;; on starting page (back __) ;; on starting page
(is (= (attribute "*.first.odd" :class) "first odd")) (is (= (attribute __ "*.first.odd" :class) "first odd"))
(is (= (tag {:class "external"}) "a")) (is (= (tag __ {:class "external"}) "a"))
(is (= (text (nth (elements "a") 1)) "Moustache")) (is (= (text __ (nth (elements __ "a") 1)) "Moustache"))
(is (= (text "*.external") "Moustache")) (is (= (text __ "*.external") "Moustache"))
(is (= (attribute "*.first.odd" :class) "first odd")) (is (= (attribute __ "*.first.odd" :class) "first odd"))
(is (= (attribute "li.first.odd" :class) "first odd")) (is (= (attribute __ "li.first.odd" :class) "first odd"))
(is (= (count (elements "a")) 10)) (is (= (count (elements __ "a")) 10))
(is (= (text "a[class^='exter']") "Moustache")) (is (= (text __ "a[class^='exter']") "Moustache"))
(is (= (text "a.external[href*='github']") "Moustache")) (is (= (text __ "a.external[href*='github']") "Moustache"))
(is (= (text "a[class*='exter'][href*='github']") "Moustache")) (is (= (text __ "a[class*='exter'][href*='github']") "Moustache"))
(is (= (count (elements "*[class*='-item']")) 5)) (is (= (count (elements __ "*[class*='-item']")) 5))
(is (= (count (elements "a[class*='-item']")) 5)) (is (= (count (elements __ "a[class*='-item']")) 5))
(is (= (count (elements "a[class*='exter'][href*='github']")) 2))) (is (= (count (elements __ "a[class*='exter'][href*='github']")) 2)))


(deftest-template-param (deftest-template-param
test-querying-under-elements @alt-driver test-querying-under-elements @alt-driver
Expand Down

0 comments on commit 5ce747c

Please sign in to comment.