【发布时间】:2026-02-01 19:30:02
【问题描述】:
我正在计算After do中的场景
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,失败:
反正有没有得到所有已执行场景的计数,因为我需要在电子邮件中使用它。它只返回最后一个场景的结果。
【问题讨论】: