Class: QTest::TestSuite

Inherits:
Base
  • Object
show all
Defined in:
lib/qtest/test_suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#all, #create, find_by, #initialize, method_missing, #move, #unique

Constructor Details

This class inherits a constructor from QTest::Base

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/qtest/test_suite.rb', line 3

def id
  @id
end

#projectObject

Returns the value of attribute project.



3
4
5
# File 'lib/qtest/test_suite.rb', line 3

def project
  @project
end

#releaseObject

Returns the value of attribute release.



3
4
5
# File 'lib/qtest/test_suite.rb', line 3

def release
  @release
end

#test_cycleObject

Returns the value of attribute test_cycle.



3
4
5
# File 'lib/qtest/test_suite.rb', line 3

def test_cycle
  @test_cycle
end

Instance Method Details

#create_test_run(opts = {}) ⇒ QTest::TestRun

Create a Test Run under the Test Suite.

Returns:



15
16
17
18
19
20
# File 'lib/qtest/test_suite.rb', line 15

def create_test_run(opts = {})
  create(QTest::TestRun,
         project: @project.id,
         test_suite: @id,
         attributes: opts)
end

#move_to(opts = {}) ⇒ QTest::TestSuite Also known as: move_under

Move the Test Suite under a different parent.

Returns:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/qtest/test_suite.rb', line 25

def move_to(opts = {})
  move(project: @project.id,
       test_suite: @id,
       release: opts[:release],
       test_cycle: opts[:test_cycle])

  if opts[:release]
    @release = unique(QTest::Release,
                      project: @project.id,
                      release: opts[:release])
  elsif opts[:test_cycle]
    @test_cycle = unique(QTest::TestCycle,
                         project: @project.id,
                         test_cycle: opts[:test_cycle])
  end

  self
end

#test_runsArray[QTest::TestRun]

Get all Test Runs for the Test Suite.

Returns:



8
9
10
# File 'lib/qtest/test_suite.rb', line 8

def test_runs
  all(QTest::TestRun, project: @project.id, test_suite: @id)
end