Phester variables are managed in contexts. There is one global context, a suite context per suite, and a test (resp setup resp fixture) context per test. Variables are accessed by their name, which is looked up first in the test context,TBD: //update the description below to be only about variable extraction. then the suite context, andThe rest should be discussed in then the global context. context of sessions.//
Variables are referenced inside fixtures and test suites using a special syntax that is available only inside values of a special type identified by the //tempate// tag (TBD: figure out how exactly YAML tags work and how well they are supported by the tools we want to use). The syntax follows the form used in PHP strings: `"some{$xyz}thing"`. This allows the variable's value to be combined with static text, as well as the use of multiple variables.
Variables are used to provide access to the following things:
# access to the environment
#* the --environment <yaml-file> option can be used to load a yaml file into the global context
# access to randomized values
#* A test suite (or fixture) can declare variables for the suite context that are pre-loaded with a fixed prefix and a randomized suffix, see {T219883}.
# access to values extracted from a response (in a previous request of the same test, from requests in the suit's setup, or in a fixture)
#* To extract a variable from a (JSON) response, a value with the //assign//grab// tag is used, see {T219883}.
Note that fixtures can declare some of theirexport variables via their session context once {T227887} is done. To access such a variables for export.e, the name of the context (that is, Such variables have theirthe names prefixed with of the fixture's name and are then copied in) is used as a prefix to the global contextvariable name.