module Symbiote

Constants

VERSION

Attributes

browser[R]

Public Class Methods

new(browser = nil, &block) click to toggle source
# File lib/symbiote.rb, line 22
def initialize(browser = nil, &block)
  @browser = Symbiote.browser unless Symbiote.browser.nil?
  @browser = browser if Symbiote.browser.nil?
  instance_eval(&block) if block
end

Public Instance Methods

browser=(browser) click to toggle source
# File lib/symbiote.rb, line 33
def browser=(browser)
  @browser = browser
end
elements() click to toggle source
# File lib/symbiote/elements.rb, line 9
def elements
  @elements = Watir::Container.instance_methods unless @elements
end
hosts?(method) click to toggle source
# File lib/symbiote/elements.rb, line 13
def hosts?(method)
  Symbiote.elements.include? method.to_sym
end
included(caller) click to toggle source
# File lib/symbiote.rb, line 14
def included(caller)
  caller.extend Symbiote::Elements
  caller.extend Symbiote::Pages::Assertion
  caller.__send__ :include, Symbiote::Elements::Accessor
  caller.__send__ :include, Symbiote::Pages
  caller.__send__ :include, Symbiote::DataSetter
end
set_browser(app = :chrome, *args) click to toggle source
# File lib/symbiote.rb, line 28
def set_browser(app = :chrome, *args)
  @browser = Watir::Browser.new(app, *args)
  Symbiote.browser = @browser
end
version() click to toggle source
# File lib/symbiote/version.rb, line 6
  def version
    """
Symbiote v#{Symbiote::VERSION}
watir: #{Gem.loaded_specs['watir'].version}
watir-webdriver: #{Gem.loaded_specs['watir-webdriver'].version}
selenium-webdriver: #{Gem.loaded_specs['selenium-webdriver'].version}
    """
  end