Day2 (of 30 Day Challenge) - Unable to find solution

I have gone through the documentation while checking my requests but I can’t figure out what’s triggering the first assertion to fail (Please refer to the screenshot below). Help and explanation would be appreciated.

Hey @vicki-apitest :wave:

Could you provide me with URL of your Public Workspace, please?

Hi @danny-dainton ,
Here it is as requested.
https://www.postman.com/warped-zodiac-806609/workspace/30-day-challenge-vicki-j

1 Like

Hey @vicki-apitest :wave:

It looks like, in your original screenshot, you have changed the official test code in the 30 Days of Postman Collection to something else:

In this request, in the Workspace link you provided, it’s been changed again to this:


The first 10 lines on the script in the Tests tab for the submit request should be like this:

// counter for passed tests
let pass = 0
let totalToPass = 5

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

pm.test("If you have any failures, review the failed test results or ask for support in the community forum. Remember to save your changes if you update the collection. When all of your tests pass, you are done with today's challenge.", () => {
    pm.expect(true);
    pass += 1
});

I’m not sure if that’s the issue or not because I haven’t run your Collection but it’s something that has been changed.

For the training courses, the automation that checks the final submission is running off a main collection, it’s something that doesn’t change. If test code is changed in the forks to pass the tests, it will fail in the final submission. Something to be mindful of when completing each day.

The training isn’t designed to catch you out so there shouldn’t be a need to change any of the tests locally, the issue is more than likely down to not following the instructions correctly. :pray:

Thanks for looking into it. It’s passing as expected. I don’t think I made any changes to the original test script but I might’ve accidentally done something to it shrug

OK, just seeing it changed to:

pm.expect(pass).to.equal(totalToPass)

Was significant enough to suggest something was manually changed. :sweat_smile::grimacing:


You’re still missing the totalToPass variable from that script which wouldn’t impact the tests but has probably broken the visualizer output in that request.

Yes, you’re right! I had a look at the original test script and I could see one or two differences, oops! :sweat_smile: Thanks again!

This topic was automatically closed after 30 days. New replies are no longer allowed.