Permalink
Browse files

Add support for finding elements with compound class names in find-it

  • Loading branch information...
1 parent 238673e commit 676d7edf798971df6f1583883a9b899b8268692b @semperos semperos committed Jan 18, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/clj_webdriver/core_by.clj
@@ -48,7 +48,13 @@
([attr value] (by-attr= :* attr value)) ; default to * any tag
([tag attr value]
(cond
- (= :class attr) (by-class-name value)
+ (= :class attr) (if-not (re-find #"\s" value)
+ (by-class-name value)
+ (by-xpath (str "//"
+ (name tag)
+ "[@class='"
+ value
+ "']")))
(= :id attr) (by-id value)
(= :name attr) (by-name value)
(= :tag attr) (by-tag value)

0 comments on commit 676d7ed

Please sign in to comment.