如何为运行(黄瓜)验收测试指定单独的Maven目标? [英] How do I specify a separate maven goal for running (Cucumber) acceptance tests?

查看:120
本文介绍了如何为运行(黄瓜)验收测试指定单独的Maven目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我具有以下项目结构:

MyProject
   --src
   --test
      --acceptance
         --step_definitions
         --features
      --unit

我希望能够在Maven中与在测试/单元中声明的单元测试分开运行我的黄瓜测试(处于测试/接受状态),以便可以在不同的CI构建计划中运行等.我正在使用黄瓜-junit,因此每个验收测试的运行者"都用JUnit编写.

I would like to be able to run my cucumber tests (in test/acceptance) separately in Maven from the unit tests declared in test/unit, so that they can be run in different CI build plans etc. I am using cucumber-junit so the 'runners' for each acceptance test are written with JUnit.

这可能吗?

推荐答案

这可能吗?

Is this possible?

是的,有可能.我相信您应该将具有以下条件的验收/集成测试与您的单元分开:

Yes, it is possible. I believe you should separate your unit from the acceptance/integration tests having:

稍稍修改后的文件夹结构,将集成测试文件放置在

Slightly modified folders structure for both of these, placing your integration test files in the standard location of src/it:

MyProject/

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