lib/rufus/driver.rb in rufus-0.5 vs lib/rufus/driver.rb in rufus-0.6
- old
+ new
@@ -39,10 +39,16 @@
rescue Selenium::WebDriver::Error::NoSuchElementError
return nil
end
end
+ def cells(locator)
+ element = find(locator)
+ raise 'Expected view to be of type UIATableView' unless element.tag_name.eql? 'UIATableView'
+ element.find_elements(:tag_name, 'UIATableCell')
+ end
+
def click(locator)
find(locator).click
end
def press_button name
@@ -157,9 +163,14 @@
elements_by_tag('UIAElement')
end
def elements_by_tag(name)
driver.find_elements(:tag_name, name)
+ end
+
+ def scroll_to(locator)
+ id = find(locator).ref
+ driver.execute_script 'mobile: scrollTo', {'element' => id}
end
private
def url(config)