In this lesson, we'll discover how environment variables can dictate the execution of tests. A method annotated with
@EnabledIfEnvironmentVariable will be executed if, at runtime, there is an environment variable with a specific name, and its value matches a regular expression. Conversely,
@DisabledIfEnvironmentVariable will cause its annotated member to be skipped if the environment variable's value matches the regular expression.
@EnabledIfEnvironmentVariableexecutes a test if the environment variable matches a specific regex
@DisabledIfEnvironmentVariabledisables a test if the environment variable matches a specific regex
- If the variable doesn't exist at all,
@DisabledIfEnvironmentVariablemethods are always run