"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.
Groups and custom steps: validations, actions, wait for, APIs are all reusable by default at Testim. You can, however, change this property at any point, both in the creation or in a later stage.
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.
We made it easy for you to notice that it’s shared.
- 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.
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.
Note: It will not clone inner groups.
If you do not want to allow reuse of a specific step.
- Navigate to "Automate", and then to "SHARED STEPS" tab.
- Select the shared actions you want to unshare.
- Click "Archive" 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.
Updated 3 months ago