Default ContextsQ7, 16.05.2013 by Anastasia Ahramenko View Comments
It’s good practice to make test case to be focused on testing functionality itself and all operations for preparing application should be moved out from test case to some place. In case of Q7 the contexts is the right place for these purposes. Q7 contexts are applied to application before test case execution. In eclipse there are several groups of standard mutable configurations/states: preferences, workspace, workbench. In the process of using Q7 to create test projects, we came to the conclusion that some contexts should be executed before each test cases. For example, when testing JDT before each test should be cleared Workspace and Working Set, and terminated all active launches. Initially for these purpose Group Context is used, this context should be added to each test case in Q7 project. But this practice was uncomfortable, because at the addition of a new test case, it was necessary not to forget to add the Default Group Context. Since version 1.3 of Q7 introduced the concept of the Default Contexts list. At the creation new Q7 Project the “Project Settings” file is created automatically: Description of project can be given in “Description” section of the “Project Settings”. Default Contexts can be set in “Default Contexts” section. Contexts to default contexts list can be added from this Q7 project and also from related Q7 projects. These default contexts are displayed in test cases. Sequence contexts defined in the Default Contexts list can not be changed in the test case and custom contexts can be added to test case only after default contexts. “Project Settings” can be opened from test case by clicking on “Configure Project Default Contexts” link. At the replaying test case the default contexts are displayed in “Execution View”. Custom contexts are executed after default contexts execution. More information about the creation and application of Q7 contexts you can get from the Q7 demos - http://q7.xored.com/demos.