Module: Watirmark::PageDefinition

Includes:
ProcessPageDefinition
Included in:
Page
Defined in:
lib/watirmark/page/page_definition.rb

Constant Summary collapse

@@browser =
nil

Instance Attribute Summary collapse

Attributes included from ProcessPageDefinition

#process_page_active_page_method, #process_page_navigate_method, #process_page_submit_method, #process_pages

Instance Method Summary collapse

Methods included from ProcessPageDefinition

#always_activate_parent, #process_page, #process_page_alias

Instance Attribute Details

#kwd_metadataObject

Returns the value of attribute kwd_metadata.



78
79
80
# File 'lib/watirmark/page/page_definition.rb', line 78

def 
  
end

#kwdsObject

Returns the value of attribute kwds.



78
79
80
# File 'lib/watirmark/page/page_definition.rb', line 78

def kwds
  @kwds
end

#permsObject

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

#browserObject



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)
  (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 = [self.to_s][keyword_name]
  create_new_keyword(keyword_alias_name, keyword_data[:map], keyword_data[:permissions], &keyword_data[:block])
end

#keyword_metadataObject



135
136
137
138
# File 'lib/watirmark/page/page_definition.rb', line 135

def 
   ||= nested_hash
  .values.inject(:merge)
end

#keywordsObject



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_keywordsObject



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