Behat-Table-Generator for VSCode
When we are writing Behat-Test-Cases we sometimes have plenty of parameters that need to be tested.
To test those we normally use a Scenario-Outline with Examples:
Scenario Outline: Test the Endpoint with several parameters
Given I request "/search?name=<name>&parent?<parent>&active=<active>" using HTTP GET
... some validation happening here
Examples:
| name | parent | active |
| abc | | |
| abc | xyz | |
| abc | xyz | true |
But those Testcases dont cover all possible combinations. This is why this extension was created. Instead of a Table you can write this:
Examples:
{
"name": [ "abc", "" ],
"parent: [ "xyz", "" ],
"active: [ "true", "false", "" ]
}
Then by selecting the JSON and executing the Command GenerateBehatTable
it will generate a Table with all combinations from your JSON-Object.
| name | parent | active |
| abc | xyz | true |
| abc | xyz | false |
| abc | xyz | |
| abc | | true |
| abc | | false |
| abc | | |
| | xyz | true |
| | xyz | false |
| | xyz | |
| | | true |
| | | false |
| | | |
This Table can then be used for the Behat-Examples.