I have a postman collection, where the endpoint points to a physical file that is used to upload to execute. I am configuring this to run in Azure pipeline and need to use the file path that is in an azure repository. I am using Newman CLI to run this in Azure.
here is the postman collection snippet. I changed the path of the file (previously on c: drive) to use the location in Azure repo now
item": [
{
"name": "GameInstall",
"protocolProfileBehavior": {
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "Bearer eyJraAcg",
"type": "string"
},
{
"key": "key",
"value": "Authorization",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "x-api-key",
"value": "ee32-4ffb-424e-b8f0-46c0768",
"type": "text"
}
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "gamePresetFormFile",
"type": "file",
"src": "$(System.DefaultWorkingDirectory)/test/AxiomAdministratorCore.DataGeneration.Tests/DataGeneration.Tests/GameInstall/11016_50300_HTML5Desktop-FeatureSlot-BurningDesire.zip
},
{
"key": "gameContentFormFile",
"type": "file",
"src": "$(System.DefaultWorkingDirectory)/test/AxiomAdministratorCore.DataGeneration.Tests/DataGeneration.Tests/GameInstall/BurningDesire.zip"
}
]
},
In Azure, I setup my pipeline task as a Newman Run command that does this: "C:\Users\Build\AppData\Roaming\npm\newman" run $(Release.PrimaryArtifactSourceAlias)\test\CoreDataGeneration.Tests\DataGeneration.Tests\PostMan\GameInstalls.postman_collection.json -e $(Release.PrimaryArtifactSourceAlias)\test\Core.DataGeneration.Tests\DataGeneration.Tests\PostMan\Axiom-Test.postman_environment.json -r cli,junitfull -- reporter-junitfull-export $(Release.PrimaryArtifactSourceAlias)\report.xml
I get this error when the task runs:
GameInstall_BurningDesire
┌
│ 'Form param `gamePresetFormFile`, file load error: "$(
│ System.DefaultWorkingDirectory)/test/AxiomAdministrato
│ rCore.DataGeneration.Tests/DataGeneration.Tests/GameIn
│ stall/11016_50300_HTML5Desktop-FeatureSlot-BurningDesi
│ re.zip", no such file'
│ 'Form param `gameContentFormFile`, file load error: "$
│ (System.DefaultWorkingDirectory)/test/AxiomAdministrat
│ orCore.DataGeneration.Tests/DataGeneration.Tests/GameI
│ nstall/BurningDesire.zip", no such file'