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

[Issue] Tests with conditions lead to infinite run #81

Open
EugenePetrik opened this issue Jun 21, 2022 · 1 comment
Open

[Issue] Tests with conditions lead to infinite run #81

EugenePetrik opened this issue Jun 21, 2022 · 1 comment

Comments

@EugenePetrik
Copy link

Tools:

  • Postman + Newman

If the test has conditions and the condition is false (we don't execute pm.test() {} in the condition block), I see the test in the report and it will never end.

Example:

let jsonData = JSON.parse(responseBody);

for (let i = 0; i < jsonData.data.length; i++) {
    let id = jsonData.data[i].id;

    pm.test("event id != null", function () {
        pm.expect(jsonData.data[i].id).to.not.eql(null);
    });

    let event_type = jsonData.data[i].attributes.type;

    if (event_type === "event") {
        pm.test("event type === null", function () {
            pm.expect(jsonData.data[i].relationships.event_type).to.eql(null);
        });
    }
}
@dgosantos89
Copy link

#94

@AmsterGet AmsterGet linked a pull request Aug 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants