Module: Symbiont
- Defined in:
- lib/symbiont.rb,
lib/symbiont/pages.rb,
lib/symbiont/ready.rb,
lib/symbiont/errors.rb,
lib/symbiont/factory.rb,
lib/symbiont/helpers.rb,
lib/symbiont/version.rb,
lib/symbiont/accessor.rb,
lib/symbiont/elements.rb,
lib/symbiont/assertions.rb,
lib/symbiont/data_reader.rb,
lib/symbiont/data_setter.rb,
lib/symbiont/data_builder.rb,
lib/symbiont/soap_methods.rb,
lib/symbiont/capybara/page.rb,
lib/symbiont/capybara/region.rb,
lib/symbiont/service_objects.rb,
lib/symbiont/capybara/element.rb
Defined Under Namespace
Modules: Accessor, Assertion, DataBuilder, DataReader, DataSetter, Element, Elements, Errors, Factory, Helpers, Pages, Ready, SoapObject
Classes: Page, Region
Constant Summary
collapse
- VERSION =
'1.2.0'
Class Attribute Summary collapse
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.selectable ⇒ Object
Returns the value of attribute selectable.
7
8
9
|
# File 'lib/symbiont/elements.rb', line 7
def selectable
@selectable
end
|
Returns the value of attribute settable.
7
8
9
|
# File 'lib/symbiont/elements.rb', line 7
def settable
@settable
end
|
.use_implicit_waits ⇒ Object
Returns the value of attribute use_implicit_waits.
88
89
90
|
# File 'lib/symbiont.rb', line 88
def use_implicit_waits
@use_implicit_waits
end
|
Instance Attribute Details
Returns browser driver reference.
66
67
68
|
# File 'lib/symbiont.rb', line 66
def browser
@browser
end
|
Class Method Details
52
53
54
|
# File 'lib/symbiont.rb', line 52
def self.browser
@browser
end
|
.browser=(browser) ⇒ Object
48
49
50
|
# File 'lib/symbiont.rb', line 48
def self.browser=(browser)
@browser = browser
end
|
90
91
92
|
# File 'lib/symbiont.rb', line 90
def configure
yield self
end
|
9
10
11
12
13
14
15
|
# File 'lib/symbiont/elements.rb', line 9
def elements
unless @elements
@elements = Watir::Container.instance_methods
@elements.delete(:extract_selector)
end
@elements
end
|
.selectable?(element) ⇒ Boolean
29
30
31
|
# File 'lib/symbiont/elements.rb', line 29
def selectable?(element)
selectable.include? element.to_sym
end
|
.set_browser(app = :firefox, *args) ⇒ Object
81
82
83
84
|
# File 'lib/symbiont.rb', line 81
def self.set_browser(app = :firefox, *args)
@browser = Watir::Browser.new(app, *args)
Symbiont.browser = @browser
end
|
.settable?(element) ⇒ Boolean
25
26
27
|
# File 'lib/symbiont/elements.rb', line 25
def settable?(element)
settable.include? element.to_sym
end
|
.trace(message, level = 1) ⇒ Object
44
45
46
|
# File 'lib/symbiont.rb', line 44
def self.trace(message, level = 1)
puts '*' * level + " #{message}" if ENV['SYMBIONT_TRACE'] == 'on'
end
|
56
57
58
59
60
61
62
63
|
# File 'lib/symbiont.rb', line 56
def self.version
"""
Symbiont v#{Symbiont::VERSION}
Watir-WebDriver: #{Gem.loaded_specs['watir-webdriver'].version}
Selenium-WebDriver: #{Gem.loaded_specs['selenium-webdriver'].version}
Capybara: #{Gem.loaded_specs['capybara'].version}
"""
end
|
Instance Method Details
#initialize(browser = nil, &block) ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/symbiont.rb', line 69
def initialize(browser = nil, &block)
Symbiont.trace("Symbiont attached to browser:\n\t#{browser.inspect}")
@browser = Symbiont.browser unless Symbiont.browser.nil?
@browser = browser if Symbiont.browser.nil?
initialize_page if respond_to?(:initialize_page)
initialize_activity if respond_to?(:initialize_activity)
instance_eval(&block) if block
end
|