Test Case Message Format
This is advices for creating test message
1 min readNov 4, 2021
Try to use Given-When-Then format to express requirement in test message. For examples:
If there is a condition before
test('User can selects Post if facility has been selected');
- Given: facility has been selected ← condition
- When: none
- Then: user can selects Post
If there is an action before
test('System perfoms a search after user clicks on Proceed');
- Given: none
- When: user clicks on Proceed ← action
- Then: System performs a search
If both action and condition
test('
User can see required error message of Facility
after click Save if Facility not filled
');
- Given: if Facility not filled
- When: after click Save
- Then: User can see required error message of Facility
Just plain requirement
test('User can see available Post to choose in Post Dropdown');
- Given: none
- When: none
- Then: User can see available Post to choose in Post Dropdown
Please note, the order of Given-When-Then is not significant. What we need is readability.