Use action words

Definition

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.

Take a look at this short video: introduction to actionword


Key Benefits

Defining a common language with action words and building your scenarios based on them as 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 facilitate automation as the scenarios based on action words can be transformed automatically into scripts for various test automation frameworks.

Action Word page

Voila_Capture 2015-08-07_10-10-35_AM

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 used them in the steps.
  • Used by: list of scenarios and action words that contain the current action word. AW_usedby

Note: the action word page uses the same step editor as the scenario, so it works exactly the same way for both of them.

Parameters

You can add as many parameters as you want to an action word. Name of a parameter should not contain any special character or space. A default value can be assigned to a parameter.

To include a parameter in a step (being an action or result), use the following syntax: ${param_name}. For example if you have UserName as parameter of your action word, you can write the following step: login with ${UserName} to the application.

Calling an Action Word in a step

When calling an action word in the step editor, make sure this action word exists otherwise it will generate an error.

When calling an action word in a step, each of its parameters should have a value assigned. Either the parameter has a default value (defined in the action word) or you will have to assign a value in the step editor. Otherwise the scenario will be in error and will not generate any test.

AW_call

If you want to assign a parameter instead of a value to your action word parameter, use syntax =. For example if you have defined myCurrentBook as parameter of your scenario and you want to call Select book action word with myCurrentBook as input parameter of Title, do it this way:

AW_assignparam

Note: a 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…).

Other actions available on an Action Word

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 refacting section.
  • Delete: to delete the action word. Be carefull, you will not be able to restore it and all the objects (scenarios & action words) using this action word will be in error.

Advertisements