Sha256: e11e17523700976454a75e744e2903abe29694b7752f58c2b535e632ad87ebf0
Contents?: true
Size: 1.49 KB
Versions: 1
Compression:
Stored size: 1.49 KB
Contents
module RUTL module Element # # View element base class. # class Element attr_accessor :context def initialize(element_context) raise element_context.to_s unless element_context.is_a? ElementContext @context = element_context # Not sure why, but I'm seeing Chrome fail becase the context interface # passed in isn't the same as the application's interface. # This only happens with click test cases, before the click, and # only if that case isn't run first. # The context we're passed is also an instance from as # RUTL::Interface::Chrome, but a different instance. # # Here's the kludge workaround line: @context.interface = $application.interface end def find_element @context.find_element end # Returns boolean, of course. # Unlike the underlying Selenium library, I have .exists? because I may # have a valid Element object for something that doesn't exist. Anymore. # Or yet. def exists? find_element rescue Selenium::WebDriver::Error::NoSuchElementError false end def method_missing(method, *args, &block) if args.empty? find_element.send(method) else find_element.send(method, *args, &block) end end def respond_to_missing?(*args) find_element.respond_to?(*args) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rutl-0.8.0 | lib/rutl/element/element.rb |