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

the case is no test when add pm.sendrequest () on Tests, only repro when run it with newman #1631

Closed
wangdongna opened this issue Jul 19, 2018 · 5 comments
Assignees

Comments

@wangdongna
Copy link

Version and environment information:

Newman Version (can be found via newman -v): 3.9.4
OS details (type, version, and architecture): Linux version 3.16.0-4-amd64 ([email protected]) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.43-2 (2017-04-30)
Are you using Newman as a library, or via the CLI? : CLI
Did you encounter this recently, or has this bug always been there: Always
Expected behaviour: It should be all run and without no test
I use the following command:
newman run xxx.postman_collection.json --environment xxx.postman_environment.json --delay-request 1000 --timeout-request 3000 --reporters html --reporter-html-export xxx/${folder}/xxx${file}.html --reporter-html-template xxx/htmlreqres.hbs>>xxx/log/info${folder}.log
Command / script used to run Newman: Script
Sample collection, and auxiliary files (minus the sensitive details):
Screenshots (if applicable):

@kunagpal kunagpal self-assigned this Jul 19, 2018
@kunagpal
Copy link
Contributor

Hey @wangdongna, I'm not quite sure what the issue is here. Did you mean that the tests don't show up when pm.sendRequest is used in a test script? If so, could you share the smallest possible collection that helps us reproduce this issue? Thanks! 😄

@wangdongna
Copy link
Author

Hi,

Thanks for your quick reply.

When pm.sendRequest is used in a test script, like this:
<
var jsonData = pm.response.json();
var sid = String(jsonData.Result.Id);
var delUrl = pm.environment.get('host') + "/api/chart/deletetreenode/"+ sid;
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});

pm.sendRequest(delUrl, function (err, response) {});

And run the collection which include the above test script in some cases, the result display no test.

Thanks a lot!

--Emma

@wangdongna
Copy link
Author

Sorry for close it with incorrect operation and now reopen it. I am sorry for that

@kunagpal kunagpal assigned kunagpal and codenirvana and unassigned kunagpal Jul 24, 2018
@filipeamaral
Copy link

filipeamaral commented Aug 8, 2018

@kunagpal @shamasis Isn't this issue related with 1303?

@codenirvana
Copy link
Member

Duplicate of postmanlabs/newman-reporter-html#180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants