lib/rufus/driver.rb in rufus-0.4 vs lib/rufus/driver.rb in rufus-0.5
- old
+ new
@@ -64,12 +64,14 @@
def rotate(orientation)
driver.rotate orientation
end
def type(keys, name)
- locator = {:name => name}
- find(locator).send_keys keys
+ element = find(:name => name)
+ element.click
+ sleep 1
+ element.send_keys keys
end
def sequence(*names, times)
timed_sequence(names, times, 1)
end
@@ -145,10 +147,22 @@
def match?(element, name)
element.attribute(:name).eql? name
end
+ def page_source
+ driver.page_source
+ end
+
+ def all_elements
+ elements_by_tag('UIAElement')
+ end
+
+ def elements_by_tag(name)
+ driver.find_elements(:tag_name, name)
+ end
+
private
def url(config)
if config["appium_url"].nil? || config["appium_url"].eql?("")
'http://127.0.0.1:4723/wd/hub'
@@ -169,18 +183,10 @@
def is_table_view_cell?(element)
class_for(element).eql?('UIATableCell')
end
- def all_elements
- elements_by_tag('UIAElement')
- end
-
- def elements_by_tag(name)
- driver.find_elements(:tag_name, name)
- end
-
def driver
if use_device
@selenium ||= Rufus::Drivers::IOS_Device.for(@config,@url)
else
@selenium ||= Rufus::Drivers::IOS_Simulator.for(@config,@url)
@@ -188,8 +194,7 @@
end
def use_device
@config["use_physical"] == true
end
-
end
end