-
Notifications
You must be signed in to change notification settings - Fork 2
Templating
#Variables
-
What are variables? Variables are a way that we made the behat testing framework more durable. Using behat in multiple environments would take a lot of editing features and tests. Instead, we built a variable system so that each user can define their own variables to run in their website. Variables are meant to allow multiple users to use the same tests, including different versions of the same application in different environments.
-
Why use variables? Variables allow you to define multiple values for the same variable in the test. Generally, variables look like
[var]and the behat-gui will allow you to define many variables. When you execute a test file, it takes that template and puts in all of the variables as actual text. It then, replaces the[var]with the actual value. It's meant as a time saving feature, as well as a feature to make the behat framework more durable.
- First launch the browser and go to the domain that the behat-gui is on.
- Then click on
Templating - Then click on
Variables - Click on the
+ Createbutton - Type the variable name in
Keyand type the default value intoDefault Value - If you want to add a value for a specific variable set you need to click the
Add Variable Set. - For each of the times you click the button it will allow you to add a new value for a specific set.
- Enter the value into
Value - Select the set from the
Setdrop down. - Click on the
Createbutton at the bottom left. - Thats it
#Set ##Use
- What are variable sets.
The main purpose of variable sets are to separate different values for multiple users but keep the same variable key (the string in between the
[]'s).
- First launch the browser and go to the domain that the behat-gui is on.
- Then click on
Templating - Then click on
Sets - Click on the
+ Createbutton - Type the set name into
Name. - Type the description into
Description - Click on the
Createbutton at the bottom left. - Thats it.