首页 > 解决方案 > 使用 SLIM fitNesse 工具的脚本表

问题描述

如果我尝试使用 FitNesse SLIM 运行 givwenzen 脚本,则会出现错误,即 givwenzen 类没有被拾取。可能是一些类路径错误。

如果有人可以帮助我举一个 givwenzen 的例子,即使加上两个数字。

提前致谢

标签: fitnesseacceptance-testingfitnesse-slim

解决方案


项目https://github.com/weswilliams/GivWenZen有很多例子。这是一个:

1) 从 givwenzen_test.jar 中的示例夹具实际类开始。

2)在 FitNesse 表中,它可能看起来像这样。import 和 start 应该进入 SetUp 或 SuiteSetUp

|import|
|org.givwenzen|

|script|
|start|giv wen zen for slim|

这是你的测试

|script|
| given| a ToDo item is due tomorrow |
| when | the date changes to tomorrow  |
| then | a notification exists indicating the ToDo is due |

3)以下是一个示例步骤类和测试步骤方法===

package bdd.steps;

@DomainSteps
public class ExampleSteps {

  @DomainStep( “a ToDo item is due (.*)” )
  public void createToDoWithDueDateOf(CustomDate date) {
    // do something
  }

  @DomainStep( “the date changes to (.*)” )
  public void theDateIs(CustomDate date) {
    // do something
  }

  @DomainStep( “a notification exists indicating the ToDo is due” )
  public boolean verifyNotificationExistsForDueToDo() {
    // do something
    return false;
  }

}

推荐阅读