Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Templating

Ryan Gurnick edited this page Aug 3, 2016 · 1 revision

#Variables

Use

  • 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.

Create

  1. First launch the browser and go to the domain that the behat-gui is on.
  2. Then click on Templating
  3. Then click on Variables
  4. Click on the + Create button
  5. Type the variable name in Key and type the default value into Default Value
  6. If you want to add a value for a specific variable set you need to click the Add Variable Set.
  7. For each of the times you click the button it will allow you to add a new value for a specific set.
  8. Enter the value into Value
  9. Select the set from the Set drop down.
  10. Click on the Create button at the bottom left.
  11. 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).

Create

  1. First launch the browser and go to the domain that the behat-gui is on.
  2. Then click on Templating
  3. Then click on Sets
  4. Click on the + Create button
  5. Type the set name into Name.
  6. Type the description into Description
  7. Click on the Create button at the bottom left.
  8. Thats it.

Clone this wiki locally