Day 29: Webhooks. Requests added | AssertionError:

I have a test failed Requests added | AssertionError: check trigger request url: expected ‘{{webhookUrl}}’ to include ‘https://newman-api.getpostman.com/run

I don’t get why I get this error if my webhookUrl variable contains everything what is mentioned in the test?
I also double checked any other variable in the collection and it seems to be good.


Dropping screenshots
I can provide more screenshots if you have any ideas. Please help, I have tried everything and I could find the solution on the Internet

UPD:
If I use the regular URL in the url the test is passed, but if I use he collection variable webhookUrl which contains url it shows an error? How come? Can somebody explain it to me?

Your first screenshot isn’t showing the failing test.

    let triggerRequest = folder.item.find(req => { return req.name === "Trigger Webhook"})
    pm.expect(triggerRequest.name, 'check trigger request name').equals("Trigger Webhook")
    pm.expect(triggerRequest.request.method, 'check trigger request method').equals("POST")
    pm.expect(triggerRequest.request.url.raw, 'check trigger request url').includes("https://newman-api.getpostman.com/run")

The instructions for this part show the following.

  • The request URL is the webhookUrl received in the previous step; paste that value into the URL field

It says to paste the value, not the variable name.
Therefore the failing test is treating {{webhookURL}} as a string and failing.

Thank you for your response. Very clear :slight_smile: