Including tests with variable replacements
It is possible to include a test case into another test replacing some variables with values. The variables must be surrounded by $ signs to be recognized as such.
Example you have a test case TC-15 login to system
Step | Expected |
---|---|
Browse to site **** | Login form is shown |
Enter user $user$ | OK button becomes active |
Click Ok | Password field is shown |
Enter password $password$ | Login button becomes active |
Now you can include this test case into another test: TC-300 login test, e.g. like this
Step | Expected |
---|---|
include:TC-15?user=readonly&password=ro | Logged in as read only user |
do something | |
include:TC-15?user=readwrite&password=rw | Logged in as read write user |
When creating the XTC from TC-300 you will get XTC-1333 login test
Step | Expected | Actual | Passed/Failed |
---|---|---|---|
Browse to site **** | Login form is shown | ||
Enter user readonly | OK button becomes active | ||
Click Ok | Password field is shown | ||
Enter password ro | Login button becomes active | ||
do something | |||
Browse to site **** | Login form is shown | ||
Enter user readwrite | OK button becomes active | ||
Click Ok | Password field is shown | ||
Enter password rw | Login button becomes active |