loadVariables
The loadVariables action loads environment variables from a specified .env file. This action is useful for accessing sensitive information, such as API keys or other credentials, without hardcoding them into your tests. Variables loaded this way are available for use in subsequent steps within the same test.
You can also load globally applicable variables using the
loadVariablesproperty in the configuration file. This makes them available across all tests.For comprehensive options, see the
loadVariablesreference.
Example
Assuming a file named secrets.env exists in the same directory as the test file or at the specified path:
secrets.env
You can load these variables using the loadVariables action: