Make sure you are comfortable with the following lessons:
Branching is useful for several situations:
1. Create new tests or make changes to existing tests for new functionality
2. Experiment with tests and get feedback without impacting the master version
3. Run different versions of the same test across different environments
4. Promote tests throughout CI/CD environments
As tests are created, they are saved to the master branch by default. To save tests to a new branch, create a new branch from the trainer.
You can create a new branch directly from the web app and then launch a new test against that branch.
Tip: Determine the naming convention that works best for your team and use it consistently when creating new branches.
As you switch between branches in the trainer, you’ll be prompted to save, discard, or move your changes.
To run a branched test:
1. Navigate to the test
2. Choose the branch name from the dropdown
3. Click Run Test
To run a plan on a branch:
1. Navigate to the Plan
2. Click Run on Branch and choose the branch you want to run against
3. Click Run Now
Note: if a test within the plan does not have a version on the selected branch, it will run the master version of the test.
When you are ready to merge a branch:
1. Navigate to the branch under the Tests --> Branches Page
2. Click to Merge the appropriate branch
Merging a branch will merge any test changes or new tests to the master branch.
1. Any changes made to the master branch after a branch was created will be overwritten as branches are merged.
2. Be sure to communicate with your team as any Flows are updated on a branch as those updates will sync across all tests in master once merged. (Unfamiliar with Flows? Check out the Flows lesson!)
4. You cannot pick and choose what to merge, all tests and flows will be merged together.
5. There is no branch approval process, anyone can merge branches at any time.
Branching is a very useful way to better control your test versions and allow you to make necessary changes without impacting the master version of your test.
Bonus: Branches can be created and run against directly from the mabl CLI!