如何根据当前报告节点获取运行结果状态? [英] How can I get the run result status according to the current report node?

查看:76
本文介绍了如何根据当前报告节点获取运行结果状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,假设一个测试调用两个动作A和B. A通过调用"Reporter.ReportEvent micFail, ..."执行失败"步骤,而B通过调用"Reporter.ReportEvent micpass, ..."

For example, suppose a test calls two actions, A and B. A performs a "failed" step by calling "Reporter.ReportEvent micFail, ...", and B performs a "passed" step by calling "Reporter.ReportEvent micpass, ..."

Reporter.RunStatus在A中执行了失败的步骤后立即返回micFail.因此,即使在B中,B的状态完全为绿色",也无法在"B"中分辨出来分支,不存在失败"步骤.从此以后,由Reporter.RunStatus报告的测试运行状态为micFail.

Reporter.RunStatus returns micFail as soon as the failed step has been performed in A. So even in B, with B´s status being completely "green", there is no way to tell that in the "B" branch, there is no "failed" step present. The test run status reported by Reporter.RunStatus" is micFail from then on.

那我怎么能 获得当前分支"的运行状态?

So how can I get the current "branch"´s run status?

我认为我正在寻找的是当前或当前父级Reporter节点的颜色(即运行状态).

I think what I am looking for is the color (i.e. the run status) of the current, or current parent´s, Reporter node.

推荐答案

我不认为您可以,因为运行状态"用于完整测试,而不用于单个操作.另外,您可以调用ExitAction方法并将输出存储在变量中,以检查从RunAction方法调用时的Action Run Status.

I dont think you can since Run Status is for the complete test and not for individual action. Alternatively, you can call the ExitAction method and store the output in a variable to check the Action Run Status when called from RunAction method.

这篇关于如何根据当前报告节点获取运行结果状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆