We can throw an exception AbandonStoryTestException anywhere in fixture or
Domain Adapter code to stop execution of the current story test. The exception can be constructed with a custom message which will appear in the test result.
throw new AbandonStoryTestException();
throw new AbandonStoryTestException("my message");
If a story test is executing in
Flow Mode, we can also use the
Abandon Story Test Keyword to stop execution.
when input is⇓
story test fixture |
check | plain test | 'sample domain adapter'
'throw abandon'
'other stuff'
'thats not processed' |
throw abandon
Story test abandoned.
|
|
| 'sample domain adapter'
'throw abandon'
'other stuff'
'thats not processed' | then output is |
throw abandon
Story test abandoned.
|
|
when input is⇓
story test fixture |
check | plain test | 'sample domain adapter'
'throw abandon' 'my message'
'other stuff'
'thats not processed' |
throw abandon
my message
| my message |
|
| 'sample domain adapter'
'throw abandon' 'my message'
'other stuff'
'thats not processed' | then output is |
throw abandon
my message
| my message |
|
when input is⇓
story test fixture |
check | plain test | use column with new 'sample domain adapter'
'throw abandon?'
x
y
'other stuff'
'thats not processed' | use | column | with | new | sample domain adapter |
|
| use column with new 'sample domain adapter'
'throw abandon?'
x
y
'other stuff'
'thats not processed' | then output is | use | column | with | new | sample domain adapter |
|