If you are moving forward for automation approach, applying BDD with “Scenario Outline” feature to your case, it can be fit in one readable scenario.

Scenario Outline: Bill payment after due date
    Given <operator> bill, due date is <dueDate>
     When payment is made today
     Then payment is <result>
Examples: 
    | operator | dueDate   | result   |
    |    A     | yesterday | rejected |
    |    B     | yesterday | accepted |
    |    C     | yesterday | rejected |

While step definitions of these keywords requires parameters:

Given("""^(A|B|C) bill due date is (yesterday|today|tomorrow)$""") { (operator: String, dueDate: String) =>
    // Set a context, which operator to  and when is the due date.
}

When("""^payment is made today$""") { 
    // Execute payment action as of today.
}

Then("""^payment is (rejected|accepted)""") { (result: String) =>
    // Assert the actual payment result whether payment is rejected or accepted.
}

This is how BDD Scenario Outline works and if you have good parameterized step definitions, you can re-use it to create many more test for a payment with a concern of due date. For example:

Scenario Outline: Bill payment on due date
    Given <operator> bill, due date is <dueDate>
     When payment is made today
     Then payment is <result>
Examples: 
    | operator | dueDate | result   |
    |    A     | today   | accepted |
    |    B     | today   | accepted |
    |    C     | today   | accepted |

Hope it helps.



Source link https://sqa.stackexchange.com/questions/29486/how-to--test-cases-when-different-test--gives-different-

LEAVE A REPLY

Please enter your comment!
Please enter your name here