Class: Pickles::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/pickles/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/cucumber/pickles/config.rb', line 21

def initialize
  @css_node_map = {}
  @log_xhr_response = false
  @xpath_node_map = {}
  @fill_tag_steps_map = { 'select' => FillIN::Select,
                          'jselect' => FillIN::JsSelect }
  @check_tag_steps_map = { 'text' => CheckIn::Text,
                           'select' => CheckIn::Select,
                           'image' => CheckIn::Image,
                           'video' => CheckIn::Video }
end

Instance Attribute Details

#css_node_mapObject

Returns the value of attribute css_node_map.



19
20
21
# File 'lib/cucumber/pickles/config.rb', line 19

def css_node_map
  @css_node_map
end

#log_xhr_responseObject

Returns the value of attribute log_xhr_response.



19
20
21
# File 'lib/cucumber/pickles/config.rb', line 19

def log_xhr_response
  @log_xhr_response
end

#xpath_node_mapObject

Returns the value of attribute xpath_node_map.



19
20
21
# File 'lib/cucumber/pickles/config.rb', line 19

def xpath_node_map
  @xpath_node_map
end

Instance Method Details

#check_step_by_tag(tag) ⇒ Object



61
62
63
# File 'lib/cucumber/pickles/config.rb', line 61

def check_step_by_tag(tag)
  @check_tag_steps_map[tag]
end

#check_tag_steps_map=(map) ⇒ Object

Raises:

  • (ArgumentError)


51
52
53
54
55
# File 'lib/cucumber/pickles/config.rb', line 51

def check_tag_steps_map=(map)
  raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash)

  @check_tag_steps_map.merge!(map.stringify_keys)
end

#fill_tag_steps_map=(map) ⇒ Object

Raises:

  • (ArgumentError)


45
46
47
48
49
# File 'lib/cucumber/pickles/config.rb', line 45

def fill_tag_steps_map=(map)
  raise(ArgumentError, "Node map must be a hash") unless map.is_a?(Hash)

  @fill_tag_steps_map.merge!(map.stringify_keys)
end

#step_by_tag(tag) ⇒ Object



57
58
59
# File 'lib/cucumber/pickles/config.rb', line 57

def step_by_tag(tag)
  @fill_tag_steps_map[tag]
end