02 - Development

This information is related to the development of CWB. Information on how to use CWB to write tests can be found in the section User Documentation.

Locations

Conventions

  • Steps are not inherited in Cucumber Java. This means that all classes with step definitions contain some repetition (like before methods with scenario hookup).
  • Steps have to be written in lowercase only.
  • A new step should be documented in the Language Reference.
  • All features in the actual CWB project have to be able to run and be sucessful. (no examplecode that doesn't function or the scenario has to be tagged with  @ignore tag .)

Sahi fork used by CWB

https://github.com/arne-vandamme/Sahi

Tips & tricks

  • If IntelliJ doesn't recognize a certain step that usually executes fine, the step is probably positioned wrong. Sometimes, IntelliJ links a step to a wrong implementation because its description partially matches.
    • make sure that regular expressions are always sufficiently accurate (usually  true when Cucumber runs correct).
    • make sure that the longest step definition is positioned at the top of the in the Java sourcecode.

 

Avoid the use of scenario.write() to include text in reports. In 1.1.4 there's a bug that makes report generation, based on Json output, fail .

See: https://github.com/masterthought/cucumber-reporting/issues/35

 

Â