Fitnesse安装比较简单
1.确保机器上已经安装了java环境
2.到Fitnesse的官网上http://fitnesse.org/FitNesseDownload下载fitnesse-standalone.jar
需要注意的是fitnesse对java版本又要求,如果java版本不符合要求启动的时候会报错
3.下载完成后,启动Fitnesse,输入命令java -jar fitnesse-standalone.jar
4.打开浏览器输入http://localhost:80/,即可看见Fitnesse的界面
编写一个小例子测试运行
表格:
!path C:\sandbox\workspace\Automation\bin
!define TEST_SYSTEM {slim}|fixture.Division|
|numerator|denominator|quotient?||10 |2 |5 ||12.6 |3 |4.2 ||100 |4 |33 |源码:
public class Division { private double numerator, denominator;
public void setNumerator(final double numerator) { this.numerator = numerator; }
public void setDenominator(final double denominator) { this.denominator = denominator; }
public double quotient() { return this.numerator / this.denominator; } }
点击Test按钮
测试成功,通过的case显示绿色,不通过的显示红色,不通过的把实际返回值显示出来