Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tank V2 API - Added Test Plans/Script Group support to project creation and update #257

Merged
merged 4 commits into from
Aug 10, 2023

Conversation

Zakaria-Kofiro
Copy link
Collaborator

@Zakaria-Kofiro Zakaria-Kofiro commented Aug 8, 2023

Tank V2 API - Added Test Plans/Script Group support to project creation and update
Tank V2 API POST /v2/projects and PUT /v2/projects/{projectId} now supports creating and updating test plans, and script groups, and adding scripts to projects in any order. Multiple Test Plans and Script Groups can be created or updated, with the order determined by the entry order they appear in the payload. Existing scripts can also be added to Script Groups. This new project data is also returned via GET requests to /v2/projects and /v2/projects/{projectId}.

POST /v2/projects

  • If testPlan list is empty or excluded from the payload, the new project is given a default empty Main test plan with 100% User Percentage

PUT /v2/projects/{projectId}

  • If testPlan list is empty, the existing test plan is left alone, but any valid entry into the testPlan array while updating will overwrite the existing test plan for the project

Parameters:

  • Test Plans:
    - Set Name
    - Set User Percentage
    - Set Script Groups
  • Script Groups
    - Set Name
    - Set Loop Count
    - Set Scripts
  • Scripts
    - Set Script ID
    - Set Loop Count

Sample Payload for POST/PUT:

"testPlans": [
    {
      "name": "One",
      "userPercentage": 25,
      "scriptGroups": [
        {
          "name": "OneSG1",
          "loop": 1,
          "scripts": [
            {
              "scriptId": 1137,
              "loop": 1
            },
            {
              "scriptId": 588,
              "loop": 1
            }
          ]
        }
      ]
    }
 ]
Screenshot 2023-08-08 at 10 18 49 AM

Sample Response from GET:

Note: Responses from GET also return relative positions for each Test Plans, Script Groups, and Scripts, while also returning script names for each script.

"testPlans": [
    {
      "name": "One",
      "userPercentage": 25,
      "position": 0,
      "scriptGroups": [
        {
          "name": "OneSG1",
          "loop": 1,
          "position": 0,
          "scripts": [
            {
              "scriptId": 1137,
              "name": " Simple Endurance Script - 5 m",
              "loop": 1,
              "position": 0
            },
            {
              "scriptId": 588,
              "name": "Simple Endurance Script - 10 m ",
              "loop": 1,
              "position": 1
            }
          ]
        }
      ]
    }

Validated for the following use cases:

  1. Script Loops
  2. Multiple Scripts
  3. Single Script
  4. Multiple Scripts w/ loops
  5. Script Group Loop
  6. Multiple Script Groups w/ loops
  7. Multiple Test Plans

Please make sure these check boxes are checked before submitting

  • ** Squashed Commits **
  • ** All Tests Passed ** - mvn clean test -P default

** PR review process **

  • Requires one +1 from a reviewer
  • Repository owners will merge your PR once it is approved.

@Zakaria-Kofiro Zakaria-Kofiro marked this pull request as ready for review August 8, 2023 16:26
@Zakaria-Kofiro Zakaria-Kofiro merged commit 3114765 into master Aug 10, 2023
@Zakaria-Kofiro Zakaria-Kofiro deleted the zkofiro/project-automation branch August 10, 2023 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants