Module: QTest::REST::TestCycle

Includes:
Utils
Included in:
API
Defined in:
lib/qtest/rest/test_cycle.rb

Instance Method Summary collapse

Methods included from Utils

#decode_response_body, #delete, #get, #handle_response, #post, #put

Instance Method Details

#create_test_cycle(opts = {}) ⇒ Object

POST ‘/projects/:project/test-cycles’



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/qtest/rest/test_cycle.rb', line 28

def create_test_cycle(opts = {})
  query = QueryBuilder.new
                      .options(:json)
                      .project(opts[:project])
                      .test_cycles
                      .data(opts[:attributes])
                      .determine_parent!(opts)
                      .build

  post(query)
end

#delete_test_cycle(opts = {}) ⇒ Object

DELETE ‘/projects/:project/test-cycles/:id?force=?’



64
65
66
67
68
69
70
71
72
73
# File 'lib/qtest/rest/test_cycle.rb', line 64

def delete_test_cycle(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_cycle(opts[:id])

  query.param(:force, opts[:force] || false) if opts[:force]
  query = query.build

  delete(query)
end

#move_test_cycle(opts = {}) ⇒ Object

PUT ‘/projects/:project/test-cycles/:id?parentType=?@parentId=?’



41
42
43
44
45
46
47
48
49
# File 'lib/qtest/rest/test_cycle.rb', line 41

def move_test_cycle(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_cycle(opts[:id])
                      .determine_parent!(opts)
                      .build

  put(query)
end

#test_cycle(opts = {}) ⇒ Object

GET ‘/projects/:project/test-cycles/:id’



7
8
9
10
11
12
13
14
# File 'lib/qtest/rest/test_cycle.rb', line 7

def test_cycle(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_cycle(opts[:id])
                      .build

  get(query)
end

#test_cycles(opts = {}) ⇒ Object

GET ‘/projects/:project/test-cycles’



17
18
19
20
21
22
23
24
25
# File 'lib/qtest/rest/test_cycle.rb', line 17

def test_cycles(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_cycles
                      .determine_parent!(opts)
                      .build

  get(query)
end

#update_test_cycle(opts = {}) ⇒ Object

PUT ‘/projects/:project/test-cycles/:id’



52
53
54
55
56
57
58
59
60
61
# File 'lib/qtest/rest/test_cycle.rb', line 52

def update_test_cycle(opts = {})
  query = QueryBuilder.new
                      .options(:json)
                      .project(opts[:project])
                      .test_cycle(opts[:id])
                      .data(opts[:attributes])
                      .build

  put(query)
end