After do |scenario|
if scenario.status.to_s=="passed"
$passed=$passed+1
elsif scenario.status.to_s=="failed"
$failed=$failed+1
end
$scenario_count=$scenario_count+1
end
@browser.close
end
在出口处就像
at_exit do |scenario|
puts "Execution Report - Total: #{$scenario_count}, passed: #{$passed}, failed: #{$failed}"
end
但是我得到
执行报告-总数:1,已通过:1,失败:无论如何,这里有要获取所有已执行方案的计数,因为我需要在电子邮件中使用它。它仅返回上一个方案的结果。
[我正在计算After after After | scenario |如果scenario.status.to_s ==“已通过” $ passed = $ passed + 1 elsif case.status.to_s ==“未通过” $ failed = $失败+1结束$ ...