Environment Tasks view

Use the Environment Tasks view to configure test environments. You can define environment configuration tasks by adding and configuring a limited set of actions. You can then associate these environment tasks with stubs. Doing so ensures that test environments are set up correctly before stubs or scenarios are run, and that environments are closed down properly.

The following high-level tasks are used to configure and run environment tasks:
  1. Create an environment task in the Architecture School perspective.
  2. Add one or more actions to the task.
  3. Associate the task with a stub or scenario in the Test Factory perspective.
  4. Run the stub or test suite.
The environment task editor has the following branches:
  • Prepare Steps (known as Task Steps in the older versions): This branch contains actions that need to be executed before the parent resource is executed.
  • Clean-Up Steps: This branch contains actions that should be executed after the parent resource is executed.

To test the configured tasks immediately in Test Lab, click the Execute button.

The Execution action prompts you to execute the task in one of the following ways:
  • All Steps: Select this option to execute the entire task, that is, execute the prepare steps first and then the clean-up steps.
  • Prepare Steps Only: Select this option to execute the task with only actions defined in the Prepare Steps branch.
  • Clean-Up Steps Only: Select this option to execute the task with only actions defined in the Clean-Up Steps branch.

When using an environment task, a task is added to the parent resource (through stub or scenario properties) and the engine executes appropriate branches of the task at the right times. Hence, any actions defined in the Prepare Steps branch are executed before the parent resource, and those actions under the Clean-Up Steps are executed after the parent resource. When a task contains both prepare steps and clean-up steps, the engine executes them in sequence as appropriate. On executing the clean-up steps of an environment task, a new row is displayed in the Task Monitor the same way as for the prepare steps. The following screen shot shows a sample task execution: