Module: QTest::REST::TestCase

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

Instance Method Summary collapse

Methods included from Utils

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

Instance Method Details

#create_test_case(opts = {}) ⇒ Object



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

def create_test_case(opts = {})
  if opts[:attributes]
    opts[:attributes].merge!(parent_id: opts[:module])
  end

  query = QueryBuilder.new
                      .options(:json)
                      .project(opts[:project])
                      .test_cases
                      .data(opts[:attributes])
                      .build

  post(query)
end

#test_case(opts = {}) ⇒ Object



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

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

  get(query)
end

#test_case_version(opts = {}) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/qtest/rest/test_case.rb', line 43

def test_case_version(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_case(opts[:test_case])
                      .with(:versions, opts[:version])
                      .build

  get(query)
end

#test_case_versions(opts = {}) ⇒ Object



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

def test_case_versions(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_case(opts[:test_case])
                      .with(:versions)
                      .build

  get(query)
end

#test_cases(opts = {}) ⇒ Object



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

def test_cases(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_cases
                      .param('parentId', opts[:module])
                      .param('page', opts[:page])
                      .param('expandProps', opts[:expand_properties])
                      .param('expandSteps', opts[:expand_steps])
                      .build

  get(query)
end

#test_step(opts = {}) ⇒ Object



63
64
65
66
67
68
69
70
71
# File 'lib/qtest/rest/test_case.rb', line 63

def test_step(opts = {})
  query = QueryBuilder.new
                      .project(opts[:project])
                      .test_case(opts[:test_case])
                      .with(:test_steps, opts[:id])
                      .build

  get(query)
end