Git Integration

Applies to ReadyAPI 3.56, last modified on October 29, 2024

About

It is considered a good practice to store tests and test projects in source control. This way, you can easily work on your tests along with your teammates, share your test cases, revert changes, and so on.

ReadyAPI includes built-in support for Git repositories. This allows you to put your test project files to and get them from a Git repository directly from within the ReadyAPI UI, without using any third-party tool.

Supported repositories

ReadyAPI supports Git repositories located in repository-hosting systems like GitHub, GitLab or Bitbucket, as well as Git repositories that reside on servers in your local network.

Manage Git accounts

To work with most Git providers, you need an account. ReadyAPI provides an account manager for Git accounts: you can add your Git account in ReadyAPI and then use it in any of your projects.

To open the Git account manager, click Preferences and select the Git tab. This will open the Git preferences page where you can add and edit Git accounts:

Git integration: Access Git accounts via Preferences

Click the image to enlarge it.

To add an account, select Connect (or Add Account, if you already have an account of that type):

Add a Git account

Click the image to enlarge it.

GitHub

GitHub Enterprise

Git

Bitbucket Cloud

Bitbucket Data Center / Server

GitLab

GitLab Enterprise

If you already have a Git account added to ReadyAPI, but you want to edit it, click Edit Account:

Edit Git profile

Click the image to enlarge it.

To test if your account can connect to the server or repository, select Test Connection.

Note: The connection test will always be successful for public Git repositories because you can always connect to them, even without credentials. However, you will not be able to perform some actions like push if you are not authorized.

Connect a project to a Git repository

To work with your project in Git, you should first connect it to a Git repository. To do that:

  1. Double-click the project in the Navigator panel to open the project editor, and click the Configure Git button in the editor toolbar:

    Show image

    — or —

    Click on the main toolbar and select Connect to Remote Repository:

    Show image

  2. To work with Git in ReadyAPI, you should convert your project into a composite project. These projects store test cases and other data as separate files instead of a single XML file. Click Continue to do that:

    Connect project with a Git repository: Convert the project into a compsoite one
  3. If your project was not saved, ReadyAPI shows the Save project dialog. Select the location where you want to save the project, enter the project name and click Save.

  4. In the Choose Account dialog, select an account you will use to connect to a repository or add a new one if you haven't configured any Git accounts yet.

    Alternatively, if you just want to initialize a local Git repo that doesn't require credentials, select Create in the New Local Repo section. This will initialize a repo in the project folder.

    Connect project with a Git repository: Select an account

    Click the image to enlarge it.

  5. For GitHub, Bitbucket and GitLab accounts: select the repository you want to connect to. You can search for it in the list or input the URL and click Select.

    Tip: To see details about a repo, click .
    Connect project with a Git repository: Select the repository

    Click the image to enlarge it.

    For Git accounts: enter the URL of the repository and click Select:

    Connect project with a Git repository: Enter the URL of the repository

Now, your project is connected to the Git repository, and you can commit and push your changes.

Best practices

We recommend that you enable the following two ReadyAPI settings:

This will make your ReadyAPI project files friendlier to the “auto-merge” feature of Git. To learn more, see Merging changes.

Clone a project from a Git repository

ReadyAPI provides an easy way to clone a ReadyAPI project stored in a remote Git repository and import it into ReadyAPI. To do that:

  1. Select File > Clone Project from Git from the main menu:

    Clone project from Git: Clone Project in main menu
  2. In the Choose Account dialog, select an account you will use to connect to a repository or add a new one if you haven't configured any Git accounts yet.

    Alternatively, if you just want to import a local Git repo that doesn't require credentials, select Import in the Import a local repo section and select the repo folder.

    Clone project from Git: Select an account

    Click the image to enlarge it.

  3. For GitHub, Bitbucket and GitLab accounts: select the repository you want to clone. You can search for it in the list or input the URL and click Select.

    Tip: To see details about a repo, click .
    Clone project from Git: Select the repository

    Click the image to enlarge it.

    For Git accounts: enter the URL of the repository and click Select:

    Clone project from Git: Enter the URL of the repository

Now, you can work with the cloned project and commit and push your changes to the remote repository.

Note: ReadyAPI automatically adjusts the settings.xml (or any auto-updated file) based on factors like version changes. For example, if a project created on 3.49 is cloned to 3.50, ReadyAPI detects and switches the settings accordingly, altering the settings.xml file. However, subsequent commits won't trigger this behavior unless the project is pulled onto a different machine with a different ReadyAPI version. To address this behaviour, refer to Troubleshooting

To disconnect a project from the Git repository:

  1. Click on the main toolbar.

  2. Click and select Disconnect Account:

    Git panel: Disconnect account

    Click the image to enlarge it.

Note: The local repository in your project folder will remain, and you will be able to reconnect anytime.

How it works

ReadyAPI offers a number of commands to perform typical operations on the project files. You can perform them from the Git panel or from the main menu or context menu:

Git panel

Click the image to enlarge it.

Git integration items in the main menu

Click the image to enlarge it.

Git integration items in the context menu

Click the image to enlarge it.

Once your project is in the repository, you use the Git panel or menu commands to work with it. For more information, see the following topics:

In case of an error ...

See Also

Integrations
Teamwork

Highlight search results