Class: Hiptest::Nodes::Project

Inherits:
Node
  • Object
show all
Defined in:
lib/hiptest-publisher/nodes.rb

Instance Attribute Summary

Attributes inherited from Node

#children, #parent

Instance Method Summary collapse

Methods inherited from Node

#==, #each_direct_children, #each_sub_nodes, #kind, #pretty_print_instance_variables, #project, #render

Constructor Details

#initialize(name, description = '', test_plan = TestPlan.new, scenarios = Scenarios.new, actionwords = Actionwords.new, tests = Tests.new) ⇒ Project

Returns a new instance of Project.



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/hiptest-publisher/nodes.rb', line 444

def initialize(name, description = '', test_plan = TestPlan.new, scenarios = Scenarios.new, actionwords = Actionwords.new, tests = Tests.new)
  super()
  test_plan.parent = self if test_plan.respond_to?(:parent=)
  scenarios.parent = self
  tests.parent = self

  @children = {
    :name => name,
    :description => description,
    :test_plan => test_plan,
    :scenarios => scenarios,
    :actionwords => actionwords,
    :tests => tests
  }
end

Instance Method Details

#assign_scenarios_to_foldersObject



460
461
462
463
464
465
466
467
# File 'lib/hiptest-publisher/nodes.rb', line 460

def assign_scenarios_to_folders
  @children[:scenarios].children[:scenarios].each do |scenario|
    folder = @children[:test_plan].find_folder_by_uid(scenario.folder_uid)
    next if folder.nil?

    folder.children[:scenarios] << scenario
  end
end