Module: Symbiont
- Defined in:
- lib/symbiont.rb,
lib/symbiont/pages.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
Defined Under Namespace
Modules: Accessor, Assertion, DataBuilder, DataReader, DataSetter, Element, Errors, Factory, Helpers, Page
Constant Summary
collapse
- VERSION =
'0.8.0'
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
Returns browser driver reference.
48
49
50
|
# File 'lib/symbiont.rb', line 48
def browser
@browser
end
|
Class Method Details
.elements ⇒ Array
Calls the Watir module to get a list of the factory methods that Watir uses to reference and access web objects.
6
7
8
9
10
11
12
|
# File 'lib/symbiont/elements.rb', line 6
def self.elements
unless @elements
@elements = Watir::Container.instance_methods
end
@elements
end
|
.included(caller) ⇒ Object
The included callback is used to provide the core functionality of the library to any class or module that includes the Symbiont library. The calling class or module is extended with logic that the library makes available as class methods. Any such class or module becomes a page or activity definition. The class methods allow assertions and element defintions to be defined.
.selectable ⇒ Object
18
19
20
|
# File 'lib/symbiont/elements.rb', line 18
def self.selectable
@selectable ||= [:select_list]
end
|
.selectable?(element) ⇒ Boolean
26
27
28
|
# File 'lib/symbiont/elements.rb', line 26
def self.selectable?(element)
selectable.include? element.to_sym
end
|
14
15
16
|
# File 'lib/symbiont/elements.rb', line 14
def self.settable
@settable ||= [:text_field, :file_field, :textarea]
end
|
.settable?(element) ⇒ Boolean
22
23
24
|
# File 'lib/symbiont/elements.rb', line 22
def self.settable?(element)
settable.include? element.to_sym
end
|
.trace(message, level = 1) ⇒ Object
43
44
45
|
# File 'lib/symbiont.rb', line 43
def self.trace(message, level = 1)
puts '*' * level + " #{message}" if ENV['SYMBIONT_TRACE'] == 'on'
end
|
Instance Method Details
#initialize(driver) ⇒ Object
51
52
53
54
55
56
57
|
# File 'lib/symbiont.rb', line 51
def initialize(driver)
Symbiont.trace("Symbiont attached to browser:\n\t#{driver.inspect}")
@browser = driver
initialize_page if respond_to?(:initialize_page)
initialize_activity if respond_to?(:initialize_activity)
end
|