Open mattiashjorth opened 4 years ago
I think the problem is the report not being present in the location. In your newman run script, try using $(System.DefaultWorkingDirectory)/Results/htmlReport.html path to create the results in the $(System.DefaultWorkingDirectory)/Results directory
I am running into the same issue
script: 'newman run postman_collection.json -e test.postman_environment.json --reporters htmlextra --reporter-htmlextra-export $(System.DefaultWorkingdirectory)\Results\htmlReport.xml
steps:
I see the same spinning "Waiting for task results" screen
Hi nikohsieh!
In my case the actual problem was in the installation step. The syntax I tried with was wrong, after change to a one-liner it worked for me. Try to specify the installation step like this:
npm install -g newman newman-reporter-htmlextra
Hi nikohsieh!
In my case the actual problem was in the installation step. The syntax I tried with was wrong, after change to a one-liner it worked for me. Try to specify the installation step like this:
npm install -g newman newman-reporter-htmlextra
Hi Mattiashjorth,
I tried your suggestion and it's the same, I am still getting the spinning circle waiting for task results. I confirm that the html reports are in the folder but not sure why it's still not working.
steps:
task: DownloadSecureFile@1 displayName: EnvSecureFile inputs: secureFile: 'environment.json'
script: | npm install -g newman newman-reporter-htmlextra workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Install Newmn'
powershell: | $secureFilePath = "$env:SECUREFILEPATH" $collectionPath = "$env:WORKINGDIR"
$postmanCollection = Get-ChildItem -path $collectionPath | where {$_.Name -like "Reg*"} | select name, fullname
foreach($file in $postmanCollection){
$reporTitle = $file.name.split('.')[0]
$output = $collectionPath + "\Results\" + $file.Name.split('.')[0] + ".html"
newman run $file.FullName --insecure --reporter-htmlextra-title $reporTitle.ToString() --reporter-htmlextra-export $output -r htmlextra -e $secureFilePath -n 1
}
ignoreLASTEXITCODE: true displayName: 'Run Postman Tests' env: SECUREFILEPATH: $(EnvSecureFile.secureFilePath) WORKINGDIR: $(System.DefaultWorkingDirectory)
task: MaciejMaciejewski.postman-report.UploadPostmanHtmlReport.UploadPostmanHtmlReport@1 displayName: 'Upload Postman Html Report' inputs: cwd: '$(System.DefaultWorkingDirectory)\Results\' tabName: 'ASAPP_Tests' condition: succeededOrFailed()
Hi!
I've implemented this task both in the build pipeline and in the release pipeline. Everything looks good and the tasks finishes with success but the html-reports is never displayed in the tab in the DevOps-portal. After the loading indicator the tabs gets black:
This is how the steps in the build pipeline looks:
steps:
script: | npm install -g newman npm install -g newman-reporter-htmlextra workingDirectory: '$(System.DefaultWorkingDirectory)' displayName: 'Install Newman'
script: 'newman run postman_collection.json -e test.postman_environment.json --reporters cli,junit,htmlextra --reporter-junit-export Results\junitReport.xml --reporter-htmlextra-export Results/htmlReport.html' displayName: 'Run API Integration Tests' continueOnError: false
task: PublishTestResults@2 displayName: 'Publish Test Results' condition: succeededOrFailed() inputs: testResultsFiles: '**/junitReport.xml'
task: UploadPostmanHtmlReport@1 displayName: 'Upload Postman Html Report' condition: succeededOrFailed() inputs: cwd: '$(System.DefaultWorkingDirectory)/Results' tabName: 'Postman Test'
Am I doing something wrong or is it an error?