Module: Watirmark::PageDefinition
Constant Summary
collapse
- @@browser =
nil
Instance Attribute Summary collapse
#process_page_active_page_method, #process_page_navigate_method, #process_page_submit_method, #process_pages
Instance Method Summary
collapse
#always_activate_parent, #process_page, #process_page_alias
Instance Attribute Details
Returns the value of attribute kwd_metadata.
78
79
80
|
# File 'lib/watirmark/page/page_definition.rb', line 78
def kwd_metadata
@kwd_metadata
end
|
Returns the value of attribute kwds.
78
79
80
|
# File 'lib/watirmark/page/page_definition.rb', line 78
def kwds
@kwds
end
|
Returns the value of attribute perms.
78
79
80
|
# File 'lib/watirmark/page/page_definition.rb', line 78
def perms
@perms
end
|
Instance Method Details
113
114
115
|
# File 'lib/watirmark/page/page_definition.rb', line 113
def browser
@@browser ||= Watirmark::Session.instance.openbrowser
end
|
#browser=(x) ⇒ Object
117
118
119
|
# File 'lib/watirmark/page/page_definition.rb', line 117
def browser=(x)
@@browser = x
end
|
#browser_exists? ⇒ Boolean
121
122
123
|
# File 'lib/watirmark/page/page_definition.rb', line 121
def browser_exists?
!!@@browser
end
|
#inherited(klass) ⇒ Object
82
83
84
85
86
87
|
# File 'lib/watirmark/page/page_definition.rb', line 82
def inherited(klass)
add_superclass_keywords_to_subclass(klass)
add_superclass_keyword_metadata_to_subclass(klass)
add_superclass_process_pages_to_subclass(klass)
create_default_process_page(klass)
end
|
#keyword(name, map = nil, &block) ⇒ Object
89
90
91
|
# File 'lib/watirmark/page/page_definition.rb', line 89
def keyword(name, map=nil, &block)
create_new_keyword(name, map, permissions={:populate => true, :verify => true}, &block)
end
|
#keyword_alias(keyword_alias_name, keyword_name) ⇒ Object
Create an alias to an existing keyword
108
109
110
111
|
# File 'lib/watirmark/page/page_definition.rb', line 108
def keyword_alias(keyword_alias_name, keyword_name)
keyword_data = @kwd_metadata[self.to_s][keyword_name]
create_new_keyword(keyword_alias_name, keyword_data[:map], keyword_data[:permissions], &keyword_data[:block])
end
|
135
136
137
138
|
# File 'lib/watirmark/page/page_definition.rb', line 135
def keyword_metadata
@kwd_metadata ||= nested_hash
@kwd_metadata.values.inject(:merge)
end
|
125
126
127
128
|
# File 'lib/watirmark/page/page_definition.rb', line 125
def keywords
@kwds ||= Hash.new { |h, k| h[k] = Array.new }
@kwds.values.flatten.uniq.sort_by { |key| key.to_s }
end
|
#native_keywords ⇒ Object
130
131
132
133
|
# File 'lib/watirmark/page/page_definition.rb', line 130
def native_keywords
@kwds ||= Hash.new { |h, k| h[k] = Array.new }
@kwds[self.to_s].sort_by { |key| key.to_s }
end
|
#populate_keyword(name, map = nil, &block) ⇒ Object
93
94
95
|
# File 'lib/watirmark/page/page_definition.rb', line 93
def populate_keyword(name, map=nil, &block)
create_new_keyword(name, map, permissions={:populate => true}, &block)
end
|
#private_keyword(name, map = nil, &block) ⇒ Object
Also known as:
navigation_keyword
101
102
103
|
# File 'lib/watirmark/page/page_definition.rb', line 101
def private_keyword(name, map=nil, &block)
create_new_keyword(name, map, &block)
end
|
#verify_keyword(name, map = nil, &block) ⇒ Object
97
98
99
|
# File 'lib/watirmark/page/page_definition.rb', line 97
def verify_keyword(name, map=nil, &block)
create_new_keyword(name, map, permissions={:verify => true}, &block)
end
|