lib/gogo_driver.rb in gogo_driver-0.1.0 vs lib/gogo_driver.rb in gogo_driver-0.1.1
- old
+ new
@@ -17,10 +17,14 @@
def find(selector)
@driver.find_element(css: selector)
end
+ def finds(selector)
+ @driver.find_elements(css: selector)
+ end
+
def has?(selector)
!!find(selector)
rescue Selenium::WebDriver::Error::NoSuchElementError
false
end
@@ -39,7 +43,22 @@
$focus.submit if $focus
end
def method_missing(method, *args, &block)
@driver.respond_to?(method) ? @driver.send(method, *args, &block) : super
+ end
+end
+
+class Selenium::WebDriver::Element
+ def fill(text)
+ $focus = self
+ send_key(text)
+ end
+
+ def find(selector)
+ find_element(css: selector)
+ end
+
+ def finds(selector)
+ find_elements(css: selector)
end
end