How to share tests with your team
Not testing alone? No problem! Here we show how you can version your tests and share team within your team.
Why should we share tests within the team?
If you work together with a group of people, sharing your tests can have multiple benefits. Some examples:
- You are a developer and you want to make your tests available to your QA members.
- You work together in a bigger QA team, and you want to create a test setup collaboratively.
- You want to have the whole team on the same page about the current state of the app.
How to share tests within the team?
Repeato keeps all its test-related files in a so-called "workspace". A workspace is a basic file directory that holds all your test files and test result data.
The easiest way to get your tests synced to other teammates (or to your Continuous Integration server) is to start versioning your workspace directory with git. We recommend using SourceTree as a git client since it's really intuitive to use.
How to start versioning test automation files?
- Create a new git repository onlin. A repository is a place in the cloud, where your workspace directory will be uploaded. Here is how you can create a repository on github.
- Download the Sourcetree git client
- Start Sourcetree, then click "File/New/Clone from URL"
- Paste the URL of your GitHub repository. For "Destination Path" choose a folder where you want your test workspace to be.
- Click "Clone"
- Open Repeato and click "File/Open workspace"
- Choose the directory you just "cloned" (=downloaded) from GitHub via Sourcetree
Now all the changes you apply to the repository (add tests, rename tests, etc...) can be saved as a new version in your git repository:
- After adding or changing some tests with Repeato, open Sourcetree again. You will see that there is a new row in the history table called "Uncommitted changes" (1)
- Below there is a list with "Unstaged files". You can click the check box next to the "Unstaged files" label, to "stage" all changed files.
- Click "Commit", enter some version information (like "Added new login test for MyCalendar app")
- Click "Push" to upload all files to GitHub.
How to get the changed tests from your teammates
To get changes that have been created somewhere else (on a workstation of your coworker), we just need to "pull" (=download) the changes from GitHub. Just click the "Pull" button in Sourcetree and all the changes will be downloaded to your workspace directory.
If Repeato is opened, it will be observing the workspace directory, and it will instantly refresh to reflect the changes.
Why do we use git for syncing and versioning files?
Using git gives us some powerful possibilities when working with tests:
- Versioning support: Let's say you want to check if an older version of your app had some problem with a certain test. No problem: Versioning allows you to always go back to one of the previous versions of your testing setup
- Git provides us with many useful features such as branches and it runs on every OS
- Git can easily be integrated into your build and testing CI (Continuous Integration) workflow
- Git is the defacto standard for versioning files and for working on files in a team
- Git allows you to version your test within the same repository as your source code. So when you check out old code, you get the right version of tests automatically.
Which test files should not be synced?
Besides the files needed to run and edit your tests, a Repeato workspace also contains a backup directory. This directory is excluded by default via .gitignore file inside the workspace directory. So you are all set and don't need to care about further configuration.
However, you might also decide not to version other directories like the test run data. You can read more on how to exclude files from git here.
How to transfer testing files to your continuous testing server?
There is obviously also a way to automate pulling your changed tests before running them as part of your CI flow. Here is what you would need to do in case you want to update the files manually:
- Just commit your tests (see above) and push the changes to the online git repository
- Log in to your continuous testing server via terminal
- Clone or pull the changes from your online git repository