gpt4 book ai didi

java - 我如何将 setCapability testName 设置为 cucumber 场景

转载 作者:行者123 更新时间:2023-12-02 09:19:03 24 4
gpt4 key购买 nike

如何将 cucumber 场景设置为 setCapability 中的 testName

  DesiredCapabilities dc = new DesiredCapabilities();

@BeforeMethod
public void setUp() throws IOException, InterruptedException {

dc.setCapability("reportDirectory", reportDirectory);
dc.setCapability("reportFormat", reportFormat);
dc.setCapability("testName",cucumberScenario());}

我已经尝试过scenario.getName()和scenario.getSourceTagName;但总是得到 null 值

最佳答案

在方法参数中添加Scenario场景

试试这个

DesiredCapabilities dc = new DesiredCapabilities(); 

@BeforeMethod
public void setUp(Scenario scenario) throws IOException, InterruptedException {
dc.setCapability("reportDirectory", reportDirectory);
dc.setCapability("reportFormat", reportFormat);
dc.setCapability("testName",scenario.getName());}

关于java - 我如何将 setCapability testName 设置为 cucumber 场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58815614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com