Module: Magnesium::TestStep

Included in:
Testcase
Defined in:
lib/magnesium/factor/test_step.rb

Instance Method Summary collapse

Instance Method Details

#generate_step(prefix, caseno) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/magnesium/factor/test_step.rb', line 9

def generate_step(prefix,caseno)
  begin
    @tc_id = TestLink.find_tcase(prefix,caseno)
    @tv_id = TestLink.find_version(@tc_id)

    @teststep = Hash.new

    result = TestLink.find_step_action(@tv_id)
    result.each do |row|
      row.map do |k,v|

        step = v.split(/\<p\>\r\n\t/)[1].split(/\<\/p\>/)[0].split(/:/)
        @teststep[step[0]] = step[1]
      end
    end
    return @teststep
  rescue
    error
  #ensure
  end
end