Class: QTest::Module

Inherits:
Base
  • Object
show all
Defined in:
lib/qtest/module.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/module.rb', line 3

def id
  @id
end

#moduleObject

Returns the value of attribute module.



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

def module
  @module
end

#projectObject

Returns the value of attribute project.



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

def project
  @project
end

Instance Method Details

#child_module(opts = {}) ⇒ QTest::Module

Get a specific child Module under the Module.

Parameters:

  • opts (Hash) (defaults to: {})
  • id (Hash)

    a customizable set of options

Returns:



10
11
12
13
14
15
# File 'lib/qtest/module.rb', line 10

def child_module(opts = {})
  unique(QTest::Module,
         project: @project.id,
         module: @id,
         id: opts[:id])
end

#child_modules(opts = {}) ⇒ Array[QTest::Module]

Get all child Modules under the Module.

Parameters:

  • opts (Hash) (defaults to: {})
  • search (Hash)

    a customizable set of options

Returns:



22
23
24
25
26
27
# File 'lib/qtest/module.rb', line 22

def child_modules(opts = {})
  all(QTest::Module,
      project: @project.id,
      module: @id,
      search: opts[:search])
end

#create_test_case(opts = {}) ⇒ QTest::TestCase

Create a Test Case under the Module.

Parameters:

  • opts (Hash) (defaults to: {})
  • name (Hash)

    a customizable set of options

  • description (Hash)

    a customizable set of options

  • properties (Hash)

    a customizable set of options

  • test_steps (Hash)

    a customizable set of options

Returns:



46
47
48
49
50
51
# File 'lib/qtest/module.rb', line 46

def create_test_case(opts = {})
  create(QTest::TestCase,
         project: @project.id,
         module: @id,
         attributes: opts)
end

#test_casesArray[QTest::TestCase]

Get all Test Cases under the Module.

Returns:



32
33
34
35
36
# File 'lib/qtest/module.rb', line 32

def test_cases
  all(QTest::TestCase,
      project: @project.id,
      module: @id)
end