Status: Accepted
Owner: ----
Labels: Type-Enhancement Priority-High Target-2.5

New issue 500 by pekka.klarck: Possibility to specify 'Default keyword' (or 'Scenario') to ease data-driven testing
http://code.google.com/p/robotframework/issues/detail?id=500

There are currently two major annoyances when creating data-driven tests:
1) All tests must repeat the same keyword which causes duplication and noise.
2) To make sure all variations are executed even when there are failures,
you need to have as many tests a variations. This can mess up statistics.

This means we end up with test cases like this:

| *** Test Cases ***                     |
| Adding 1 | Add two numbers | 1 | 1 | 2 |
| Adding 2 | Add two numbers | 2 | 3 | 5 |
| Adding 3 | Add two numbers | 5 | 4 | 9 |

A pretty simple way to reduce duplication would be specifying the keyword
to use by all the test cases in the Setting table. The name of the setting
could be e.g. 'Workflow' or 'Scenario', and the example below uses the former:

| *** Settings ***           |
| Workflow | Add two numbers |

| *** Test Cases ***   |
| Adding 1 | 1 | 1 | 2 |
| Adding 2 | 2 | 3 | 5 |
| Adding 3 | 5 | 4 | 9 |

We could also make it possible to have multiple data variations in one test
case:

| *** Settings ***           |
| Workflow | Add two numbers |

| *** Test Cases *** |
| Adding | 1 | 1 | 2 |
|        | 2 | 3 | 5 |
|        | 5 | 4 | 9 |

In this mode all the variations should be executed even if one of them
fails. This ought to be pretty easy to implement when issue 137 is done.

Similarly as with other test case specific settings, it should be possible
to override the value set in the Setting table also in the test case level:

| *** Test Cases ***                         |
| Add three | [Workflow] | Add three numbers |
|   | 1 | 1 | 1 | 3 |
|   | 1 | 2 | 3 | 6 |
|   | 2 | 3 | 4 | 9 |
| Add four  | [Workflow] | Add four numbers  |
|   | 1 | 1 | 1 | 1 | 4  |
|   | 1 | 2 | 3 | 4 | 10 |
|   | 2 | 3 | 4 | 5 | 14 |


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to