Import using Postman

Import using Postman

Currently you need to import this endpoint twice (18/c): /repository/scenario/import

We are working on the scenario import to only have to do it once in the same way as how you need to execute only once every other endpoints also and not twice.

 

  1. For the prerequisites, please read the parent page first: https://jira-testifi.atlassian.net/wiki/spaces/CTF/pages/8850604037/Import+from+repository+to+CAST+GUI

  2. Open Postman

  3. Open a new request tab in Postman

  4. Set the request type to POST

     

  5. Navigate to the “Authorization“ tab and switch it to “No Auth“

     

  6. Navigate to the “Headers“ tab:

    1. add a new Key: “Authorization“ and don’t add any value yet to the Value column, we’ll add it later in step 15

    2. add a new Key: “Content-Type“ and add to the Value column this: “application/json”

       

  7. Navigate to the “Body“ tab, select “raw” from the sub-tabs and verify “JSON” is selected at the end of the line as a dropdown option

     

  8. Add this as a payload to the “raw“ sub-tab:
    {
    "gitConnection": {
    "branch": "string",
    "password": "string",
    "repoURL": "string",
    "skipSSLVerify": true,
    "username": "string"
    },
    "projectKey": "string"
    }



  9. Change the values of the payload based on the below mentioned explanation

  10. Navigate and login to the CAST:GUI where you want to import to

  11. On the home screen of the CAST:GUI press right click on the browser and click on the Inspect and navigate to the Network tab and refresh the page

  12. From the requests, near the end of the network list, find the last “properties” from the network list and just below the “properties“, click on the next element in the network list which starts with the project’s id like this:
    <projectId>?pageNumber=0&limit=5 …

     

  13. In the “Headers“ tab scroll a bit down in the “Request Headers“ section until you see this:
    Authorization: Bearer …

     

  14. Press the right click on the Bearer and click on the “Copy value”

  15. Go back to Postman and paste the copied value on the “Headers“ tab to the “Authorization“'s Value column from 6th point (6/a)
    important: Bearer token is valid only once doing the import. If you want to check the import on the UI, then continue the import then you need to refresh CAST:GUI’s home screen and redo step 11 and 12.

     

  16. Enter the Swagger page’s URL to the URL section in the top

     

  17. Add the endpoint to the end of the URL what you want to use from the Swagger’s git-controller

  18. Use the import in this order:

    1. /repository/sui-page/import

    2. /repository/building-block/import

    3. /repository/scenario/import (because of the above mentioned reason, currently you need to execute this endpoint twice)

    4. /repository/data/import

  19. Click on the “Send” button on the top right corner

  20. If the status is 200 then the import for that endpoint what you inserted is done

  21. For the next import using another endpoint add the selected endpoint to the end of the base url and click again on the “Send“ button

 

 

Explanation for the json at the gitImport:

  • branch: the name of the branch from which branch you’ll import (if the branch name is “feature/branch1” then the branch name will be “feature/branch1” and not just “branch1”)

  • password: this is the token what you generated for the repository Token generation for the repository

  • repoURL: when you want to clone the repo with HTTPS you can find this URL there and it should end with “.git”

  • skipSSLVerify: by default this is true, you don’t need to change on this

  • username: username for the repository (on BMW this is the QX)

  • projectKey: this is the project’s id https://jira-testifi.atlassian.net/wiki/spaces/CTF/pages/8983150593/How+to+find+project+s+id

 

last update: 2023.10.03.

Related content