Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Merge / Refactor multiple steps

In order to keep your Automated Steps Library clean and sane, you'll need to do refactoring quite often

It may happen that you have redundant, similar steps. Thus, you may merge those steps and avoid duplicated specification & related code.


Info
titlePlease note

Upon a steps merge operation, all Tests and Preconditions using it are updated accordingly.

Only non-readonly Tests/Preconditions that the user is allowed to edit are updated; the other ones will remain as-is, leading to the simultaneous existence of original steps along with the merged one in the library, in this case.

A merge operation may require some manual reviewing on the destination affected Tests/Preconditions.


Example: two steps are merged to one having the content: "Given I have a turned on calculator"


Original Test/Precondition contentUpdated Test/Precondition content
Given I have a calculator

Given I have a turned on calculator

Given I have a turned on calculator

And the calculator is turned on


As you can see from this example, in which the original Test/Precondition contains the original steps, the merge operation does not remove duplicated steps in the destination Cucumber Scenario/Background.

Thus, a manual process should be done on the affected issues in order to review the specification and remove the steps where desired.

...

To merge similar redundant steps, select t the content of an existing step (i.e. refactor it):

Step 1: Select the steps (see Actions above for information on multi-selection).

Image Added

Step 2: Use the context action "Merge".

Image Added

Step 3: Edit the merged step content on the right side; on the left side you can see the temporary merged step until you save it.

Image Added


Step 34: Click on Save.

Image Added

Find Tests and Preconditions using a step

...

Step 2: Click on the number shown below the step content box.

Image Added

Step 3: The issues search will show all related issues.

Image Added

Update / Refactor a step

The step content can be updated (i.e. renaming the step) directly in the Automated Steps Library for easy refactoring; all updatable Tests/Preconditions will be updated accordingly.

...

Step 3: Click on Save.

Add Label

Label your steps so you can easily group similar steps and find them afterwards whenever you need them. Since steps may be related with different things simultaneously, you may add more than one label.

To add a label to an existing step:

...