怎么用C#获取Scenario step在specflow里

时间:2023-03-09 00:26:26
怎么用C#获取Scenario step在specflow里

公司最近在用specflow 这种BDD的模式,但PM还是想把case再存进TestManager里面一份儿一遍后期集成TestManager 自动runcase用。所以我们需要获取每个scenario step然后添加进TestManager里面,要死的是要用C#实现,博主查看了很多资料,没有可以获取scenario step的方法,请各位帮帮忙。

比如这种:

Scenario Outline: DataDriven

Given I have entered  <UserName> with valid into username textbox

And I have entered  <Password> with valid into password textbox

When I press login button

Then It should be logined

我可能要获取given and when then 后面的内容作为testcase的step 存进TestManager里面,但目前没看到有这样的方法。是不是可以根据TestResult生成原理来获取一下试试,求高手指教。