BranchingAndVersioningWithGitHubAndBitbucket

Branching and Versioning with GitHub and Bitbucket

GitHub

Configuration Setup

Navigate to the Integrations page either by clicking on the integrations icon

on the side navbar or by clicking on the icon from the dropdown of the person icon.

Click on the Github icon on the configuration page in the “All” section or “Continuous integration” tab

If there are no existing configurations, a form to create a new configuration will appear.

If there are existing configurations, there will be a list of configurations on the left panel and a detailed view of the configuration on the right.

To edit an existing configuration, click on the pencil once the configuration is selected from the left panel.

Click on the plus icon to create a new configuration.

Required fields in the form are marked the red asterisk:

Optionally, user can click “Get Github Organizations” and select a Github Organization to get an organization’s repositories.

**NOTE Only one Github organization can be selected at a time.**

Below the “Get Github Organization“ button, there is a section for selecting Qyrus projects which should display all the teams, services and projects that the current user is part of.

To create a configuration, the user must select atleast one Qyrus project.

***Keep in mind that a Qyrus project can either be linked to one “Continuous integration” service (Github or BitBucket) and not both ***

User can use the status toggle to make the configuration active/inactive. Inactive configurations cannot be used to link test cases from Github to Qyrus scripts.

A Configuration can be deleted by clicking on the trash icon and then the delete button in the confirmation dialog box. When a configuration is deleted, all the linked scripts of the configuration are also deleted.

Linking Folders from GitHub to Qyrus Test Suites

Navigate to the project a GitHub configuration is linked to. Hover over a test suite to view the GitHub icon over the test suite. Click on the icon to open a panel to the right.

By default, the “Push” action is selected when the side panel is opened. The side panel will also fetch the GitHub Repositories linked to the configuration.

When a GitHub Repository is selected, the dropdown for GitHub Branch will be filled with branches from the selected repository.

Input a folder path in the “Enter Folder Path” field to indicate the GitHub Folder where Qyrus should push the test scripts within this test suite to.

Existing folder names within the GitHub location may be used in this field along with new folder names that the user wishes to create within their specified GitHub location.

Best Practice Tip: Use the name of the Qyrus Test Suite as the value of the “Folder Path” field.

Note If the value of “Folder Path” is left empty then the name of the Qyrus Test Suite will automatically be used as the value for this field.

When clicked, “Link All Scripts in Suite” saves the data entered for the repository, branch and folder path. This action will create a link between the Qyrus Test Suite and the GitHub Folder.

Note Any existing links within the Qyrus Test Suite between Qyrus Test Scripts and GitHub Files/Test Cases will be overwritten with the data (repository, branch, and folder path) specified in the previous steps.

Commit Message is the message that will be attached to the folder pushed to GitHub.

'Push Selected' Option: When clicked, “Push Selected” will present a list of all test scripts within the test suite that do not have existing links to GitHub files. The user may then select the test scripts they wish to push to the specified folder path in GitHub.

'Push All' Option: When clicked, “Push All” will display a warning message, informing the user of the specified Folder Path that the test scripts within the test suite will be pushed to. Test scripts will be pushed to the specified GitHub location using the test script name as the file name.

Pulling a Linked Suite

To pull a Github folder into a Qyrus Test Suite, open up the side panel by clicking the Github icon when selecting a Test Suite.

Click the “Pull” button.

Required data for pull:

  1. Github Repository

    1. click the drop down and select a Github repository

  2. Github Branch

    1. click the drop down and select a Github branch

  3. Folder Path Name

'Pull Selected' Option: When clicked, “Pull Selected” will present a list of all test scripts within the test suite that have existing links to GitHub files. The user may then select the test scripts they wish to pull from the specified folder path in GitHub.

'Pull All' Option: When clicked, “Pull All” will display a toast message, informing the user if the pull action was successful.

NOTE: Both options will pull the latest commit for each linked Test Script within the Test Suite

Linking Files from Github to Qyrus Test Scripts

Navigate to the project a Github configuration is linked to. Hover over a script to view the Github icon over the script. Click on the icon to open a panel to the right.

***Screenshots below are for the Mobile Testing service, but can find the same functionality in Web Testing if you navigate to the Test Lab section of the service***

By default, the “Push” action is selected when the side panel is opened. The side panel will also fetch the Github Repositories linked to the configuration.

When a Github Repository is selected, the dropdown for Github Branch will be filled with branches from the selected repository.

Input a path in the “Enter Path Name” field to indicate where Qyrus should push the script to in Github. The path will end in the name of file that will be pushed to Github

When clicked, “Save path” saves the data entered for the repository, branch and path name.

“Commit Message” is the message that will be attached to the files pushed to Github.

The pushed Qyrus script will show up in the selected Github configuration.

Pulling A Linked Script

To pull a Github file into a Qyrus Script, open up the side panel by clicking the Github icon when selecting a Test script.

Click the “Pull” button.

Required data for pull:

  1. Github Repository

    1. click the drop down and select a Github repository

  2. Github Branch

    1. click the drop down and select a Github branch

  3. File Path Name

Unlinking a Suite

To remove the link between a Qyrus Suite and a Github folder. Open up the side panel of a linked suite by selecting the Github Icon.

Click the “Unlink All Scripts” button at the bottom of the side panel.

When clicked, a warning will be displayed informing the user that all existing links between Test Scripts and Github files within the Test Suite will be deleted.

Unlinking a Script

To remove the link between a Qyrus Script and a Github file. Open up the side panel of a linked script by selecting the Github Icon.

Click the red “Unlink” button at the bottom of the side panel.

Click the red “Delete” button to unlink the script. The Qyrus script is no longer linked to a Github file.

Notes

  • If a configuration is disabled, it would be unavailable to link scripts. Also, if a configuration has linked scripts already when it is disabled, the linked scripts will not have the Github icon over it if there are no other available configurations for the project. If there are other configurations, click on the Github icon for linked scripts that are part of the disabled configuration and unlink them in order to link them to other configurations.

Bitbucket

Configuration Setup

Navigate to the Integrations page either by clicking on the integrations icon

on the side navbar or by clicking on the icon from the dropdown of the person icon.

Click on the Bitbucket icon on the configuration page in the “All” section or “Continuous integration” tab

If there are no existing configurations, a form to create a new configuration will appear.

If there are existing configurations, there will be a list of configurations on the left panel and a detailed view of the configuration on the right.

To edit an existing configuration, click on the pencil once the configuration is selected from the left panel.

Click on the plus icon to create a new configuration.

Required fields in the form are marked the red asterisk:

Click on “Test Connection” to test the given credentials. A Toast message will appear depending on a success or error state.

Below the “Test Connection“ button, there is a section for selecting Qyrus projects which should display all the teams, services and projects that the current user is part of.

To create a configuration, the user must select atleast one Qyrus project.

***Keep in mind that a Qyrus project can either be linked to one “Continuous integration” service (Github or BitBucket) and not both ***

User can use the status toggle to make the configuration active/inactive. Inactive configurations cannot be used to link test cases from Bitbucket to Qyrus scripts.

A Configuration can be deleted by clicking on the trash icon and then the delete button in the confirmation dialog box. When a configuration is deleted, all the linked scripts of the configuration are also deleted.

Linking folders from BitBucket to Qyrus Suites

Navigate to the project a BitBucket configuration is linked to. Hover over a suite to view the BitBucket icon over the suite. Click on the icon to open a panel to the right.

***Screenshots below are for the Mobile Testing service, but can find the same functionality in Web Testing if you navigate to the Test Lab section of the service***

Pulling a Linked Suite

To pull a BitBucket folder into a Qyrus Test Suite, open up the side panel by clicking the BitBucket icon when selecting a Test Suite.

Click the “Pull” button.

Required data for pull:

  1. BitBucket Repository

    1. click the drop down and select a BitBucket repository

  2. BitBucket Branch

    1. click the drop down and select a BitBucket branch

  3. Folder Path Name

    1. choose a name for the file path in the repository

  4. *Optional* Commit ID

Linking folders from BitBucket to Qyrus Scripts

Navigate to the project a BitBucket configuration is linked to. Hover over a script to view the BitBucket icon over the script. Click on the icon to open a panel to the right.

***Screenshots below are for the Mobile Testing service, but can find the same functionality in Web Testing if you navigate to the Test Lab section of the service***

Pulling A Linked Script

To pull a BitBucket file into a Qyrus Script, open up the side panel by clicking the BitBucket icon when selecting a Test script.

Click the “Pull” button.

Required data for pull:

  1. BitBucket Repository

    1. click the drop down and select a BitBucket repository

  2. BitBucket Branch

    1. click the drop down and select a BitBucket branch

  3. Folder Path Name

    1. choose a name for the file path in the repository

  4. *Optional* Commit ID

By default, the “Push” action is selected when the side panel is opened. The side panel will also fetch the Bitbucket Repositories linked to the configuration.

When a Bitbucket Repository is selected, the dropdown for Bitbucket Branch will be filled with branches from the selected repository.

Input a path in the “Enter Path Name” field to indicate where Qyrus should push the script to in BitBucket. The path will end in the name of file that will be pushed to BitBucket

When clicked, “Save path” saves the data entered for the repository, branch and path name.

“Commit Message” is the message that will be attached to the files pushed to BitBucket.

If successful, a green Toast message will appear. Otherwise, a red Toast message will appear to indicate the push did not succeed.

Bulk Pushing and Pulling Scripts With Bitbucket

When the test suite has linked Bitbucket scripts, the user can push all of their linked scripts or pull all of their linked scripts.

In the picture above, the Bitbucket icon is now part of the test suite itself. By clicking the icon, the user is given the option to push or pull multiple scripts.

To push multiple scripts, a branch must be selected and a commit message must be provided. Next, the user can choose to push all linked scripts or selected linked scripts. If successful, a green toast message will appear.

To pull multiple scripts, a branch must be selected. The commit ID is optional. When commit ID field is empty, the most recent committed scripts on the selected branch will be pulled. If successful, a green toast message will apear.

When Delete All Script Links is selected, all of your linked scripts will be unlinked.

Unlinking a Script

After successfully saving the path and pushing or pulling, the script will become linked. You can click the “Unlink” button to unlink the script.

You will receive a prompt as shown above asking if you want to delete the link. Once you click the delete button a green toast message will appear on success.

Unlinking a Suite

You also have the option of unlinking all files at once shown in the image above

Now, when pulling a file, the user will first select the repository containing the file.

Afterwards the user needs to select branch name and enter the file path. Once again the user is able to save the path used.

The last thing needed is the commit hash of the file on Bitbucket. Once the user clicks the “Pull” button the current script will be replaced with the script in the Bitbucket repository. The commit hash can be found in the file information in bitbucket. There will be a green toast message if successful and the script will be replaced.

Last updated