Flow misses some request tests

The Problem:
When using a flow to automate testing, some requests specific tests are being missed. The missed tests are consistent and get in the way of making sure things work. Does anyone know why this happens?

Examples:
Flow Structure:

Test Results:
image
^ Both the status code and results exist tests are collection-level.

Login Tests:

const jsonData = pm.response.json();

pm.test("Successful login", function () {
    pm.expect(jsonData.success).to.equal(true);
});

pm.test("Correct user", function () {
    pm.expect(jsonData.user.userName.toLowerCase()).to.equal(pm.environment.get("username").toLowerCase());
});

Login Tests in Collection:
image

Site Id Tests:

const jsonData = pm.response.json();

pm.test("Exactly 1 result", function () {
    pm.expect(jsonData).to.be.an("array").and.have.lengthOf(1);
});

pm.test("Each result's site ID contains '" + pm.variables.get("site-id") + "'", function () {
    jsonData.forEach((item) => {
        pm.expect(item.siteId.toLowerCase()).to.include(pm.variables.get("site-id").toLowerCase());
    });
});

Site Id Tests in Collection:
image

Hi,
did you ever found a way to solve this?

I’m just facing the same issue:

Test results of the executed request in the collection:
grafik

Test summary from the flow:
grafik

Just to make sure I added some logging to the console, to see whether only the test summary output would be missing. That’s not the case.

These are my first two tests, from which only the first one is executed in the flow.

var element =  pm.response.json();
console.log(element);
pm.test("Test header", function () {
   //var element = pm.response.json();
    pm.expect(element.header.step.guid).to.eql("3fbf081d-2444-4dfd-b277-f57701061c4e");
    pm.expect(element.header.businessEntity.guid).to.eql("E554D815-F958-463A-B4DD-E2EB29B29FF2");
    pm.expect(element.header.workflow.guid).to.eql("bb1ea2d1-4fab-4233-9070-be8e12f98dd7");
    pm.expect(element.header.formType.guid).to.eql("7d2b358f-54c1-49cc-8982-5c80e78f2268");
   

});
pm.test("Test tasks", function () {
    pm.expect(element.tasks.directTasks.length).to.eql(1);
    pm.expect(element.tasks.directTasks[0].user.bpsId).to.eql(pm.variables.get("userB"));
});

No, I never found a solution. Ultimately, I decided that Flows were entirely incapable of meeting the needs of my project (for many reasons besides this one), so I haven’t made any more attempts to look for a fix.