首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >黄瓜钩没在跑。我正在使用io.cucumber.java8

黄瓜钩没在跑。我正在使用io.cucumber.java8
EN

Stack Overflow用户
提问于 2022-01-25 07:38:01
回答 1查看 607关注 0票数 0

我试图在使用Cucumber钩子之前和之后运行所需的步骤,但是hooks类中的方法没有运行。下面是钩子类。

已使用的依赖关系:

6.11.0

代码语言:javascript
复制
  package com.neobank.hooks;

  import com.neobank.core.Driver;
  import io.cucumber.java8.En;

  public class ScenarioHooks implements En {
  public ScenarioHooks() {
    Before(Driver::startAppiumDriver);
    After(Driver::resetApp);
    After(Driver::stopChromeDriver);
    }
  }

胶水路径:

代码语言:javascript
复制
    @RunWith(Cucumber.class)
    @CucumberOptions(
    plugin = {"pretty", "html:target/cucumber.html", 
    "json:target/cucumber.json"},
    features = {"src/test/resources/features"},
    glue = {"com.neobank.steps", "com.neobank.hooks"},
    tags = "@Onboardingtwo"
EN

回答 1

Stack Overflow用户

发布于 2022-02-20 17:59:02

在这里发现了问题。试图从特性文件中单独运行黄瓜场景。如果要执行钩子,那么我们必须使用runner文件来运行。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70844919

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档