An action word is basically a sequence of steps that can be reused across multiple scenarios. It defines the Domain Specific Language (DSL) of the project. This ubiquitous language forms a common language shared by the team members for describing acceptance tests.
Defining a common language with action words and building your scenarios based on them has several key advantages:
It makes the scenarios understandable by all the project stakeholders (product team, devs, testers).
It accelerates test authoring as well as maintenance and enable refactoring.
It facilitates automation as the scenarios based on action words can be transformed automatically into scripts for various test automation frameworks.
An action word is defined by different data:
Name: the name of an action word is unique within a given project.
Description: field text used to add a description. See Description formatting section.
Tags: you can add tags to an action word. The search feature can be used to search for action words based on tags.
Parameters: you can add parameters to an action word and use them in the steps.
Definition: you can add steps to your action words.
Used by: list of scenarios and action words that contain the current action word.
|Note:||The action word page uses the same step editor as the scenario, so it works exactly the same way for both of them.|
You can add as many parameters as you want to an action word. The name of a parameter should not contain any special character or space. A default value can be assigned to a parameter.
You can call an action word with the parameter value as argument by using
You can also include a parameter in an action/result step by using the following syntax:
When you call an action word with parameters, a value should be assigned. If you don’t specify it, the default value is applied, but it is possible to rename it afterwards.
In the Action words page, you can add some parameters to your action word.
When you call this action word in a scenario, it will appear as follows:
You can also use a datatable parameter as an action word parameter value using the syntax
=columnName, you should obtain:
|Note:||The step of an action word can be another action word. It means that you can build action word of action word and thus define several layers to your Domain Specific Language (system, application, feature, automation keyword…).|
You can apply the following actions to an action word:
Inline: to replace the action word by its content (the steps) in every place where this action word is called. See inline in the refactoring section.
Delete: to delete the action word. Be carefull, you will not be able to restore it and all the objects (scenarios and action words) using this action word will be in error.