I want to run Postman tests as a part of our CI pipeline. We use Bamboo for our CI Below is the cake file
#addin nuget:?package=Cake.Newman
#addin Cake.Npm
var InstallPostman = "Install-Postman";
Task(InstallPostman)
.Does(()=> {
var settings = new NpmInstallSettings();
settings.Global = true;
settings.LogLevel = NpmLogLevel.Silent;
settings.AddPackage("newman");
NpmInstall(settings);
});
var RunPostmanTests = "Run-Postman-Tests";
Task(RunPostmanTests)
.Description("Run postman tests for a given collection and environment file")
.IsDependentOn(UnzipTestPackage)
.IsDependentOn(RequiredPostmanFolders)
.IsDependentOn(InstallPostman)
.Does(() =>{
RunCollection (postmanIntegrationTestsFile, s=>
s.WithEnvironment(postmanEnvironmentFile)
.UseCLIReporter()
.UseJUnitReporter(postmanAcesTestResults)
);
});
RunTarget(RunPostmanTests);```
I am getting the following
========================================
Clean-Unzip-Folder
Executing task: Clean-Unzip-Folder
Cleaning directory C:/build/ACES-DEVSLN1683-INT/Aces.Tests.Integration
Finished executing task: Clean-Unzip-Folder
========================================
Unzip-Test-Package
Executing task: Unzip-Test-Package
Unzipping file C:/build/ACES-DEVSLN1683-INT/Aces.Tests.Integration.zip to C:/build/ACES-DEVSLN1683-INT/Aces.Tests.Integr
ation
Finished executing task: Unzip-Test-Package
========================================
Required-Postman-Folders
Executing task: Required-Postman-Folders
Finished executing task: Required-Postman-Folders
========================================
Install-Postman
Executing task: Install-Postman
Using addin: Cake.Npm v0.12.1.0 (0.12.1+Branch.master.Sha.9481fc976a2403a9c47abe3f54bd855068fd845d)
npm arguments: install --silent newman --global
c:\Users\packer\AppData\Roaming\npm\newman -> c:\Users\packer\AppData\Roaming\npm\node_modules\newman\bin\newman.js
[email protected] c:\Users\packer\AppData\Roaming\npm\node_modules\newman
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], uuid@3.
1.0, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], tunne
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], form-
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], har-validator@
5.0.3)
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], loda
[email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], h
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
Finished executing task: Install-Postman
========================================
Run-Postman-Tests
Executing task: Run-Postman-Tests
An error occurred when executing task 'Run-Postman-Tests'.
Error: One or more errors occurred.
Newman: Could not locate executable.```