Skip Constraints
Skip constraints are a new feature. They are only available under the ‘Advanced Mode’. Skip constraints allow for certain parameters to be excluded from test cases when it is not appropriate for them to appear.
How to Use Skip Constraints
For example, let’s use this model below for a flight booking system:
First, navigate to Rules -> Constraints. Next, click this toggle to change to Advanced Mode – that is the only way to implement skip constraints:
Once in Advanced Mode, we use the following syntax for skip constraints:
Parameter[Parameter Value] >> Parameter to be skipped
So for our example, the syntax is this:
Note: As many parameter values as you want can be included in a constraint in that way.
Now when we generate Scenarios, tests cases with “Ticket Type” as “Business Class” or “Coach” both have no value for “Food Choice”:
First, we need to ensure that these parameters are listed next to each other in the Parameters screen, like so:
Next, we navigate back to the Advanced Mode page, and use the following syntax:
Parameter[Parameter Value] >> First Parameter to be skipped :: Last parameter to be skipped
For our example, that looks like this:
So for our example, since “Food Choice”, “Drink Choice”, and “Checked Bag” are the last three parameters, we could use the syntax below to skip to end:
Parameter[Parameter Value] >> First Parameter to be skipped::!!
For our example, that looks like this:
And now the test cases under Scenarios with “Ticket Type” as “Coach” have no values related to Food Choice, Drink Choice, or Checked Bag.