question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update docs for `folder` option to include filtering individual request

See original GitHub issue
  1. Newman Version (can be found via newman -v): 4.5.7

  2. OS details (type, version, and architecture): MacOS 10.13.4

  3. Are you using Newman as a library, or via the CLI?: Library

  4. Did you encounter this recently, or has this bug always been there: N/A

  5. Expected behaviour: Newman’s folder option is for filtering requests by folders/subfolders according to docs. But it can also be used to filter individual requests (just like it is possible in Runner). Either this is a bug or please update the docs to reflect the same.

  6. Sample collection, and auxiliary files (minus the sensitive details):

Tests.postman_collection.json

{
	"info": {
		"_postman_id": "8749796c-f4b2-4bc7-bb0a-4ff75a4b5ad6",
		"name": "Tests",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "User",
			"item": [
				{
					"name": "Create user",
					"item": [
						{
							"name": "Create user",
							"event": [
								{
									"listen": "test",
									"script": {
										"id": "dc56e524-af80-47f2-bb6b-e60047966c18",
										"exec": [
											"pm.test('status ok', () => {",
											"    pm.response.to.have.statusCode(200);",
											"})"
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"method": "PUT",
								"header": [
									{
										"key": "Content-Type",
										"name": "Content-Type",
										"value": "application/json",
										"type": "text"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{{request_body}}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "localhost:3000/api/user/create",
									"host": [
										"localhost"
									],
									"port": "3000",
									"path": [
										"api",
										"user",
										"create"
									]
								}
							},
							"response": []
						}
					],
					"protocolProfileBehavior": {},
					"_postman_isSubFolder": true
				},
				{
					"name": "Get user",
					"item": [
						{
							"name": "Get user",
							"event": [
								{
									"listen": "test",
									"script": {
										"id": "ce9db536-6ad4-49a0-96fe-7a1423e4f6a4",
										"exec": [
											"pm.test('status ok', () => {",
											"    pm.response.to.have.statusCode(200);",
											"})"
										],
										"type": "text/javascript"
									}
								}
							],
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "localhost:3000/api/user/{{user_id}}",
									"host": [
										"localhost"
									],
									"port": "3000",
									"path": [
										"api",
										"user",
										"{{user_id}}"
									]
								}
							},
							"response": []
						}
					],
					"protocolProfileBehavior": {},
					"_postman_isSubFolder": true
				},
				{
					"name": "Delete user",
					"event": [
						{
							"listen": "test",
							"script": {
								"id": "7f0215b7-5087-4472-b994-29a42974b1e1",
								"exec": [
									"pm.test('status ok', () => {",
									"    pm.response.to.have.statusCode(200);",
									"})"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "localhost:3000/api/user/{{user_id}}",
							"host": [
								"localhost"
							],
							"port": "3000",
							"path": [
								"api",
								"user",
								"{{user_id}}"
							]
						}
					},
					"response": []
				},
				{
					"name": "Update user",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"id": "47b707b7-46e9-41ca-9e55-3f74861bdadb",
								"exec": [
									""
								],
								"type": "text/javascript"
							}
						},
						{
							"listen": "test",
							"script": {
								"id": "27ce6b9d-9417-4520-9fe3-b36ef178c783",
								"exec": [
									"pm.test('status ok', () => {",
									"    pm.response.to.have.statusCode(200);",
									"})"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"name": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{{request_body}}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "localhost:3000/api/user/{{user_id}}",
							"host": [
								"localhost"
							],
							"port": "3000",
							"path": [
								"api",
								"user",
								"{{user_id}}"
							]
						}
					},
					"response": []
				}
			],
			"protocolProfileBehavior": {}
		}
	],
	"protocolProfileBehavior": {}
}
  1. Screenshots (if applicable):

As can be seen in the screenshot, filtering a single request is possible in the Collection Runner. The same is possible through the folder option but is not mentioned in the docs. Screen Shot 2019-12-17 at 11 01 27 AM

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Suhasnamacommented, Mar 5, 2020

Opened a new PR for this issue #2253

1reaction
codenirvanacommented, May 25, 2020

Closing as the following PR https://github.com/postmanlabs/newman/pull/2253 got merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Filtering files in a pull request - GitHub Docs
On the pull request, click Files changed. Use the File filter drop-down menu, and select, unselect, or click the desired filters. Optionally, to...
Read more >
Folder Filtering & Mapping in MigrationWiz
The following guide explains folder filtering and mapping, and how to apply them in MigrationWiz. These options can help simplify and...
Read more >
Use filtering to modify a SharePoint view - Microsoft Support
Filtering reduces the number of items displayed in a view to just the data your want to see. A filter selects items that...
Read more >
Adding and editing user-defined dashboard filters | Looker
Understand how to create and edit dashboard filters. ... This updates the Add Filter window with options to select a model, an Explore, ......
Read more >
Search for Files, Folders, and Content - Box Support
To open the filter menu, click the Search Options icon on the right side of the search bar. Under the Content Filters tab,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found