...
Field mapping (Postman → AIO Tests)
The below table summarises summarizes how a Postman API Tests gets translated to an AIO Case.
Postman field | AIO Tests Field | Example |
---|---|---|
Name of request | Title | PublicApi - Get TestCase Priority |
Name of request | Automation key | PublicApi - Get TestCase Priority |
Request endpoint | First step in Given | GET {{SERVER_URL}}/project/{{JIRA_PROJECT_ID}}/config/testcase/priority |
Query Params | Data in first step | Query: startAt=0&maxResults=100&needDataInRTF=true |
Body params | Data in first step | {"testRunStatus": "Passed<b>NR</b>1", "effort": 180, "comments": ["Comment line1", "Comment line2"] } |
Form Data | Data in first step [FormData: key2=value2] | FormData: file = "/file.json" |
URL Encoded Body | Data in first step [ URLEncoded: key = value ] | URLEncoded: what = for |
Headers | No mapping | |
First assertion (if any) | Step 2 with Then keyword |
|
Rest of the assertions | Step 3 and forth with And as keyword |
|
Reponse size, response code, response time | Actual result of first step | |
Variable values [ Env, collection ] | Actual result of first step | |
Request Error [ happens when server URL is invalid] | Actual result - against first step | RequestError{ errno=-3008, code='ENOTFOUND', syscall='getaddrinfo', hostname='{{cloud url}}'} |
Assertion Failures | Actual result |
|
Mapping Postman tests to existing AIO Tests
...
If no case key is added to the name of the API, then a new case is created in AIO Tests, with the field mappings as explained in the section : Field mapping (Postman → AIO Tests)
The automation key of this newly created case is set to the name of the API. The subsequent times when the API test is run, the cases are identified by the automation key.
...
CLI Options
With Newman CLI
CLI Option | Description | Example |
---|---|---|
| To enable or disable reporter for a particular run. Defaults to true. |
|
| To enable or disable reporter for a particular run. Defaults to true. |
|
| Jira Project key - the Jira project to which the results need to be reported |
|
| Only for Jira Cloud |
|
| Only for Jira Server/DC |
|
| Only for Jira Server/DC |
|
| Set to true to create new cycle for run. |
|
| If createNewCycle is false, then the cycleKey identifies the existing AIO Tests Cycle to be updated |
|
| If createNewCycle is true, the newCycleTitle specifies the name of the cycle to create |
|
| Defaults to false. Set to true to create a new run for each execution. |
|
| Defaults to true. Set to false, if cases without case Key mapping should be reported as failures. |
|
| Defaults to true. Set to true to override data from report to overwrite the manual case in AIO Tests. Set to false, if case should not be updated. e.g If a new assertion is added in Postman, if bddForceUpdateCase is true, it would be added as a new step, else it would be reported as failure. |
|
With Newman as a Library
All the CLI functionality is available for programmatic use within a nodejs
script.
...