Fitnesse在春季靴子测试

时间:2016-12-27 12:02:49

标签: spring-boot bdd fitnesse

我对Fitnesse来说比较新。我目前要做的是看看Fitnesse的新项目,并尝试研究这是否是我的验收测试的正确工具。

我正在开发的项目本质上是一个微服务项目,我会有多个弹簧启动微服务,理想情况下我希望让我的验收测试在某些情况下直接调用其他控制器(通过休息)直接打电话给春季服务。

我在互联网上做了很多研究,但我无法清楚地确定如何使用Fitnesse实现这一目标。

我使用maven构建我的项目并打算使用jenkins作为CI工具。我可以像springboottest一样使用它,例如黄瓜吗?

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

FitNesse itself is a testing environment, with its own strength and weaknesses like mentioned in some of the comments. Out of the box it does not have any capabilities to test an application. It allows you to write test definitions and execute these. To connect the test definitions to the actual system to be tested (the SUT, system under test) you need some code (called fixtures). These may be written in Java (or some other language supported by FitNesse). These fixtures will interact with the system to be tested, and define the elements your test definitions will be composed of. (This is all similar, from my perspective, as Cucumber and its step definitions)

You can either write your own (custom) fixtures, or use some existing 'plugins' or use fixture libraries that already exist。如果您使用现有的库,您可能需要/需要使用一些基于它们提供的功能的自定义夹具。

运行测试可以在Jenkins环境中完成,可以使用FitNesse中包含的jUnit测试运行器,也可以通过专门的Jenkins插件。这符合您的要求,没问题。

我不知道springboottest,或者任何使用Spring Boot应用程序的专用设备。但是多个fixture文库支持REST服务的测试(例如RestFixtureHSAC's FitNesse fixtures(披露:我已经在该库中编写了很多代码))或者构建在它们之上的Web应用程序。

我使用HSAC's FitNesse fixtures广泛地测试Web应用程序和REST(和SOAP)服务,在Jenkins作业中使用Maven。对我而言,它提供了FitNesse设置的良好基线,使我能够专注于编写测试,而不是测试管道。也许您可以查看documentation of its REST fixture (http test and json http test)download and try the examples其独立邮编'打包看看它是否允许您以适合您(和您的项目)的方式表达您的测试。通过Jenkins运行测试已在项目pom.xml中预先配置,并记录在its README中。