Scenario Lifecycle

Specify uses BDDfy's Reflective API to scan Scenario classes for methods. By default, BDDfy recognises the standard BDD methods, as well as Setup and TearDown. You can read more about them here and you can always customize them if you have your own preferences by creating a new BDDfy MethodNameStepScanner. The method name:

  • Ending with Context is considered as a setup method (not reported).
  • Setup is considered as a setup method (not reported).
  • Starting with Given is considered as a setup method (reported).
  • Starting with AndGiven is considered as a setup method that runs after Context, Setup and Given steps (reported).
  • Starting with When is considered as a transition method (reported).
  • Starting with AndWhen is considered as a transition method that runs after When steps (reported).
  • Starting with Then is considered as an asserting method (reported).
  • Starting with And is considered as an asserting method (reported).
  • Starting with TearDown is considered as a finally method which is run after all the other steps (not reported).