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, #flat_string, #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, libraries = Libraries.new) ⇒ Project

Returns a new instance of Project.



570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/hiptest-publisher/nodes.rb', line 570

def initialize(name, description = '', test_plan = TestPlan.new, scenarios = Scenarios.new, actionwords = Actionwords.new, tests = Tests.new, libraries = Libraries.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,
    libraries: libraries
  }
end

Instance Method Details

#assign_scenarios_to_foldersObject



591
592
593
594
595
596
597
598
# File 'lib/hiptest-publisher/nodes.rb', line 591

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

#has_libraries?Boolean

Returns:

  • (Boolean)


587
588
589
# File 'lib/hiptest-publisher/nodes.rb', line 587

def has_libraries?
  !children[:libraries].children[:libraries].empty?
end