Git Integration

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 upload your test project files to and retrieve 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.png 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

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

Add a Git account

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

Edit Git profile

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:

    Teamwork in ReadyAPI: Enable integration with Git

    — or —

    Click git-toolbar.png on the main toolbar and select Connect to Remote Repository:

    Git panel: Connect to a remote repository
  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
  5. For GitHub, Bitbucket, and GitLab accounts, select the repository to which you want to connect. You can search for it in the list or input the URL and click Select.

    Tip

    To see details about a repo, click git-expand.png.

    Connect project with a Git repository: Select the repository

    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

Structuring ReadyAPI Projects for Git

When using Git for version control, each ReadyAPI project should have its own Git repository. To support Git adoption, ReadyAPI projects transition from a single monolithic project file to a composite project structure. This approach improves modularity and maintainability, making it easier for teams to collaborate.

If you have a repo containing multiple ReadyAPI/SoapUI project files and want to adopt Git, consider one of the following approaches:

  • Single Git Repository: Merge all projects into one, convert it into a composite project, and initialize a Git repository. This results in a single Git repo.

  • Multiple Git Repositories: Create a separate Git repository for each project, convert each project to a composite format, and maintain them independently.

Choose the approach that best aligns with your application's architecture and team structure.

Optimizing ReadyAPI Project Files for Git

Once your ReadyAPI project is structured appropriately in Git, we recommend enabling the following settings to improve Git compatibility:

These settings make your ReadyAPI project files more compatible with Git’s auto-merge feature, reducing conflicts when merging changes. 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
  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 git-expand.png.

    Connect project with a Git repository: Select the repository

    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, 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.

Please refer to the Required Settings in ReadyAPI to Optimize Git Integration section to learn more about setting up Git integration correctly for optimal use.

You can also learn more about this behaviour in Troubleshooting.

Disconnect a project from the Git repository

To disconnect a project from the Git repository:

  1. Click git-toolbar.png on the main toolbar.

  2. Click git-sandwich-button.png and select Disconnect Account:

    Git panel: Disconnect account

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:

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:

go.gifCommit Changes to Git Repository

go.gifDiscarding Changes

go.gifPushing Changes to Git Repository

go.gifPulling Changes From Git Repository

go.gifSwitching Branches

go.gifViewing Commit History

go.gifViewing Remote Changes

go.gifViewing and Creating Tags

go.gifGit Console

Required Settings in ReadyAPI to Optimize Git Integration

When collaborating on an API in ReadyAPI with multiple QA engineers, you need to:

Review the configurations outlined in the linked pages. They are essential for optimizing your experience with Git, particularly when merging changes. To enable merging your changes automatically, ensure you configure the required settings.

Refer to the ReadyAPI Settings for Effective Git Collaboration section for proper setup and tips to avoid conflicts.

In case of an error ...

See Troubleshooting.

See Also

Publication date: