proophboard / cody-engine

Event Modeling meets prototyping
https://wiki.prooph-board.com/cody_engine/introduction.html
MIT License
10 stars 6 forks source link

45 add hooks for tests #46

Open bofalke opened 1 year ago

bofalke commented 1 year ago

Ref #39 #45

bofalke commented 1 year ago

Test generation is working now in a very prototype style of way.

ToDos:

kaitorched commented 1 year ago

Some notes from our call:

bofalke commented 7 months ago

I started refactoring the step definitions. Step definitions should be per aggregate and not per feature. This will make steps "reusable" throughout different scenarios regarding the same aggregate.

For example to test if a car was completed or not after an update we would have two test scenarios that are identical until the then step and just the input data per scenario is different. To achieve this i want to check the decoraters of the aggregate Step definition and see if a new definition is required or if it already exists.

Payloads will be written per Feature into the new folder features/payloads/FEATURENAMEFeature.json. They are read dynamically in the setup function of the Step Definition to keep them reusable.

Example to make it more clear:

Feature: Update Car Without Production Year
  Scenario: Update Car Without Production Year
    Given Incomplete Car was added
    When Car is updated without production year
    Then car should be updated

To test that an update with production year would have a different outcome we still want the same starting point.

Feature: Update Car With Production Year
  Scenario: Update Car With Production Year
    Given Incomplete Car was added
    When Car is updated with production year
    Then car should be added to fleet

This will be possible once the refactoring is done. Ideally both scenarios are actually in the Update Car Feature, so maybe i will have a look if that is possible as well.