Create a manual test

You can use API resources to work with ALM Octane manual test entities. 

Overview

The tests entity is a composite, resource collection that represents all subtypes of ALM Octane tests: 

Working with these test subtypes are described in this topic:

  • Manual tests, and their test steps

  • Gherkin tests, and their scripts

  • Test suites, and their manual and Gherkin tests

To work with automated tests, see Working with automated tests and pipelines.

The subtype attribute distinguishes between the test types in the test resource collection.

Work with the tests resource collection to: 

  • See or query all tests, regardless of subtype

  • Add steps to manual tests

  • Add scripts to Gherkin tests

Work with the individual resource collections (manual tests, Gherkin tests, and test suites) to focus only on those subtypes.

Back to top

GET: Read manual tests

To see all tests, regardless of test subtype:

GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/tests
        

To see only manual tests, use one of the following:

  •  GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/tests?query="subtype EQ 'test_manual'"
  • GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/manual_tests

Back to top

POST: Create a manual test

We add manual tests using the manual_tests resource collection.

To create a manual test: 

This example creates a manual test named MyManualTest with status (phase) 1009, which is the New phase.

POST .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/manual_tests
     {"data":[
       {
         "phase":{
                    "id": 1009,
                    "type":"phase"
                 },
         "name":"MyManualTest" 
       }    ]
     }

Back to top

GET: See an existing manual test's steps

Manual test steps are saved as separate script resources in ALM Octane's internal repository. Access the script resource by specifying the script entity after the manual test's ID in a REST API call.

To see existing steps for a manual test: 

This example displays the script for the manual test whose ID is 1015.

GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/tests/1015/script
{
  "creation_time": "2017-04-18T22:07:23Z",
  "last_modified": "2017-04-19T02:15:12Z",
  "script": "- This is a setup step. Here is where you write should be done before you start\n- You can have as many setup steps as you need.  They will not be validated.\n- For example, you can ask that the user will be logged in\n- and be in the appropriate part in the application\n- and take a specific action\n- ?You can then validate that what should've happened actually did\n- ?Or even validate multiple things\n- There's no problem to mix and match the step types\n"
}

Back to top

PUT: Add steps to a manual test

Manual test steps are saved as a separate script resource in ALM Octane's internal repository. Access the test steps script resource by specifying the script entity after the test ID in a REST API call.

We add test steps using the tests resource collection. Adding test steps using the manual_tests resource collection is not supported.

When adding steps to a manual test, existing steps are replaced.

To add steps: 

This example adds two steps to the manual test whose ID is 1013, and labels the revision type as minor. Revision types can be Major or Minor.

PUT /api/shared_spaces/<space_id>/workspaces/<workspace_id>/tests/1013/script
{
   “script":"- Step 1: Log in. \n- ?Step 2: Was login successful?",
   "comment":"Test the login process.",
   "revision_type":"Minor”
}

Back to top