Group Command Management
Create a Group Command
Navigate to Hiring Sample -> Create Position Request CSHS -> Case1 to generate a group command.
-
Enter the project dashboard.
-
Click Create Position Request CSHS in the left-side menu bar.
-
Click Case1
-
Click the Edit button on the right of the suite name.
-
Choose at least two continuous case steps to save as a group command.
-
Click the Save as Group Command button.
-
Fill in the group command name and description in the form.
Note: The scope field has two options, the private option means the command can be used only in the current project, and the public option means the command can be used in other projects. By default, the value is private.
-
Click the Save button.
Then the Group Command and New Group Command you have created will appear in the left-side menu bar, and the case steps you have chosen are folded in the new group command.
-
Click the Exit Edit button.
Notes:
You can also add a group command through the custom command menu.
Add a Group Command
You can add a group command when you want to add some steps that belong to this group command.
-
Click the Edit button on the right of the suite name.
-
Click the button in the operation column of the case step list table where you want to reuse a group command.
-
Fill out the add case step form according to the table below.
Parameter Description Command Reused group command name, in the custom category Assignee Workflow user who helps you finish the process Comment Comment on the command -
Click the Add button.
-
Click the Exit Edit button.
Edit a Group Command
Edit a Group Command Name and Description
-
Click Group Command in the left-side menu bar.
-
Click the button on the right of the group command name.
-
Edit the group command name and group command description.
-
Click the Update button.
Edit Case Steps of a Group Command
-
Click Execute Custom.command_name with parameters {{Parameters}} in the case step list or click the command name in the left-side menu bar.
Delete a Group Command
-
Remove the command from test cases first.
- Enter the case step list of every test case that includes the group command.
- Right-click on the row of the group command, and it shows the context menu.
- Click Delete to delete it.
- Click the Exit Edit button.
-
Click the button on the right of the group command name.
Define Group Parameter
-
Define the group parameter for the group command.
- Click Group Command in the left-side menu bar.
- Click the Parameter button on the top right of the group command page.
- Enter the group parameter key and display name in the group parameter page.
- Click the Add button to add the group parameter.
-
Click the Cancel button to exit.
-
Bind the group parameter for the case step parameter.
- Click the Edit button to edit the case step.
- Choose the parameter value from the select box.
-
Click the Save button to save the parameter.
-
Edit this group command parameter value in the case step. You can see that name is defined in the group parameter and will be acted as the parameter input for the group command.
Add an IF Command to a Group Command
In some scenarios, IDA Users want to execute a group command only when it meets specific conditions. Now, IDA supports adding an IF Command to a group command, and the group command will be executed if the IF Command result is TRUE. The IF Command is a custom JavaScript command. Let’s go through it step by step:
1.Create a custom JavaScript command named ‘Custom Condition’.
Please refer to How to create a custom JavaScript command?
Note: The command will read the value of ‘Hiring manager’ and ‘Number of employees’ on the HTML page. If the value of ‘Hiring manager’ equals ‘Tom’ and the value of ‘Number of employees’ equals 12, then IDA executes the group command named ‘GroupWithCondition’; otherwise, it will skip the group command. The content of the command is as follows:
//TODO Add your JavaScript implementation here
var hiringManagerCoachView = bta.util.getCoachViewByLabel("Hiring manager", null);
var hiringManageValue;
if (hiringManagerCoachView.context.binding) {
hiringManageValue = hiringManagerCoachView.context.binding.get("value");
}
var employeeNumCoachView = bta.util.getCoachViewByLabel("Number of employees", null);
var employeeNumValue;
if (employeeNumCoachView.context.binding) {
employeeNumValue = employeeNumCoachView.context.binding.get("value");
}
//An IF command must return bta.util.setIFCommandResult(flag)
//If the parameter is true, execute the attached group command; else if the parameter is false, skip the attached group command.
var isExecuteGroupCommand = (hiringManageValue == "Tom" && employeeNumValue == 12);
return bta.util.setIFCommandResult(isExecuteGroupCommand);
Here is the sample HTML page:
2.Right-click the group command and click Edit, Users could add an IF Command to a group command from the modal.
Use a Group Command in Other Test Projects within a Team
If a group command is created in a test project with a specific team scope, then this group command can be used in any test projects created by or accessible to a team member.
1.Add the group command in a test project with a specific team scope visibility.
2.In other test projects created by a team member or visible to the team member within a team, the team member can find and use the group command.
See also Team Configuration.