Skip to content

First use of ".not." in assertion change behaviour of all following assertions to negative #4286

@GrzegorzPi

Description

@GrzegorzPi

App Details:

Postman for Windows
Version 6.0.8
win32 10.0.16299 / x64

Issue Report:

  1. send (with status 200) request with json body response, for instance:
{
    "item_list",
    "pagination": {
        "pages": 1
    }
}
  1. in test page put code contain assertion: "pm.response.to.not.be.error;" for instance:
 pm.test('has pagination', function () {
    pm.response.to.have.jsonBody('pagination');
    pm.response.to.have.jsonBody('pagination.pages');
});

pm.test('wired behaviour: to.not.be.error', function () {
    pm.response.to.have.jsonBody('pagination.pages');
    pm.response.to.not.be.error;
    pm.response.to.have.jsonBody('pagination');
});

pm.test('has pagination after to.not.be.error', function () {
    pm.response.to.have.jsonBody('pagination');
});
  1. result is corrupted, assertion after to.not.be.error start to fail with reason:
    response to not contain
    but we never use assertion to.not.have.jsonBody

Screen:

postman

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions