"Reuse" is one of the more basic principles of programming. Instead of copy-pasting the same twenty lines of code over and over, you write them once inside a method and call it whenever you need to. This principle works precisely the same in the world of automated testing.
For every (potential shared) step that you create, Testim will prompt you for a (meaningful) name, and whether you would like to make this step shareable or not. By default, it is shared.
How to know if it's reused
We made it easy for you to notice that it’s shared.
How to reuse
- Double check, and make sure your shared step have a meaningful name.
- Choose the location, by hovering over one of the arrows (which turn into a plus), and then click on the plus menu.
- Search for the aforementioned shared step in the search box
- Select the step by clicking on it
- If your step expects you to pass parameters, don't forget to assign them. Each step passes its own parameters e.g. you could call the "login" with "David" as params at one test, and with "John" at another.
How to change only one instance of a group
Changing the shared step in one place will change it in all instances of the project. Although you can send different parameters, sometimes you need to make changes only for a specific test. For this purpose, you will want to clone the step
- Click "Replace with a clone"
- Give the new step a new name.
- Decide whether the new step will also be defined as shared.
If you do not want to allow reuse of a specific step.
- Navigate to "Automate", and then to "Actions" tab.
- Select the shared actions you want to unshare.
- Click "delete" icon.
Note: It will not actually remove the steps from tests that use it. This will only remove it from the list of shareable components.