Class: TestRail::TestRunCreation

Inherits:
Object
  • Object
show all
Defined in:
lib/test_rail_integration/generator/test_run_creation.rb

Class Method Summary collapse

Class Method Details

.check_presence_of_test_runObject

Checking that test run already created



32
33
34
# File 'lib/test_rail_integration/generator/test_run_creation.rb', line 32

def self.check_presence_of_test_run
  TestRunCreation.get_test_runs_names.include? Connection.generate_test_run_name
end

.get_created_test_run_idObject

Get id for new test run that we created



21
22
23
24
25
26
27
# File 'lib/test_rail_integration/generator/test_run_creation.rb', line 21

def self.get_created_test_run_id
  test_runs = Connection.get_test_runs
  created_test_run_id = test_runs.map { |test_run|
    test_run.fetch("id") if test_run.fetch("name").eql? Connection.generate_test_run_name
  }
  created_test_run_id.first
end

.get_test_runs_namesObject

Get all test run names for project



11
12
13
14
15
16
# File 'lib/test_rail_integration/generator/test_run_creation.rb', line 11

def self.get_test_runs_names
  test_runs = Connection.get_test_runs
  test_runs_names = []
  test_runs.each { |test_run| test_runs_names.push(test_run.fetch("name")) }
  test_runs_names
end

.initialize_test_runObject

Check and create test run



39
40
41
42
43
44
45
# File 'lib/test_rail_integration/generator/test_run_creation.rb', line 39

def self.initialize_test_run
  unless TestRunCreation.check_presence_of_test_run
    Connection.create_new_test_run_with_name
  end
  created_test_run_id = TestRunCreation.get_created_test_run_id
  TestRailTools.write_test_run_id(created_test_run_id)
end