Visualise tab is no longer displaying an image/gif

Hi All,

Over the past week i’ve been playing about with the test tab and the Visualise tab, within it i discovered you can display image/gif which can correspond to whether all tests successfully pass, and another image/gif if one or more tests fail (Just for a bit of Fun)

However today when i run a call with the same un altered code I’ve been using previously, the images aren’t displaying anymore.

Is anyone else getting this too?

Thanks!

This is how some of the “15 days of Postman” submit requests work.

So I’ve just copied a basic example from there and it still seems to work.

let pass = "success";

let template

if (pass == "success") {
    console.log("success");
    template = `🍪 passing!
        <br />
        <img src="https://media1.giphy.com/media/EQRgN1hTnd7RC/giphy.gif?cid=ecf05e47lvx92q279p7w07terp7lx1f7hfm9und0vcepp0s4&rid=giphy.gif&ct=g" />
    `
} else {
    console.log("failure");
    template = `🙅 please try again
        <br />
        <img src="https://media1.giphy.com/media/tuQXxbPB2SEIiJeBkj/giphy.gif?cid=ecf05e47vtwsiob8kittbfq9lkkey2d8sxpafphia58eoanq&rid=giphy.gif&ct=g" />
    `
}

pm.visualizer.set(template)

What does your “unaltered” code look like. We can try and replicate it.

Hi thanks for the response, yeah the 15 days of Postman is where i discovered this and used this example to explore and have fun with the GIFs resulting in the tests, but i did also use the Test Counter that it’s using too, the code i’m using is below.

// Test Counter
let pass = 0
let totalToPass = 3

let collection = pm.response.json().collection

console.log("The request that's running is", pm.info.requestName)


pm.test("Status code is 200", function () {
    pm.response.to.have.status(200);

    pass += 1
});

pm.test("Response time is less than 5000ms", function () {
    pm.expect(pm.response.responseTime).to.be.below(5000);

    pass += 1
});

pm.test("Response must be valid and have a body json", function (){
    pm.response.to.be.ok;
    pm.response.to.be.json

    pass += 1
});


// GIFs for Test Results
let template
if (pass == totalToPass) {
    template = `🟢 All Tests have Passed!
        <br />
        <img src="https://media.tenor.com/rz4Ii3zzuJkAAAAM/the-it-crowd-it-crowd.gif"/>
    `
} else {
    template = `🔴 Fails in the Test Run!
        <br />
        <img src="https://media.tenor.com/qp5VLQ9Cg24AAAAC/it-crowd-on-fire.gif"/>
    `
}
pm.visualizer.set(template)

I do get the results of test has passed/failed however the GIFs don’t display. I may have copied an additional character in there somewhere but I can’t spot it so another set of eyes are welcome.

I actually found out what the issue was, I was copying the code in from a Confluence page and it seems it just doesn’t like it in Postman, it either changes some characters or the Tests field doesn’t like the formatting when it’s pasted in.

I’ve got the code working now as expected.