This is my first attempt in writing a scenario that has multiple possible outcome. Currently the scenario covered for the happy flow. However the scenario failed due to different status detected. Getting the dynamic value (Pass and Failed) during run time.
Then statement look like this which is happy flow :
Feature: Student exam score
Scenario: Check exam score for 3 students and all students pass
Given there are 3 students sit for examination
And all the student completed then exam
When teacher completed marking the exam paper
Then studentA exam score is Pass
Then studentB exam score is Pass
Then studentC exam score is Pass
The actual execution can lead to this combination of outcome :
1.studentA:Pass , studentB:Pass , studentC:Failed
2.studentA:Pass , studentB:Failed , studentC:Pass
Scenario: Check exam score for 3 students and 2 student pass studentB failed
Given there are 3 students sit for examination
And all the student completed then exam
When teacher completed marking the exam paper
Then studentA exam score is Pass
Then studentB exam score is Failed
Then studentC exam score is Pass
Scenario: Check exam score for 3 students and 2 student pass studentC failed
Given there are 3 students sit for examination
And all the student completed then exam
When teacher completed marking the exam paper
Then studentA exam score is Pass
Then studentB exam score is Pass
Then studentC exam score is Failed
So currently looking for alternatives what is the best to handle this scenario with multiple outcome.