# File lib/capybara/selenium/node.rb, line 6 def [](name) native.attribute(name.to_s) rescue Selenium::WebDriver::Error::WebDriverError nil end
# File lib/capybara/selenium/node.rb, line 48 def click resynchronize { native.click } end
# File lib/capybara/selenium/node.rb, line 52 def drag_to(element) resynchronize { driver.browser.action.drag_and_drop(native, element.native).perform } end
# File lib/capybara/selenium/node.rb, line 72 def find(locator) native.find_elements(:xpath, locator).map { |n| self.class.new(driver, n) } end
# File lib/capybara/selenium/node.rb, line 37 def select_option resynchronize { native.click } unless selected? end
# File lib/capybara/selenium/node.rb, line 65 def selected? selected = native.selected? selected and selected != "false" end
# File lib/capybara/selenium/node.rb, line 20 def set(value) if tag_name == 'input' and type == 'radio' click elsif tag_name == 'input' and type == 'checkbox' click if value ^ native.attribute('checked').to_s.eql?("true") elsif tag_name == 'input' and type == 'file' resynchronize do native.send_keys(value.to_s) end elsif tag_name == 'textarea' or tag_name == 'input' resynchronize do native.clear native.send_keys(value.to_s) end end end
# File lib/capybara/selenium/node.rb, line 56 def tag_name native.tag_name.downcase end
# File lib/capybara/selenium/node.rb, line 41 def unselect_option if select_node['multiple'] != 'multiple' and select_node['multiple'] != 'true' raise Capybara::UnselectNotAllowed, "Cannot unselect option from single select box." end resynchronize { native.click } if selected? end
Generated with the Darkfish Rdoc Generator 2.