Class: Cucumber::Ast::Scenario

Inherits:
Object
  • Object
show all
Includes:
Testrail::Scenario
Defined in:
lib/cucumber_testrail/reopen_scenario.rb

Instance Method Summary collapse

Methods included from Testrail::Scenario

#ignore_testrail?, included, #is_manual?, #jira, #project, #skip_result?, #sub_section, #suite, #test_result, #testcase, #testrail_status, #testrail_tag, #testrail_test_report, #testrail_testcase, #testrun

Instance Method Details

#steps_as_stringObject

return the steps and as strings ready to write to the testcase



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cucumber_testrail/reopen_scenario.rb', line 8

def steps_as_string
  to_sexp.select{|a| a[0]==:step_invocation}.map do |s|
    if s[4]
      ["#{s[2]}#{s[3]}"]+s[4].select{|e| e.is_a?(Array) && e[0]==:row}.map do |l|
        "| #{l.select{|e| e.is_a?(Array)}.map{|e| e[1]}.join(' | ')} |"
      end
    else  
      "#{s[2]}#{s[3]}"
    end
  end.flatten.join("\n")
end

#tag_lineObject



20
21
22
# File 'lib/cucumber_testrail/reopen_scenario.rb', line 20

def tag_line
  line - 2
end