lib/element_extensions.rb in gridium-0.2.2 vs lib/element_extensions.rb in gridium-0.2.3
- old
+ new
@@ -25,6 +25,14 @@
def self.hover_away(element)
Driver.execute_script("var evObj = document.createEvent('MouseEvents'); evObj.initMouseEvent(\"mouseout\",true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); arguments[0].dispatchEvent(evObj);", element.element)
sleep 1
end
-end
\ No newline at end of file
+
+ def self.mouse_over(element)
+ Driver.driver.mouse.move_to(element.element)
+ end
+
+ def self.trigger_onblur(element)
+ Driver.execute_script("arguments[0].focus(); arguments[0].blur(); return true", element.element)
+ end
+end