holunda-io / camunda-bpm-jgiven

Camunda specific stages and scenarios for the BDD testing tool JGiven.
Apache License 2.0
11 stars 1 forks source link

support scenario-style testing #274

Open jangalinski opened 3 months ago

jangalinski commented 3 months ago

Use Case: I have a process that is basically a straight-through process, each task is async but there are no real wait-states like intermediate-events, timers or user-task. So the majority of my jgiven tests reads:

.job_is_executed("foo")
.and()
.job_is_executed("bar")
...

each service tasks just does a simple data retrieval based on data I mocked beforehand.

Idea:

As an alternative to the imperative testing style we use in camunda-bpm-jgiven todaym where we manually move the token through the process to evaluate each step, we should support a scenario based approach.

I want to write

given().assumeOnWaitstate("foo","Lookup im Backend, liefert variable", stage -> stage.job_is_executed("foo"));

when().processRunsTilEnd(...)

then().has_passed("startEvent,"foo","endEvent")

Implementation

jangalinski commented 3 months ago

Additional ideas: we could make "until end" a predicate and thus also do stuf like stepA-stepB-runUntilStepE-stepF