When I submit my answer the âAuthorisation added correctlyâ test is failing with âAssertionError: expected âheaderâ to equal â{{token}}ââ and I canât work out why.
Here is what I have for the authorisation of the folder and all the requests in the folder inherit from the parent. Please can anyone help?
And if I change the index from 0 to 1 in the test it passes pm.expect(newFlowFolder.auth.apikey[0].value).equals("{{token}}") - so have I done something wrong or has the auth information been formatted differently in the response?
For the second part,
Arrays start at 0, so if you set âexpectâ to equal â{{token}}â for [0] then it would fail as [0] doesnât have this set⌠But [1] does have {{token}} set⌠Iâve added comments here so you can see the structure;
"type":"apikey",
"apikey":[ //<--- array starts here
//This is 0
{
"key":"in",
"value":"header",
"type":"string"
},
//This is 1
{
"key":"value",
"value":"{{token}}",
"type":"string"
},
//This is 2
{
"key":"key",
"value":"x-api-key",
"type":"string"
}
The {{token}} is a collection variable and when I hover over it in the authorization for the folder it is displayed ok so it should be getting the value of the variable OK, I believe.
The test that fails uses the array above that you have commented. Index 0 fails however if I change the test to index 1 it passes - that is why I am asking if something has changed in the array since the test was written as it looks like the test should be on index 1 item.
It is possible that the apikey array was changed to include the items that now live in index [0] (pushing your token check to index [1])⌠But youâd have to check with the API developer(s) to confirm⌠Or go through test run logs / check history etc.
In postman on the left you might be able to use the âhistoryâ tab to go back and look at what the response used to beâŚ
@elizavetaaantipina Can you share a link to your collection? You can either make your workspace public (as you will need to do it eventually when submitting) or follow the steps outlined here:
I can see that the Galaxy 101 test got changed quite significantly, so it just checks that the property exists instead of the full path to the item and value (which got broke because of the same array issue).
@elizavetaaantipina Iâve updated the tests on our end so when youâre finished with your 30 days feel free to submit here and the day 27 shouldnât have any issues.
Weâll get the tests in the collection updated later today.