12
Creating and using the Git repository for SoapUI Tests Introduction SoapUI project files are valuable software assets which need to be managed and backed up. To make use of this project and its repositories you need to clone the repository locally on your PC/drive and create your development branch (es). The instructions below provide a step by step process to achieve this and below this is a section on usage after cloning the repository. This guide is structured (largely) with an instruction e.g. ‘Click [Home]’ followed by a screen shot of what you would expect to see on clicking [Home]. On the Git server a project has been created called ‘ODT-tests ‘in which two repositories have been created: NTXSIT – this directory is intended to hold NTX related SoapUI artefacts such as API tests We have created several NTX API SoapUI projects to validate the RESTful APIs which use Json (rather than Xml) in the request/response messages i.e. ‘ NTXD API -REST-Testing.xml’ ODMSIT - this directory is intended to hold ODM related SoapUI artefacts such as ODM rule tests i.e. CT-Blood-Group-TEST-ODM.xml We have created a lot of ODM SoapUI projects to validate blood groups, donors, Transplant Benefit Score, UKELD score etc. These are SOAP APIs which use Xml in the request/response messages i.e. ‘ NTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you need to add a ‘Centre rotation’ test and associated supporting information and files, you may choose to create a directory in your local Git repository e.g. ‘/Centre rotation’ in which you place your files you then commit this to the server repository, the repository now reflects the structure change. Creating your local Git Repository

community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

Creating and using the Git repository for SoapUI Tests

Introduction

SoapUI project files are valuable software assets which need to be managed and backed up. To make use of this project and its repositories you need to clone the repository locally on your PC/drive and create your development branch (es). The instructions below provide a step by step process to achieve this and below this is a section on usage after cloning the repository. This guide is structured (largely) with an instruction e.g. ‘Click [Home]’ followed by a screen shot of what you would expect to see on clicking [Home].

On the Git server a project has been created called ‘ODT-tests ‘in which two repositories have been created:

NTXSIT – this directory is intended to hold NTX related SoapUI artefacts such as API tests

We have created several NTX API SoapUI projects to validate the RESTful APIs which use Json (rather than Xml) in the request/response messages i.e. ‘NTXD API -REST-Testing.xml’

ODMSIT - this directory is intended to hold ODM related SoapUI artefacts such as ODM rule tests i.e. CT-Blood-Group-TEST-ODM.xml

We have created a lot of ODM SoapUI projects to validate blood groups, donors, Transplant Benefit Score, UKELD score etc. These are SOAP APIs which use Xml in the request/response messages i.e. ‘NTXD API -REST-Testing Baselined 180417.xml’

Note that these directory structures will change as more SoapUI artefacts are added, e.g. you need to add a ‘Centre rotation’ test and associated supporting information and files, you may choose to create a directory in your local Git repository e.g. ‘/Centre rotation’ in which you place your files you then commit this to the server repository, the repository now reflects the structure change.

Creating your local Git Repository

The following steps are only required once on your PC to setup your local repository or when you wish to create a new local repository.

1. Open Visual Studio and log in to VSTS.

2. Connecting to the SoapUI Project

a. Select [Team Explorer] b. Select the [Green plug] icon c. Select [Manage Connections]

Page 2: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

d. Select [Connect to Team Project]

e. Check ODT-Tests under Team Projects as shown below (Test Automation may already be checked)

Note – if you cannot see ODT-Tests you will need to be allocated permission to see this group by Admin

f. Select [Connect]

Page 3: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

g. Right/Click the ‘NTXSIT’ text and click

h. Select link, the ‘Browse For Folder’ window will open (see below left side), select destination repository and click [OK]

Page 4: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

i. Then Click [Clone] (see above, right side), the window below will be displayed. Repeat for ODMSIT

Page 5: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

3. Adding folders to your local repository location

Your local PC repository is as shown in the screenshot below i.e. C:\Users\<yourname>\Source\Repos\e.g. C:\Users\nhorne\Source\Repos\ODT-Tests\ODMSIT\SoapUI\ODMRules\Cardiothoracic

If required create the directory and place a file e.g. ‘placeholder.txt’ in each directory; this is so that GIT will create the structure on the server (see figure below).

[Note that the CTLung*.* files would not be in the folder at this point]

4. Create a ‘personal’ local private branch

When you have carried out the setup steps above you will have a local private branch called ‘DEV_Hub3’ and a branch on the server called ‘DEV_Hub3’ which can cause confusion, See figure below.

You will most likely be developing SoapUI tests either by taking an existing SoapUI project file and modifying it or creating a new SoapUI project.

Best practise is to create your own local private branch in which you carry out your own development work, e.g. <your initials>_ followed by a short description of the change (e.g. ‘NH_UKELD_AddnewFiles’) from DEV_Hub3, to do this:

a. Select the green plug icon in Team Explorer b. Select either ODT-Tests/NTXSIT or ODT-Tests/ODMSIT

c. Select the ‘Branches’

d. Double click DEV_Hub3 in ‘Branches’, select ‘Home’ , select ‘Sync’

(this is to ensure that any changes made by anyone else and pushed to the server branch are included in your local copy before creating your local private branch)

Page 6: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

e. Select ‘Branches’ f. Right click DEV_Hub g. Select ‘New Local Branch From’h. Enter your own branch name e.g. NH_Additional_BG_Preferablesi. DEV_Hub3 should already be pre-filled if not select DEV_Hub3j. Select ‘Create Branch’

5. Using the Repository

Having created the repository we can now check files into the local repository. Note that when checking SoapUI project files into Git you should remove your username/password from the file.To do this open the SOAP project file in an editor i.e. Notepad++ and search for:

Username, change the username to e.g. ‘my username’ Password, change the password to e.g. ‘my password’

When you checkout a project file and wish to run it you will need to update ‘username’ and ‘password’ to be your login credentials.

6. Checking in and modifying a file

In this scenario I am adding a file to the C:\Users\nhorne\Source\Repos\ODT-Tests\ODMSIT\SoapUI\ODMRules\Liver\UKELD see below

1. Add files you have modified or wish to add to your local repository file system, in this case ‘Liver UKELD SoapUi Project.xml’

Page 7: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

2. View the file(s) in VSTS Select ChangesNote: it is good practise to include details of the WSDL/ODM/API/Release version in the comments section

3. On Changes pane (see above) add a Commit description and select [Commit All], the changes will be committed locally

4. Select ‘Sync’ (see the ‘! Commit’ line above) to commit/push the changes to your server local branch Note that if this is the first time, you will get the following message as the branch has not yet been published, Select ‘Publish’ to complete the Sync (see below)

Page 8: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

5. The branch and changes have now been committed and pushed (published) to the server

6. Create a ‘Pull Request’ to get your changes reviewed and approved, select ‘Create a pull request’

Note: You may be required to login to Microsoft Visual Studio at this point.

7. The Pull Request has been created, you can now Approve/Complete the requestNote that typically the reviewer/approver should not be the person making the change

Page 9: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

8. A dialogue box will appear, note that the ‘Delete NH_DEV_Hub3 after merging’ is checked, this is the remote/server private branch and should be deleted so leave checked and select [Complete merge]

9. To verify your changes, select DEV_Hub3 top left of page (next to your name) and browse to find your file ‘Liver UKELD SoapUi Project.xml’

10. Return to VSTS and if you have finished working on this change delete your local private branch, switch to the local DEV_Hub3 branch (changes to bold), right click your local private branch and select Delete

Note that in VSTS you may still see you private branch on the remote/server still displaying under remotes/origin in ‘Branches’, delete the branch.

11. If you go to your local repository you will now see there are no files

Page 10: community.smartbear.com€¦ · Web viewNTXD API -REST-Testing Baselined 180417.xml’ Note that these directory structures will change as more SoapUI artefacts are added, e.g. you

12. You now need to synchronise your local development branch ‘DEV_Hub3’ with the remote/server branch ‘DEV_Hub3’

a. Select Home b. Select Sync c. On the Synchronization page select Syncd. You will get a Successfully Synchronised message, e. Go to your local file system repository and you will see that files have appeared

13. If you have any more changes create a new local private branch and repeat the process, remember to ‘Sync’ DEV_Hub3 before creating your local private branch, have GIT fun!

Note that when creating local private branches prefixed the branch with your initials followed by a short description of the change e.g. NH_UKELD_AddnewFiles.

Remember best practice is to delete both the local private branches from the server and your local copy when you have completed your changes.