lib/acouchi/solo.rb in acouchi-0.0.7 vs lib/acouchi/solo.rb in acouchi-0.0.8
- old
+ new
@@ -9,15 +9,15 @@
def send_key key
call_method("sendKey", [key])
end
- def enter_text index, text
+ def enter_text text, index=0
call_method("enterText", [index, text])
end
- def clear_edit_text index
+ def clear_text index=0
call_method("clearEditText", [index])
end
def has_text? text, options={}
options = {
@@ -107,9 +107,25 @@
call_method("scrollToSide", [RIGHT])
end
def go_back
call_method("goBack")
+ end
+
+ def wait_for_text text, options = {}
+ options = {
+ :minimum_number_of_matches => 0,
+ :timeout => 20,
+ :scroll => true,
+ :must_be_visible => true
+ }.merge(options)
+ call_method("waitForText", [
+ text,
+ options[:minimum_number_of_matches],
+ options[:timeout],
+ options[:scroll],
+ options[:must_be_visible]
+ ])
end
private
def call_method name, arguments = []
arguments = arguments.map {|a| a.to_s}