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

Open
wangdongna opened this Issue Jul 19, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@wangdongna
Copy link

wangdongna commented Jul 19, 2018

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 (debian-kernel@lists.debian.org) (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

This comment has been minimized.

Copy link
Member

kunagpal commented Jul 19, 2018

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

This comment has been minimized.

Copy link
Author

wangdongna commented Jul 19, 2018

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

This comment has been minimized.

Copy link
Author

wangdongna commented Jul 19, 2018

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

This comment has been minimized.

Copy link

filipeamaral commented Aug 8, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.