module Tapestry
Constants
- NATIVE_QUALIFIERS
- VERSION
Attributes
browser[RW]
This accessor is needed so that Tapestry
itself can provide a browser reference to indicate connection to WebDriver. This is a class-level access to the browser.
browser[RW]
This accessor is needed so that internal API calls, like `markup` or `text`, have access to the browser instance. This is an instance-level access to the browser.
Public Class Methods
included(caller)
click to toggle source
# File lib/tapestry.rb, line 16 def self.included(caller) caller.extend Tapestry::Element caller.extend Tapestry::Interface::Page::Attribute caller.__send__ :include, Tapestry::Ready caller.__send__ :include, Tapestry::Locator caller.__send__ :include, Tapestry::Interface::Page caller.__send__ :include, Tapestry::DataSetter end
new(browser = nil, &block)
click to toggle source
# File lib/tapestry.rb, line 25 def initialize(browser = nil, &block) @browser = Tapestry.browser unless Tapestry.browser.nil? @browser = browser if Tapestry.browser.nil? begin_with if respond_to?(:begin_with) instance_eval(&block) if block end
quit_browser()
click to toggle source
# File lib/tapestry.rb, line 50 def quit_browser @browser.quit end
set_browser(app = :chrome, *args)
click to toggle source
# File lib/tapestry.rb, line 43 def set_browser(app = :chrome, *args) @browser = Watir::Browser.new(app, *args) Tapestry.browser = @browser end
Also aliased as: start_browser
Public Instance Methods
dependencies()
click to toggle source
# File lib/tapestry/version.rb, line 14 def dependencies Gem.loaded_specs.values.map { |spec| "#{spec.name} #{spec.version}\n" } .uniq.sort.join(",").split(",") end
elements()
click to toggle source
# File lib/tapestry/element.rb, line 16 def elements @elements ||= Watir::Container.instance_methods unless @elements end
elements?()
click to toggle source
# File lib/tapestry/element.rb, line 8 def elements? @elements end
gem_version(name)
click to toggle source
# File lib/tapestry/version.rb, line 19 def gem_version(name) Gem.loaded_specs[name].version rescue NoMethodError puts "No gem loaded for #{name}." end
recognizes?(method)
click to toggle source
# File lib/tapestry/element.rb, line 12 def recognizes?(method) @elements.include? method.to_sym end
version()
click to toggle source
# File lib/tapestry/version.rb, line 6 def version """ Tapestry v#{Tapestry::VERSION} watir: #{gem_version('watir')} selenium-webdriver: #{gem_version('selenium-webdriver')} """ end