By managing your tests with branches, you can get test results at a much earlier stage of development. In other words, when you use branches, you'll be able to test new features as they are being developed, instead of waiting for the final release.
When creating a branch, you "freeze" the state of the tests. Modifying a test in one branch does not affect how the test behaves in other branches.
- As a starting point, each project is composed of a single "master" branch.
- It's a good idea to create a new branch for every branch your team develops (e.g. your git branch), and test each branch independently. Testim can be integrated with GitHub , allowing you to automatically create new branches as they are created in GitHub and automatically merge tests when you merge your code.
- You can switch branches at any time and modify tests within a branch as you like. Modifications in one branch will not affect other branches.
- At a certain point you may want to merge between branches (e.g. merging a feature branch into the Master branch). To perform the merge, follow the instructions in the Merging Branches section. When you merge your (product) code, you should also merge your testing code. After the merge, consider deleting the branch .
You'll probably want to use branches in the following use cases:
- To sync with your development process - Creating branches according to your different development environments makes it easier to manage, track & modify your tests in parallel with the development releases.
- To test a new feature in a "sterile" environment - If the feature may affect other tests, it's a good idea to test it independently. Once everything works fine, then merge it to another branch.
- To test Different stages - If your deployment process goes through several stages (e.g. Canary, Dev, Stable)
Branches are added to a project and will include all the tests that existed in the source branch (e.g. the Master branch). You can add a new branch from any screen (e.g. Test List screen, a specific test, etc.). Any change you make to the tests will be automatically associated with the current branch. Other branches will not be affected. However, the same test data, test configuration and labels apply to all branches. So changing them in one branch will affect all branches.
To add a new branch:
- Click the Create New Branch (fork icon) button in the menu.
- Name your branch.
- Once created, you'll be able to modify your tests in the new branch. This will not affect the tests of the Master branch.
You can switch to another branch or to the master branch.
To switch branch:
- Click on the Branches drop-down menu at the top to see the list of branches and select the desired branch. The date near each branch name indicates when it was last modified.
- You can use the Search function to filter the list of branches.
In case a test does not exist in the target branch, you'll be directed to the tests list - There you'll be able to see all the relevant tests that are associated with the current branch.
After the branch has been merged it is recommended to delete the branch.
To delete a branch:
- Click on the Branches drop-down menu at the top to see the list of branches and hover your mouse on the desired branch.
- Click the Delete icon.
- Click OK to confirm the deletion.
To run on a specific branch, use this parameter in your CLI
In order to run the appropriate test suite for the current development branch, you can either specify the branch name for that build (--branch) or if you are using one of the following: Jenkins, CircleCI or TravisCI, the Testim CLI will automatically run tests for the same branch if the following parameter is used.
- The following attributes are shared between branches, changing them will affect tests across branches: test name, test description, test base URL, test labels , test data and test config.
Updated 3 months ago