Class: PageObjectWrapper::Element

Inherits:
DslElementWithLocator show all
Defined in:
lib/page_object_wrapper/Element.rb

Direct Known Subclasses

Table

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DslElement

#label_alias, #label_alias_value

Constructor Details

#initialize(label, type) ⇒ Element

Returns a new instance of Element.



7
8
9
10
11
12
13
# File 'lib/page_object_wrapper/Element.rb', line 7

def initialize(label, type)
  super label
  @type = type
  @menu = Hash.new
  @press_action = :click
  @required = false
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/page_object_wrapper/Element.rb', line 5

def type
  @type
end

Instance Method Details



19
20
21
# File 'lib/page_object_wrapper/Element.rb', line 19

def menu food_type, value
  @menu[food_type] = value
end


23
24
25
# File 'lib/page_object_wrapper/Element.rb', line 23

def menu_value
  @menu
end

#press_action(action) ⇒ Object



27
28
29
# File 'lib/page_object_wrapper/Element.rb', line 27

def press_action action
  @press_action = action
end

#press_action_valueObject



31
32
33
# File 'lib/page_object_wrapper/Element.rb', line 31

def press_action_value
  @press_action
end

#required(flag) ⇒ Object



35
36
37
# File 'lib/page_object_wrapper/Element.rb', line 35

def required flag
  @required = flag
end

#required_valueObject



39
40
41
# File 'lib/page_object_wrapper/Element.rb', line 39

def required_value
  @required
end

#type_valueObject



15
16
17
# File 'lib/page_object_wrapper/Element.rb', line 15

def type_value
  @type
end